Skip to content

feat(site-explorer): create switches and power shelves by default#3276

Open
chet wants to merge 1 commit into
NVIDIA:mainfrom
chet:gh-issue-3152
Open

feat(site-explorer): create switches and power shelves by default#3276
chet wants to merge 1 commit into
NVIDIA:mainfrom
chet:gh-issue-3152

Conversation

@chet

@chet chet commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Note: This will go in after #3280 gets merged.

Explored switches and power shelves that match an expected_switch / expected_power_shelf record are now ingested out of the box, the same way machines already are -- create_switches, create_power_shelves, and explore_power_shelves_from_static_ip default to true instead of false. The expected-hardware records remain the per-device gate, so these defaults only ever ingest hardware an operator has declared, and the flags stay available as site-wide kill switches.

Primary callouts are:

  • The three [site_explorer] creation defaults flip to true, matching create_machines (which has defaulted to true all along).
  • The two default paths now agree by construction: Default::default() delegates to the serde default fns, and SiteExplorerConfig's PartialEq now compares every field so the site_explorer_serde_defaults_match_core_defaults test genuinely enforces the agreement. Previously a config with no [site_explorer] section at all ran with these flags on while a config with the section got false -- and the parity test couldn't see it because PartialEq skipped the creation flags.
  • Site explorer now says why nothing was created: an info log when explored switches / power shelves are skipped because the creation flag is off, and a per-endpoint log when an explored switch has no expected_switch record (power shelves and machines already logged this case).
  • Docs follow: the configurability book page and the config reference README record the new defaults, plus a stale explore_mode default in the reference (it said libredfish; the code default is nv-redfish).

Upgrade note: a site that declares expected_switch / expected_power_shelf records but never set the creation flags starts ingesting that declared hardware on upgrade. Setting the flags to false keeps ingestion off, exactly as before.

Tests added!

This supports #3152

Explored switches and power shelves that match an `expected_switch` / `expected_power_shelf` record are now ingested out of the box, the same way machines already are -- `create_switches`, `create_power_shelves`, and `explore_power_shelves_from_static_ip` default to true instead of false. The expected-hardware records remain the per-device gate, so these defaults only ever ingest hardware an operator has declared, and the flags stay available as site-wide kill switches.

Primary callouts are:

- The three `[site_explorer]` creation defaults flip to true, matching `create_machines` (which has defaulted to true all along).
- The two default paths now agree by construction: `Default::default()` delegates to the serde default fns, and `SiteExplorerConfig`'s `PartialEq` now compares every field so the `site_explorer_serde_defaults_match_core_defaults` test genuinely enforces the agreement. Previously a config with no `[site_explorer]` section at all ran with these flags on while a config with the section got false -- and the parity test couldn't see it because `PartialEq` skipped the creation flags.
- Site explorer now says why nothing was created: an info log when explored switches / power shelves are skipped because the creation flag is off, and a per-endpoint log when an explored switch has no `expected_switch` record (power shelves and machines already logged this case).
- Docs follow: the configurability book page and the config reference README record the new defaults, plus a stale `explore_mode` default in the reference (it said `libredfish`; the code default is `nv-redfish`).

Upgrade note: a site that declares `expected_switch` / `expected_power_shelf` records but never set the creation flags starts ingesting that declared hardware on upgrade. Setting the flags to false keeps ingestion off, exactly as before.

Tests added!

This supports NVIDIA#3152

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
@chet chet requested a review from a team as a code owner July 8, 2026 20:20
@chet

chet commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@chet, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 4 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e40d373f-1658-4206-bb6b-6f4dec04ac83

📥 Commits

Reviewing files that changed from the base of the PR and between 1287fdb and 690fbf9.

📒 Files selected for processing (6)
  • book/src/configuration/configurability.md
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/cfg/file.rs
  • crates/site-explorer/src/config.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/switch_creator.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@chet, you're welcome! I'll kick off a full review of all the changes in this PR now.

🐇✨

✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 4 minutes.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🔍 Container Scan Summary

Service Total Critical High Medium Low Other
boot-artifacts-aarch64 3 0 0 3 0 0
boot-artifacts-x86_64 3 0 0 3 0 0
forge-admin-cli-x86_64 271 13 34 91 7 126
machine-validation-runner 776 37 223 281 40 195
machine_validation 776 37 223 281 40 195
machine_validation-aarch64 776 37 223 281 40 195
nvmetal-carbide 776 37 223 281 40 195
TOTAL 3381 161 926 1221 167 906

Per-CVE detail lives in the per-service grype-* artifacts (JSON + SARIF). Severity counts only — no CVE IDs published here.

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