schema + db-model: support bundle request data selection tables#10111
Draft
mergeconflict wants to merge 1 commit intomainfrom
Draft
schema + db-model: support bundle request data selection tables#10111mergeconflict wants to merge 1 commit intomainfrom
mergeconflict wants to merge 1 commit intomainfrom
Conversation
476acc0 to
88e7b32
Compare
jgallagher
reviewed
Mar 20, 2026
770be0e to
8153e6f
Compare
88e7b32 to
d28f22b
Compare
8153e6f to
c171063
Compare
d28f22b to
0c999b9
Compare
Member
|
looks like the CI unhappiness here is because the schema versions don't match, btw. |
Adds fm_support_bundle_request and fm_sb_req_data_selection tables for persisting FM-initiated support bundle requests as part of a sitrep. Each request belongs to a case and tracks which sitrep originally requested it. The data selection table uses a bundle_data_category enum and category-specific nullable columns with CHECK constraints to store per-category parameters (sled selection for host_info, time/serial/class filters for ereports). Address PR feedback: use cardinality() and return errors instead of panicking - Replace `array_length(sled_ids, 1) IS NULL` with `cardinality(sled_ids) = 0` in the CHECK constraint, avoiding a counterintuitive PostgreSQL/CRDB quirk where `array_length` of an empty array returns NULL. - Replace `expect()` calls in `SbReqDataSelection::into_bundle_data` with `anyhow::Context`-based error returns, so a broken CHECK constraint produces a runtime error rather than crashing Nexus.
ef06169 to
44c803e
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two tables:
fm_support_bundle_request(the primary table representingnexus_types::fm::case::SupportBundleRequestfm_sb_req_data_selection(the join table representing thenexus_types::support_bundle::BundleDataSelections in the support bundle request).... and their corresponding models.
This is for persisting fault-management-initiated support bundle requests as part of a sitrep. Each request belongs to a case and tracks which sitrep originally requested it. Context: #10062.
This supersedes #10091 and #10095, in which the schema had a different table for each
BundleDataSelectionvariant. That got hairy because we were joining 6 tables together and Diesel got mad about it. (Then I got mad.)