Skip to content

add ReflectsCollection to blueprint - #11705

Open
davepacheco wants to merge 3 commits into
mainfrom
dap/omicron-blueprint-collection-id
Open

davepacheco wants to merge 3 commits into
mainfrom
dap/omicron-blueprint-collection-id

Conversation

@davepacheco

Copy link
Copy Markdown
Collaborator

Fixes #5010.

This adds a new top-level blueprint field called ReflectsCollection that's an enum that either describes a specific inventory collection (with its id, time started, and time done) or else Indeterminate. The expectation is that planner-created blueprints would always supply information about the collection that the planner used. But other blueprints (the RSS ones, test ones, reconfigurator-cli edits, and ones already in the database that get migrated to this change). I opted to require that callers of BlueprintBuilder::new_based_on specify this because I felt a default was too easy to get wrong. But that's why this PR touches so many files -- to fix up a ton of test callers.

For now, this is only for debugging. This information could be used to implement an autoplanner heuristic like: don't run the planner if the collection you have is older than the one in the current target blueprint. I considered putting this information in the planning report instead (which means we could skip all the db code here), but that would make it unusable for this purpose since the planning report is not programmatically accessible to Nexus.

pub nexus_generation: DbTypedGeneration<NexusGenerationKind>,
pub source: DbBpSource,
pub external_networking_generation: Generation,
#[diesel(embed)]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm torn about the approach to Diesel here. I would not have produced this code. But it does have the property that consumers are not exposed to the fact that there are three underlying fields here, and you cannot have an in-memory representation that's not valid (a mix of None and non-None values). I'm open to doing this a different way though.

@davepacheco
davepacheco marked this pull request as ready for review November 4, 2026 23:59

This branch has not been deployed

No deployments
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.

Blueprints: Record collection ID used in generation

1 participant