Skip to content

nexus-types: add SupportBundleRequest type and Case field#10090

Merged
mergeconflict merged 1 commit intomainfrom
mergeconflict/fm-sb-types
Mar 19, 2026
Merged

nexus-types: add SupportBundleRequest type and Case field#10090
mergeconflict merged 1 commit intomainfrom
mergeconflict/fm-sb-types

Conversation

@mergeconflict
Copy link
Contributor

@mergeconflict mergeconflict commented Mar 18, 2026

The core thing this PR does is:

  • Introduce a new SupportBundleRequest type to fm::case (analogous to @hawkw's AlertRequest), and
  • Introduce a new support_bundles_requested field to Case (analogous to alerts_requested).

There's a lot of ✨ceremony✨ around this small change, though:

  • DisplayCase has a sophisticated impl Display that formats the stuff it contains. So we need Display impls for all the things SupportBundleRequest transitively contains (BundleData, etc.). Here's what this comes out looking like:

         support bundles requested:
         -------------------------
         * bundle a9b8c7d6-e5f4-3210-fedc-ba0987654321
           requested in: bba63ba7-bf6b-45f4-b241-d13ccd07fe1c <-- this sitrep
           data:         all (default)
    
         * bundle d1a2b3c4-e5f6-7890-abcd-ef1234567890
           requested in: ea7affb0-36eb-4a9a-b9bd-22e00f1bcc04
           data:
             - sp_dumps
             - ereports(classes: hw.pwr.*)
             - host_info(all)
             - reconfigurator
    
  • Since Case is serde::Serialize/Deserialize, we also need to add derives to SupportBundleRequest and all the things it transitively contains.

  • Lastly, since we want to have some sort of reasonable round-trip test for the serialization / deserialization, we use proptest to generate arbitrary inputs. This requires Arbitrary impls (or functions that return Strategy) for all the things too.

Context: #10062.

@mergeconflict mergeconflict marked this pull request as draft March 18, 2026 22:21
@mergeconflict mergeconflict changed the base branch from main to mergeconflict/fm-sb-type-relocation March 18, 2026 22:21
@mergeconflict mergeconflict force-pushed the mergeconflict/fm-sb-type-relocation branch from d3b67af to d5d60b3 Compare March 18, 2026 22:48
@mergeconflict mergeconflict force-pushed the mergeconflict/fm-sb-types branch 2 times, most recently from 2baa491 to c2191f0 Compare March 18, 2026 22:58
@mergeconflict mergeconflict force-pushed the mergeconflict/fm-sb-type-relocation branch 2 times, most recently from 08b5f84 to d87449e Compare March 18, 2026 23:14
@mergeconflict mergeconflict force-pushed the mergeconflict/fm-sb-types branch from c2191f0 to e725e86 Compare March 18, 2026 23:14
@mergeconflict mergeconflict force-pushed the mergeconflict/fm-sb-type-relocation branch from d87449e to 7a5224c Compare March 19, 2026 00:00
@mergeconflict mergeconflict force-pushed the mergeconflict/fm-sb-types branch from e725e86 to beef2af Compare March 19, 2026 02:03
@mergeconflict mergeconflict requested review from hawkw and smklein March 19, 2026 02:20
@mergeconflict mergeconflict marked this pull request as ready for review March 19, 2026 02:22
@mergeconflict mergeconflict force-pushed the mergeconflict/fm-sb-types branch 2 times, most recently from 1f1c514 to ad04192 Compare March 19, 2026 02:51
@mergeconflict mergeconflict force-pushed the mergeconflict/fm-sb-type-relocation branch from 7a5224c to 3a6ea71 Compare March 19, 2026 02:51
@hawkw
Copy link
Member

hawkw commented Mar 19, 2026

I think that either this branch or mergeconflict/fm-sb-type-relocation (?) needs to be rebased/merge main, as it looks like there are a lot of unrelated changes in the diff here.

Comment on lines +289 to +293
writeln!(
f,
"{:>indent$}{DATA:<WIDTH$} {selection}\n",
"",
)?;
Copy link
Member

Choose a reason for hiding this comment

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

how long do you think this list is liable to be? i always try my best to make my omdb command output 80-column-terminal friendly, because i am spiritually very old or something. i won't hold you to this particular bit of mental illness unless you find it entertaining, but if this is liable to be quite long, we might want to bite the bullet and turn it into a multi-line bulleted list or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've done a half-assed job of this in accc0bd, splitting the bundle data categories out into a bulleted list. But now I'm thinking, the two non-trivial BundleData variants can be arbitrarily long:

  • HostInfo (contains a HashSet<SledSelection>)
  • Ereports (contains only_serials: Vec<String> and only_classes: Vec<String>)

Do you think it's worth prettying these up too?

Copy link
Member

Choose a reason for hiding this comment

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

Ehh, I dunno if I care. Up to you.

@mergeconflict mergeconflict force-pushed the mergeconflict/fm-sb-types branch 2 times, most recently from accc0bd to bd75858 Compare March 19, 2026 12:53
@mergeconflict mergeconflict requested a review from hawkw March 19, 2026 13:25
Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

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

This is looking pretty nice! I had a couple small nits you may want to address, but I'm good with this overall. I think we should add the builder stuff in a separate branch, if you want to do that.

mergeconflict added a commit that referenced this pull request Mar 19, 2026
Move:

* `BundleDataSelection` (from
`omicron_nexus::app::background::tasks::support_bundle::request`), along
with its constituent bits: `BundleDataCategory`, `BundleData`,
`SledSelection`, into `nexus_types::support_bundle`
* `EreportFilters` (from `nexus_db_queries::db::datastore::ereport`),
used by `BundleData::Ereports`, into `nexus_types::fm::ereport`.

... so they can be shared between the support bundle collector (which
currently uses them) and fault management's various `Case` types (in PR
#10090).

This is a pure refactor, no behavior changes here. Context: #10062.
Base automatically changed from mergeconflict/fm-sb-type-relocation to main March 19, 2026 18:12
@hawkw hawkw added the fault-management Everything related to the fault-management initiative (RFD480 and others) label Mar 19, 2026
@mergeconflict mergeconflict force-pushed the mergeconflict/fm-sb-types branch from bd75858 to 0914f01 Compare March 19, 2026 21:24
@mergeconflict mergeconflict enabled auto-merge (squash) March 19, 2026 22:50
mergeconflict added a commit that referenced this pull request Mar 19, 2026
Add builder methods to BundleDataSelection (with_reconfigurator,
with_sled_cubby_info, with_sp_dumps, with_all_sleds,
with_specific_sleds, with_ereports) and EreportFilters
(with_start_time, with_end_time returning Result with validation,
with_serials, with_classes taking IntoIterator).

Time range validation is now enforced eagerly by the builder,
removing the need for check_time_range().

Addresses review feedback from PR #10090 and PR #10089.
mergeconflict added a commit that referenced this pull request Mar 19, 2026
Add builder methods to BundleDataSelection (with_reconfigurator,
with_sled_cubby_info, with_sp_dumps, with_all_sleds,
with_specific_sleds, with_ereports) and EreportFilters
(with_start_time, with_end_time returning Result with validation,
with_serials, with_classes taking IntoIterator).

Time range validation is now enforced eagerly by the builder,
removing the need for check_time_range().

Addresses review feedback from PR #10090 and PR #10089.
@mergeconflict mergeconflict merged commit 72b5433 into main Mar 19, 2026
16 checks passed
@mergeconflict mergeconflict deleted the mergeconflict/fm-sb-types branch March 19, 2026 23:02
mergeconflict added a commit that referenced this pull request Mar 19, 2026
Add builder methods to BundleDataSelection (with_reconfigurator,
with_sled_cubby_info, with_sp_dumps, with_all_sleds,
with_specific_sleds, with_ereports) and EreportFilters
(with_start_time, with_end_time returning Result with validation,
with_serials, with_classes taking IntoIterator).

Time range validation is now enforced eagerly by the builder,
removing the need for check_time_range().

Addresses review feedback from PR #10090 and PR #10089.
mergeconflict added a commit that referenced this pull request Mar 19, 2026
Add builder methods to BundleDataSelection (with_reconfigurator,
with_sled_cubby_info, with_sp_dumps, with_all_sleds,
with_specific_sleds, with_ereports) and EreportFilters
(with_start_time, with_end_time returning Result with validation,
with_serials, with_classes taking IntoIterator).

Time range validation is now enforced eagerly by the builder,
removing the need for check_time_range().

Addresses review feedback from PR #10090 and PR #10089.
mergeconflict added a commit that referenced this pull request Mar 20, 2026
Add builder methods to BundleDataSelection (with_reconfigurator,
with_sled_cubby_info, with_sp_dumps, with_all_sleds,
with_specific_sleds, with_ereports) and EreportFilters
(with_start_time, with_end_time returning Result with validation,
with_serials, with_classes taking IntoIterator).

Time range validation is now enforced eagerly by the builder,
removing the need for check_time_range().

Addresses review feedback from PR #10090 and PR #10089.
mergeconflict added a commit that referenced this pull request Mar 20, 2026
Add builder methods to BundleDataSelection (with_reconfigurator,
with_sled_cubby_info, with_sp_dumps, with_all_sleds,
with_specific_sleds, with_ereports) and EreportFilters
(with_start_time, with_end_time returning Result with validation,
with_serials, with_classes taking IntoIterator).

Time range validation is now enforced eagerly by the builder,
removing the need for check_time_range().

Addresses review feedback from PR #10090 and PR #10089.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fault-management Everything related to the fault-management initiative (RFD480 and others)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants