Repository navigation
add ReflectsCollection to blueprint - #11705
Open
davepacheco wants to merge 3 commits into
Open
davepacheco wants to merge 3 commits into
davepacheco wants to merge 3 commits into
Conversation
davepacheco
commented
Nov 4, 2026
| pub nexus_generation: DbTypedGeneration<NexusGenerationKind>, | ||
| pub source: DbBpSource, | ||
| pub external_networking_generation: Generation, | ||
| #[diesel(embed)] |
Collaborator
Author
There was a problem hiding this comment.
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
marked this pull request as ready for review
November 4, 2026 23:59
This branch has not been deployed
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.
Fixes #5010.
This adds a new top-level blueprint field called
ReflectsCollectionthat's an enum that either describes a specific inventory collection (with its id, time started, and time done) or elseIndeterminate. 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-cliedits, and ones already in the database that get migrated to this change). I opted to require that callers ofBlueprintBuilder::new_based_onspecify 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.