Skip to content

fix(function-autoscaler): move TracingGuard above the test module so clippy passes - #545

Open
mesutoezdil wants to merge 1 commit into
NVIDIA:mainfrom
mesutoezdil:mesutoezdil/fix/autoscaler-clippy-test-module
Open

fix(function-autoscaler): move TracingGuard above the test module so clippy passes#545
mesutoezdil wants to merge 1 commit into
NVIDIA:mainfrom
mesutoezdil:mesutoezdil/fix/autoscaler-clippy-test-module

Conversation

@mesutoezdil

@mesutoezdil mesutoezdil commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

cargo clippy -p rs-autoscaler --all-targets -- -D warnings, the command in
this subtree's AGENTS.md, exited 101 on a clean checkout: TracingGuard sat
after #[cfg(test)] mod tests and #![deny(warnings)] turns
clippy::items_after_test_module into an error, masking every other clippy
finding in the crate. Moved the struct and its Drop impl above the test
module.
Pure code motion, no logic change. cargo clippy -p rs-autoscaler --all-targets -- -D warnings now exits 0 with nothing else reported for the crate, cargo test -p rs-autoscaler passes (117 tests), cargo fmt --check clean. Existing
tests cover the file; the failure was a lint gate, not runtime behavior.

Issues

Closes #544

Summary by CodeRabbit

  • Refactor
    • Improved the internal organization of tracing cleanup logic.
    • Removed redundant implementation details to improve maintainability.
    • Tracing initialization and shutdown behavior remain unchanged.
    • No user-visible behavior changes are included in this update.

@mesutoezdil
mesutoezdil requested a review from a team as a code owner July 29, 2026 21:35
@mesutoezdil
mesutoezdil requested a review from sparve-nv July 29, 2026 21:35
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 89de99c1-9301-4abb-8530-e672110fa3ea

📥 Commits

Reviewing files that changed from the base of the PR and between 53cbefe and 7ef6236.

📒 Files selected for processing (1)
  • src/control-plane-services/function-autoscaler/crates/server/src/tracing_init.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/control-plane-services/function-autoscaler/crates/server/src/tracing_init.rs

📝 Walkthrough

Walkthrough

TracingGuard and its Drop implementation now appear before the test module. Tracing initialization and shutdown behavior remain unchanged.

Changes

Tracing initialization layout

Layer / File(s) Summary
Move tracing guard before tests
src/control-plane-services/function-autoscaler/crates/server/src/tracing_init.rs
Places TracingGuard and its shutdown-on-drop implementation before the test module and removes the trailing duplicate definition.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: sparve-nv

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title uses the required Conventional Commit format and accurately describes the Clippy-related bug fix.
Linked Issues check ✅ Passed The change moves TracingGuard above the test module, directly resolving the items_after_test_module error in issue #544.
Out of Scope Changes check ✅ Passed The pull request contains only the code motion required to resolve issue #544; no unrelated changes are present.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@borao
borao self-requested a review July 29, 2026 22:09
@mesutoezdil
mesutoezdil force-pushed the mesutoezdil/fix/autoscaler-clippy-test-module branch from a5bf634 to 11c3e35 Compare July 30, 2026 10:09
@borao

borao commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Hi Mesut, thanks for your contribution! Can you please add the DCO for the merge commit?

@mesutoezdil
mesutoezdil force-pushed the mesutoezdil/fix/autoscaler-clippy-test-module branch from 5258128 to 1d5ca58 Compare July 31, 2026 06:45
@mesutoezdil

Copy link
Copy Markdown
Contributor Author

Done. Rebased onto main to drop the unsigned merge commits, the branch now has a single signed-off commit.

@borao
borao enabled auto-merge July 31, 2026 20:32
@borao
borao force-pushed the mesutoezdil/fix/autoscaler-clippy-test-module branch from 1d5ca58 to 53cbefe Compare July 31, 2026 20:34
…clippy passes

Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
auto-merge was automatically disabled August 1, 2026 07:54

Head branch was pushed to by a user without write access

@mesutoezdil
mesutoezdil force-pushed the mesutoezdil/fix/autoscaler-clippy-test-module branch from 53cbefe to 7ef6236 Compare August 1, 2026 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

function-autoscaler: documented clippy command fails on a clean checkout

2 participants