Add image-version and dev-stream inputs to build workflows#480
Merged
bschwedler merged 5 commits intomainfrom Apr 23, 2026
Merged
Add image-version and dev-stream inputs to build workflows#480bschwedler merged 5 commits intomainfrom
bschwedler merged 5 commits intomainfrom
Conversation
bschwedler
added a commit
that referenced
this pull request
Apr 22, 2026
Per review feedback on #480: - When --image-version is set and matches nothing, exit non-zero instead of emitting "[]". In CI, a silent empty matrix skips all build jobs while the workflow reports green, masking a dispatch that targeted a nonexistent version. - Add feature scenarios for matching and non-matching filters.
This was referenced Apr 22, 2026
ianpittwood
pushed a commit
that referenced
this pull request
Apr 23, 2026
Per review feedback on #480: - When --image-version is set and matches nothing, exit non-zero instead of emitting "[]". In CI, a silent empty matrix skips all build jobs while the workflow reports green, masking a dispatch that targeted a nonexistent version. - Add feature scenarios for matching and non-matching filters.
2ec0d05 to
c1edcc2
Compare
ianpittwood
approved these changes
Apr 23, 2026
Contributor
ianpittwood
left a comment
There was a problem hiding this comment.
LGTM, tested locally against PPM
Comment on lines
+123
to
+142
| def matches_dev_filter( | ||
| self, | ||
| dev_versions: DevVersionInclusionEnum, | ||
| dev_stream: ReleaseStreamEnum | None = None, | ||
| ) -> tuple[bool, str | None]: | ||
| """Check whether this version should be included given dev version filters. | ||
|
|
||
| :param dev_versions: Whether dev versions are included, excluded, or the only versions. | ||
| :param dev_stream: If set, only include dev versions from this release stream. | ||
| :return: A tuple of (included, reason). If excluded, reason explains why. | ||
| """ | ||
| if self.isDevelopmentVersion and dev_versions == DevVersionInclusionEnum.EXCLUDE: | ||
| return False, "excluded by --dev-versions exclude" | ||
| if not self.isDevelopmentVersion and dev_versions == DevVersionInclusionEnum.ONLY: | ||
| return False, "not a development version (excluded by --dev-versions only)" | ||
| if dev_stream is not None and self.isDevelopmentVersion: | ||
| version_stream = self.metadata.get("release_stream") | ||
| if version_stream != dev_stream: | ||
| return False, (f"dev stream '{version_stream}' does not match --dev-stream '{dev_stream.value}'") | ||
| return True, None |
Contributor
There was a problem hiding this comment.
Claude, this is terrible and you know it.
Dispatches from product repos need to narrow the matrix to a specific image version and release stream. bakery build and bakery run dgoss already accept --image-version and --dev-stream; this wires those through as workflow_call inputs on bakery-build-native.yml and bakery-build.yml, and adds --image-version to bakery ci matrix so the matrix generation filters as well (otherwise every version schedules a runner that filters to a no-op). Inputs default to empty and are only appended when set, so existing callers are unaffected.
Per review feedback on #480: - When --image-version is set and matches nothing, exit non-zero instead of emitting "[]". In CI, a silent empty matrix skips all build jobs while the workflow reports green, masking a dispatch that targeted a nonexistent version. - Add feature scenarios for matching and non-matching filters.
The ci matrix command iterates img.versions directly instead of using generate_image_targets(), so the dev_stream filter was not applied to its output. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Access model_fields from the class instead of the instance to fix PydanticDeprecatedSince211 warnings. Deprecated in Pydantic v2.11, will be removed in v3.0.
Cherry-picking the matches_dev_filter() refactor on top of a branch that also edited the same loop left a three-line dev_stream check below the new matches_dev_filter() call. Remove it — the method already handles stream filtering.
c1edcc2 to
83b2f09
Compare
1 task
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
Dispatches from product repos need to narrow the build matrix to a specific image version and release stream. Main's
bakery buildandbakery run dgossalready accept--image-versionand--dev-stream(the CLI half landed in #457), but the reusable workflows don't expose those inputs yet — so the three in-flightdev-dispatch-inputsPRs in images-connect/images-workbench/images-package-manager have to pin to the orphanedrelease-stream-filterbranch.This PR closes that gap by adding two optional inputs (
image-version,dev-stream) tobakery-build-native.ymlandbakery-build.yml, and plumbing them through to the matrix and build steps. It also folds in #467 so theci matrixloop uses the sharedmatches_dev_filter()method instead of inline dev/stream checks.Changes
bakery-build-native.ymlandbakery-build.yml: addimage-versionanddev-streamas optionalworkflow_callinputs (default empty). Append them tobakery ci matrixcalls only when set, using bash arrays so existing callers keep working unchanged.posit_bakery/cli/ci.py: add--image-versionoption tobakery ci matrix. Without this, passing--image-versionto matrix generation would fail on main (onlybakery buildandbakery run dgosshad it). Exits non-zero when the filter matches nothing so CI doesn't silently skip all build jobs.ImageVersion.matches_dev_filter()extracted to deduplicate the dev/stream check betweengenerate_image_targetsandci matrix; Pydanticmodel_fieldsdeprecation fix ondependency.py.--image-versionfilters.Scope intentionally excludes
dev-channel/--valueoverrides from therelease-stream-filterbranch — the bakery CLI has no--dev-channelon main and the dispatch PRs listed in #302 don't use it.Unblocks
After this merges, those PRs can repoint their
development.ymlfrombakery-build-native.yml@release-stream-filterto@main.Supersedes
Test plan
bakery ci matrixtests pass (unchanged).--image-versionfilter produces a matrix containing only the named version.--image-versionexits non-zero.