fix(config): dev versions on matrix images use matrix subpath and build args#610
Merged
Conversation
Test Results1 889 tests 1 889 ✅ 7m 53s ⏱️ Results for commit 92c7283. ♻️ This comment has been updated with latest results. |
…ld args
Two related bugs prevented workbench-positron-init dev builds from appearing
when using --dev-versions only --matrix-versions only.
1. as_image_version() in BaseImageDevelopmentVersion was naive to matrix
parents: it always created an ephemeral .dev-{version} subpath, set
ephemeral=True, and omitted isMatrixVersion. When the parent has a matrix
the returned ImageVersion now reuses the matrix's subpath (e.g. matrix/),
sets ephemeral=False, and sets isMatrixVersion=True so it shares the same
Containerfile template as production matrix builds.
ImageDevelopmentVersionFromDependency overrides _get_dependencies_for_matrix
to pass the resolved dependency version as a build arg, matching how
production matrix versions supply their dependency dimension.
2. generate_image_targets() discarded dev versions when --matrix-versions
only/include was set: the matrix override (versions = matrix.to_image_versions())
replaced image.versions before the dev filter ran, leaving zero candidates.
With --dev-versions only the override is now skipped (dev versions already
live in image.versions and production matrix versions would be filtered out
anyway); with --dev-versions include, matrix and dev versions are merged.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The ci matrix command had its own version-filtering loop that replaced img.versions with img.matrix.to_image_versions() unconditionally when matrix_versions != EXCLUDE, discarding dev versions that load_dev_versions() had already appended to img.versions. Apply the same three-way split (ONLY / INCLUDE / exclude) as was already fixed in generate_image_targets(), so that: --matrix-versions only --dev-versions only → includes matrix dev versions --matrix-versions include --dev-versions only → includes matrix dev versions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
91a9ce7 to
92c7283
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
as_image_version()inBaseImageDevelopmentVersionwas naive to matrix parents: it always created an ephemeral.dev-{version}subpath, setephemeral=True, and omittedisMatrixVersion. When the parent image has amatrix, the returnedImageVersionnow reuses the matrix'ssubpath(e.g.matrix/), setsephemeral=False, and setsisMatrixVersion=Trueso it shares the same Containerfile template as production matrix builds.ImageDevelopmentVersionFromDependencyoverrides_get_dependencies_for_matrixto pass the resolved dependency version (e.g.positron: 2026.07.0-142) as a build arg, matching how production matrix versions supply their dependency dimension.generate_image_targets()discarded dev versions when--matrix-versions only/includewas set: the matrix override (versions = matrix.to_image_versions()) replacedimage.versions— which contains dev versions loaded byload_dev_versions()— before the dev filter ran, leaving zero targets. With--dev-versions onlythe override is now skipped; with--dev-versions include, matrix and dev versions are merged.Reproducer
Test plan
uv run pytest test/config/image/dev_version/test_dependency.py::TestAsImageVersionWithMatrixParent— 5 new unit tests covering theas_image_version()matrix-parent branchuv run pytest test/config/test_config.py::TestBakeryConfig::test_dev_versions_only_with_matrix_image_yields_dev_target— integration test for the zero-targets buguv run pytest test/config/test_config.py::TestBakeryConfig::test_dev_versions_include_with_matrix_image_yields_all_targets— integration test for--dev-versions includemerging matrix + dev targetsuv run pytest test/config/ -m "not slow"— full config suite, no regressions (1179 passed)🤖 Generated with Claude Code