Skip to content

fix(config): dev versions on matrix images use matrix subpath and build args#610

Merged
ianpittwood merged 2 commits into
mainfrom
fix/dev-versions-on-matrix-images
Jun 15, 2026
Merged

fix(config): dev versions on matrix images use matrix subpath and build args#610
ianpittwood merged 2 commits into
mainfrom
fix/dev-versions-on-matrix-images

Conversation

@ianpittwood

@ianpittwood ianpittwood commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 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 image 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 (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/include was set: the matrix override (versions = matrix.to_image_versions()) replaced image.versions — which contains dev versions loaded by load_dev_versions() — before the dev filter ran, leaving zero targets. With --dev-versions only the override is now skipped; with --dev-versions include, matrix and dev versions are merged.

Reproducer

# In images-workbench/ — previously yielded zero targets
bakery build --image-name 'workbench-positron-init' \
  --image-platform linux/amd64 \
  --dev-versions only --matrix-versions only --plan

Test plan

  • uv run pytest test/config/image/dev_version/test_dependency.py::TestAsImageVersionWithMatrixParent — 5 new unit tests covering the as_image_version() matrix-parent branch
  • uv run pytest test/config/test_config.py::TestBakeryConfig::test_dev_versions_only_with_matrix_image_yields_dev_target — integration test for the zero-targets bug
  • uv run pytest test/config/test_config.py::TestBakeryConfig::test_dev_versions_include_with_matrix_image_yields_all_targets — integration test for --dev-versions include merging matrix + dev targets
  • uv run pytest test/config/ -m "not slow" — full config suite, no regressions (1179 passed)

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown

Test Results

1 889 tests   1 889 ✅  7m 53s ⏱️
    1 suites      0 💤
    1 files        0 ❌

Results for commit 92c7283.

♻️ This comment has been updated with latest results.

@ianpittwood ianpittwood marked this pull request as ready for review June 15, 2026 15:27
@ianpittwood ianpittwood requested a review from bschwedler as a code owner June 15, 2026 15:27
ianpittwood and others added 2 commits June 15, 2026 11:21
…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>
@ianpittwood ianpittwood force-pushed the fix/dev-versions-on-matrix-images branch from 91a9ce7 to 92c7283 Compare June 15, 2026 17:21
@ianpittwood ianpittwood merged commit e6766a7 into main Jun 15, 2026
44 of 46 checks passed
@ianpittwood ianpittwood deleted the fix/dev-versions-on-matrix-images branch June 15, 2026 18:34
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.

1 participant