Skip to content

Blueprint PlanningInput: Fewer Options#8470

Merged
jgallagher merged 4 commits into
mainfrom
john/planning-input-fewer-options
Jun 30, 2025
Merged

Blueprint PlanningInput: Fewer Options#8470
jgallagher merged 4 commits into
mainfrom
john/planning-input-fewer-options

Conversation

@jgallagher

Copy link
Copy Markdown
Contributor

This gets rid of two Option<_>s in the planning input:

  • TufRepoPolicy::description changes from Option<TufRepoDescription> to non-optional TargetReleaseDescription. The latter is isomorphic to Option, but spells the None case as TargetReleaseDescription::Initial.
  • PlanningInput::old_repo is now a non-optional TufRepoPolicy. In the case where tuf_repo is "the initial policy" (i.e., TargetReleaseDescription::Initial, old_repo is also set to the initial policy. In all other cases, it's "the previous policy".

Comment on lines +2004 to +2006
// TODO-john this should be an error - this is a repo that's missing
// an artifact of a known zone kind
.unwrap_or(BlueprintZoneImageSource::InstallDataset)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we do this before merging? Or panic, or something?

This seems quite bad, especially if we perform an upgrade that unintentionally causes a downgrade

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This turns into an error on #8472. I could pull that into this PR?

OTOH I'm not sure this is super urgent; this matches the existing behavior on main, and we'd only run into it if we uploaded a TUF repo to a rack (only done in testing, for now) that was also missing some artifacts (hasn't happened to date, as far as we know).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, I pulled in the error handling; getting this to pass tests required a couple other changes:

  • Fixing the artifact_name() of ZoneKind::ClickhouseKeeper (part of 04e54e6)
  • Changing our fake TUF manifest to generate "real" control plane zone names (4850194)

@plotnick plotnick left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, looks great. Always nice to have better names than None!

@sunshowers sunshowers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

makes a lot of sense -- thanks!

@jgallagher jgallagher merged commit a1d38ab into main Jun 30, 2025
16 checks passed
@jgallagher jgallagher deleted the john/planning-input-fewer-options branch June 30, 2025 19:19
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.

4 participants