Skip to content

feat(health): tolerate unrelated LeakDetector schema mismatches - #5564

Open
jayzhudev wants to merge 1 commit into
NVIDIA:mainfrom
jayzhudev:health/leak-detector-field-tolerance
Open

feat(health): tolerate unrelated LeakDetector schema mismatches#5564
jayzhudev wants to merge 1 commit into
NVIDIA:mainfrom
jayzhudev:health/leak-detector-field-tolerance

Conversation

@jayzhudev

@jayzhudev jayzhudev commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

A captured BMC response may report fields such as ReactionDelaySeconds as 0.0, while the generated nv_redfish::LeakDetector model correctly requires an integer and fails deserialization.

Adding a collector-local projection for BMC leak-detector responses so unrelated property mismatches do not block data reporting.

Related issues

Resolves #5554

Type of Change

  • Add - New feature or capability
  • Change - Changes in existing functionality
  • Fix - Bug fixes
  • Remove - Removed features or deprecated functionality
  • Internal - Internal changes (refactoring, tests, docs, etc.)

Breaking Changes

  • This PR contains breaking changes

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

@jayzhudev jayzhudev self-assigned this Aug 29, 2026
@jayzhudev
jayzhudev requested a review from a team as a code owner August 29, 2026 05:40
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: c948dd0b-b3e3-49cd-a6c0-699e05483916

📥 Commits

Reviewing files that changed from the base of the PR and between 04d9336 and 2a43aee.

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

Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review.


Summary by CodeRabbit

  • Bug Fixes
    • Improved leak detector status handling for more reliable health reporting.
    • Preserved detector identity, labels, and metadata during health checks.
    • Improved alert generation and target selection based on current detector and resource states.
    • Correctly recognizes actionable detectors with configured reaction delays, helping ensure timely alerts.

Walkthrough

The leak detector collector now deserializes a focused local projection. It preserves required metadata and state fields while avoiding unrelated schema fields. Health reports, targets, alerts, and tests use the direct state values.

Changes

Leak detector collector

Layer / File(s) Summary
Leak detector payload projection
crates/health/src/collectors/leak_detector.rs
The collector defines local LeakDetector and LeakDetectorStatus projections. They preserve identity, etag, user label, detector state, and resource state.
Health reporting and validation
crates/health/src/collectors/leak_detector.rs
Fetching and health helpers use the local projection and direct optional state values. Tests include ReactionDelaySeconds in the payload and construct the local projection.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 2a43a

This localized change is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: allowing health collection to tolerate unrelated LeakDetector schema mismatches.
Description check ✅ Passed The description explains the schema mismatch, the collector-local projection, the affected health behavior, testing, and linked issue #5554.
Linked Issues check ✅ Passed The changes satisfy issue #5554 by deserializing only the health-required LeakDetector fields, preserving the generated model, continuing to process health state directly, and updating tests for the u…
Out of Scope Changes check ✅ Passed The changes remain within scope. The local EntityTypeRef implementation, health-state handling, and test updates support the collector projection and the linked issue objectives.
Full details: Linked Issues check

Explanation

The changes satisfy issue #5554 by deserializing only the health-required LeakDetector fields, preserving the generated model, continuing to process health state directly, and updating tests for the unrelated ReactionDelaySeconds mismatch.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 04d9336ddf

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/health/src/collectors/leak_detector.rs Outdated
Signed-off-by: Jay Zhu <jayzhu@nvidia.com>
@jayzhudev
jayzhudev force-pushed the health/leak-detector-field-tolerance branch from 04d9336 to 2a43aee Compare August 29, 2026 05:50
@yoks

yoks commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

This should be a quirk in nv-redfish and not here.

@jayzhudev

Copy link
Copy Markdown
Contributor Author

This should be a quirk in nv-redfish and not here.

Yeah I thought about it, but the change surface in nv-redfish may be a bit too large for this quirk.

@yoks yoks 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.

I would rather add it to nv-redfish quirk and bump version in repo. Rather than introducing separate contract here.

@yoks

yoks commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

This should be a quirk in nv-redfish and not here.

Yeah I thought about it, but the change surface in nv-redfish may be a bit too large for this quirk.

It should not be, it is JSON manupulation or conversion for specific firmware and Value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Tolerate unrelated LeakDetector schema mismatches in health

3 participants