Skip to content

fix(health): wrap static machine id in Some after field made optional#4097

Closed
wminckler wants to merge 1 commit into
NVIDIA:mainfrom
wminckler:fix/health-static-machine-id-optional
Closed

fix(health): wrap static machine id in Some after field made optional#4097
wminckler wants to merge 1 commit into
NVIDIA:mainfrom
wminckler:fix/health-static-machine-id-optional

Conversation

@wminckler

@wminckler wminckler commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

PR #4003 changed `StaticMachineEndpoint.id` from `String` to `Option` but the test fixture at `crates/health/src/config.rs:1855` was not updated, leaving `id: "machine-id".to_string()` where `Option` is now expected. This breaks `cargo test -p carbide-health --lib` and the lint-police `clippy-flow` step.

Related issues

Caused by #4003.

Type of Change

  • Fix - Bug fixes

Breaking Changes

  • This PR contains breaking changes

Testing

  • `cargo test -p carbide-health --lib` — 406 passed, 0 failed

PR NVIDIA#4003 changed StaticMachineEndpoint.id from String to Option<String>
but left the test fixture passing a bare String, breaking the lib test build.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Summary by CodeRabbit

  • Bug Fixes
    • Updated test configuration to correctly represent the optional machine endpoint identifier.

Walkthrough

The static_machine() test helper now initializes StaticMachineEndpoint.id with Some("machine-id".to_string()), matching its optional type.

Changes

Health configuration fixture

Layer / File(s) Summary
Update static machine fixture
crates/health/src/config.rs
The StaticMachineEndpoint.id test value is wrapped in Some(...).

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

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the fixture update to wrap the optional machine id in Some().
Description check ✅ Passed The description accurately explains the field type change, the failing fixture, and the test impact.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@wminckler
wminckler marked this pull request as ready for review July 24, 2026 14:01
@wminckler
wminckler requested a review from a team as a code owner July 24, 2026 14:01

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/health/src/config.rs`:
- Line 1855: Update the StaticMachineEndpoint initializer so its id field
matches the declared String type by replacing the Some-wrapped value with a
plain string; preserve the existing StaticMachineEndpoint field contract and
consumers.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: dee2cae6-3785-4900-b62c-8f0ba386ff5d

📥 Commits

Reviewing files that changed from the base of the PR and between afadf84 and c66011f.

📒 Files selected for processing (1)
  • crates/health/src/config.rs

fn static_machine() -> StaticMachineEndpoint {
StaticMachineEndpoint {
id: "machine-id".to_string(),
id: Some("machine-id".to_string()),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Fix the String/Option<String> type mismatch.

StaticMachineEndpoint.id is declared as String at Line 210, so this Some(...) initializer does not compile. Use a plain string here, or update the field declaration and all configuration consumers consistently if the intended contract is Option<String>.

Proposed fix
-            id: Some("machine-id".to_string()),
+            id: "machine-id".to_string(),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
id: Some("machine-id".to_string()),
id: "machine-id".to_string(),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/health/src/config.rs` at line 1855, Update the StaticMachineEndpoint
initializer so its id field matches the declared String type by replacing the
Some-wrapped value with a plain string; preserve the existing
StaticMachineEndpoint field contract and consumers.

@wminckler wminckler closed this Jul 24, 2026
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.

1 participant