Parse/Display stemcell variants separately from the OS version - #92
Merged
Merged
Conversation
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.
mkocher
force-pushed
the
add-stemcell-variants
branch
from
September 10, 2026 00:14
498c423 to
be76f66
Compare
ystros
approved these changes
Sep 10, 2026
| `(?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)?` + |
Contributor
There was a problem hiding this comment.
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)
Member
Author
There was a problem hiding this comment.
I think it's OK to parse it? Makes it clearer that we're intentionally dropping it
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.
We're adding a rosetta variant that works on osx vz, this displays it. Hide the FIPS variant, as we do not distribute it.