Skip to content

Parse/Display stemcell variants separately from the OS version - #92

Merged
mkocher merged 1 commit into
mainfrom
add-stemcell-variants
Sep 10, 2026
Merged

mkocher merged 1 commit into
mainfrom
add-stemcell-variants

Conversation

@mkocher

@mkocher mkocher commented Sep 9, 2026

Copy link
Copy Markdown
Member

We're adding a rosetta variant that works on osx vz, this displays it. Hide the FIPS variant, as we do not distribute it.

Human Summary: We're adding a rosetta variant that works on osx vz, this
displays it. Hide FIPS as it's a variant that would have been displayed by this
change.

AI Description:

The stemcell builder treats the -fips and -rosetta suffixes as build
variants, not OS versions: operating_system.rb splits "resolute-rosetta"
into version "resolute" plus variant "rosetta", and stemcell_packager.rb
writes `operating_system: ubuntu-resolute` into stemcell.MF. bosh.io
instead folded the suffix into os_version, so the upcoming
warden-boshlite-ubuntu-resolute-rosetta stemcell did not match
s3StemcellRegexp at all: NewS3Stemcell returned nil and FindAll silently
skipped it. It would have published to GCS and then appeared nowhere --
not the listing, not the API, not the download redirect.

Pull the suffix into its own regexp group and expose it as Variant().
A variant now reports its base OS version, so the existing Resolute
distro picks rosetta up with no new section, and the single-stemcell
page's copy-paste manifest snippet emits the `os:` value the builder
actually writes. StemcellSource carries a display title for the variant
which InfrastructureName() and LinkName() append, so a variant is
distinguishable from the plain stemcell sharing its row group.

InfrastructureName() decorates at render time and leaves the stored field
raw, so Ignored()'s AWS/Xen comparison against the undecorated title keeps
working.

Correcting the parse would also have started listing jammy-fips, which has
been in published/ubuntu-jammy-fips all along but matched no Distro and so
was never rendered. Those rows would all have been dead links:
bosh-core-stemcells-fips denies storage.objects.get to allUsers, and every
object in it 403s anonymously, unlike the public bosh-core-stemcells.
Rather than publish broken links, hiddenVariants drops fips in
S3StemcellsRepository.FindAll, alongside the existing IsDeprecated()
check. Filtering in the repository rather than the UI covers every
surface: the API and /d/ download redirect bypass NewDistroGroups
entirely, so a UI-level filter would have left them exposed.

Note this removes a currently-live endpoint --
/api/v1/stemcells/bosh-aws-xen-hvm-ubuntu-jammy-fips-go_agent returns 75
versions today and will return []. Consumers cannot anonymously fetch what
it advertises, so they must already have another path to the artifacts.
`(?P<os_name>centos|ubuntu|windows)` +
`(?P<os_version>-trusty|-xenial|-bionic|-jammy|-jammy-fips|-noble|-resolute|-lucid|2019|1803|2016|2012R2|-\d+)?` +
`(?P<os_version>-trusty|-xenial|-bionic|-jammy|-noble|-resolute|-lucid|2019|1803|2016|2012R2|-\d+)?` +
`(?P<variant>-fips|-rosetta)?` +

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.

Should we include fips in the regex if we're just going to hide it? (I like the explicit code to hide variants regardless as a safety mechanism)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think it's OK to parse it? Makes it clearer that we're intentionally dropping it

@github-project-automation github-project-automation Bot moved this from Inbox to Pending Merge | Prioritized in Foundational Infrastructure Working Group Sep 10, 2026
@mkocher
mkocher merged commit e7c9419 into main Sep 10, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group Sep 10, 2026
@mkocher
mkocher deleted the add-stemcell-variants branch September 10, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants