Move bundle selection types and EreportFilters to nexus-types#10089
Move bundle selection types and EreportFilters to nexus-types#10089mergeconflict merged 1 commit intomainfrom
Conversation
08b5f84 to
d87449e
Compare
d87449e to
7a5224c
Compare
| } | ||
|
|
||
| impl EreportFilters { | ||
| pub fn check_time_range(&self) -> Result<(), Error> { |
There was a problem hiding this comment.
Part of me wants to make the fields private and do the validation in a constructor, so all instances of the type are validated...but, looking back, I think the reason I didn't do it that way originally is that I wanted the start and end timestamps to be provided as named fields, rather than as unnamed function parameters, so it was obvious to the reader which is which. Given that, I don't really think it's worth messing with.
If you really wanted to do it the Right Way, you could have the constructor take one of the std range types as a single argument, so you could call it with start...end or start... or ...end and it would always be obvious to the reader. But let's treat that as a fun side quest you can do if you want, rather than something I care deeply about?
There was a problem hiding this comment.
I thought about that too, actually. But I figure I should probably do that in a separate PR just to make it super obvious that I'm purely moving things here.
Move BundleDataCategory, BundleData, BundleDataSelection, and SledSelection to nexus/types/src/support_bundle.rs. Move EreportFilters to nexus/types/src/fm/ereport.rs (where it belongs alongside other ereport types). Update all consumers to import directly. Pure refactor, no behavior change.
7a5224c to
3a6ea71
Compare
Move:
BundleDataSelection(fromomicron_nexus::app::background::tasks::support_bundle::request), along with its constituent bits:BundleDataCategory,BundleData,SledSelection, intonexus_types::support_bundleEreportFilters(fromnexus_db_queries::db::datastore::ereport), used byBundleData::Ereports, intonexus_types::fm::ereport.... so they can be shared between the support bundle collector (which currently uses them) and fault management's various
Casetypes (in PR #10090).This is a pure refactor, no behavior changes here. Context: #10062.