fix: use separate default tag patterns for matrix images#418
Merged
Conversation
bschwedler
approved these changes
Apr 3, 2026
Contributor
bschwedler
left a comment
There was a problem hiding this comment.
This definitely explains some of the failures I've seen in the cache builds.
Thanks!
…ag collisions The stripMetadata Jinja2 filter strips from the last hyphen onward, which breaks composite matrix version names like "R4.3.3-python3.11.15" by collapsing them to "R4.3.3". This caused multiple matrix combinations to produce identical tags, leading to image overwrites during builds. Add default_matrix_tag_patterns() which excludes stripMetadata patterns and latest-filtered patterns (matrices are naive to "latest"). The Image model now conditionally selects the pattern set based on whether a matrix is defined, using Pydantic's default_factory with validated data. Fixes #417 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
882123f to
c4dcc0e
Compare
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.
Summary
stripMetadataJinja2 filter strips from the last hyphen onward, which breaks composite matrix version names likeR4.3.3-python3.11.15by collapsing them toR4.3.3, causing tag collisions across matrix combinationsdefault_matrix_tag_patterns()which excludesstripMetadatapatterns andlatest-filtered patterns (matrices are naive to "latest")Imagemodel now conditionally selects the pattern set based on whether amatrixis defined, using Pydantic'sdefault_factorywith validated dataFixes #417
Test plan
test_default_matrix_tag_patternsverifies correct rendering of matrix tag patternstest_default_matrix_tag_patterns_no_strip_metadataasserts nostripMetadatain matrix patternstest_default_matrix_tag_patterns_no_latest_filterasserts noLATESTfilter in matrix patternstest_default_matrix_tag_patterns_no_tag_collisionsregression test verifies no tag overlaps across matrix combinationstest_default_tag_patterns_for_matrix_imageverifies matrix images get the correct default patternstest_explicit_tag_patterns_not_overridden_by_matrixverifies explicittagPatternsare respectedbakery build --matrix-versions only --image-name 'workbench-session$' --planin images-workbench to verify no overlapping tags🤖 Generated with Claude Code