nexus-types: add SupportBundleRequest type and Case field#10090
nexus-types: add SupportBundleRequest type and Case field#10090mergeconflict merged 1 commit intomainfrom
Conversation
d3b67af to
d5d60b3
Compare
2baa491 to
c2191f0
Compare
08b5f84 to
d87449e
Compare
c2191f0 to
e725e86
Compare
d87449e to
7a5224c
Compare
e725e86 to
beef2af
Compare
1f1c514 to
ad04192
Compare
7a5224c to
3a6ea71
Compare
|
I think that either this branch or |
nexus/types/src/fm/case.rs
Outdated
| writeln!( | ||
| f, | ||
| "{:>indent$}{DATA:<WIDTH$} {selection}\n", | ||
| "", | ||
| )?; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 aHashSet<SledSelection>)Ereports(containsonly_serials: Vec<String>andonly_classes: Vec<String>)
Do you think it's worth prettying these up too?
There was a problem hiding this comment.
Ehh, I dunno if I care. Up to you.
accc0bd to
bd75858
Compare
hawkw
left a comment
There was a problem hiding this comment.
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.
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.
bd75858 to
0914f01
Compare
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.
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.
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.
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.
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.
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.
The core thing this PR does is:
SupportBundleRequesttype tofm::case(analogous to @hawkw'sAlertRequest), andsupport_bundles_requestedfield toCase(analogous toalerts_requested).There's a lot of ✨ceremony✨ around this small change, though:
DisplayCasehas a sophisticatedimpl Displaythat formats the stuff it contains. So we needDisplayimpls for all the thingsSupportBundleRequesttransitively contains (BundleData, etc.). Here's what this comes out looking like:Since
Caseisserde::Serialize/Deserialize, we also need to add derives toSupportBundleRequestand 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
Arbitraryimpls (or functions that returnStrategy) for all the things too.Context: #10062.