Skip to content

Add --dev-stream filter and dev-channel support#436

Closed
bschwedler wants to merge 13 commits intomainfrom
release-stream-filter
Closed

Add --dev-stream filter and dev-channel support#436
bschwedler wants to merge 13 commits intomainfrom
release-stream-filter

Conversation

@bschwedler
Copy link
Copy Markdown
Contributor

@bschwedler bschwedler commented Apr 9, 2026

Summary

  • Add --dev-stream filter and --value key=value override to bakery build, bakery ci matrix, bakery run dgoss, bakery ci merge, and bakery ci readme
  • Add dev-stream and dev-channel inputs to both shared workflows (bakery-build-native.yml, bakery-build.yml) and plumb them through all steps (matrix, build, test, merge, readme)
  • Pass devVersion values dict through to stream URL resolution, enabling templated URLs (e.g. {channel} in preview stream URLs)
  • Thread value overrides through as_image_version() / get_version() instead of mutating the devVersion model in-place
  • Catch KeyError from format_map on stream URLs and raise a clear ValueError naming the missing placeholder

How this is invoked

Product repos dispatch development.yml in image repos, which forward stream/channel to the shared workflows added here:

Those image repo workflows are in turn dispatched by:

Context

Prerequisite for event-driven dev image builds (#302). Also enables #237 (Workbench preview release stream) — once this merges, adding a preview stream to Workbench is a bakery.yaml config change.

Test plan

  • Stream filter test: daily loaded, preview skipped
  • Values override test: channel=apple-blossom replaces config default without mutating original model
  • Channel propagation test: channel=globemaster-allium reaches product artifact resolver
  • URL placeholder tests: static URL, placeholder resolution, missing placeholder error
  • Manual: bakery ci matrix --dev-versions only --dev-stream daily filters correctly
  • Manual: bakery ci matrix --dev-versions only --value channel=apple-blossom overrides URL

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

Test Results

1 334 tests   1 334 ✅  8m 31s ⏱️
    1 suites      0 💤
    1 files        0 ❌

Results for commit c00b523.

♻️ This comment has been updated with latest results.

Filters development version loading to a specific release stream
(e.g. 'daily', 'preview'). Streams that don't match are skipped
before any HTTP requests are made to resolve versions.

Added to:
- bakery build --release-stream
- bakery ci matrix --release-stream
- bakery-build-native.yml (release-stream input)
- bakery-build.yml (release-stream input)

This enables image repo development.yml workflows to accept a
stream parameter from upstream product repos, building only the
relevant stream instead of all dev versions.
Use bracket notation for hyphenated input names in GitHub Actions
expressions (inputs['release-stream'] not inputs.release-stream).

Add test_load_dev_versions_release_stream_filter asserting that
only the daily stream is loaded when release_stream="daily" and
the preview stream is skipped.
Rename --release-stream to --dev-stream across CLI, config, and
workflows to match the existing --dev-versions naming convention.

Pass devVersion values dict into the product stream URL resolver
metadata. This allows stream URLs to use template variables from
bakery.yaml config, e.g.:

  devVersions:
    - sourceType: stream
      product: workbench
      stream: preview
      values:
        channel: apple-blossom

The stream URL can then use {channel} to resolve the upstream
branch codename without a CLI flag. ReleaseStreamPath.get() now
formats stream_url with metadata before fetching.
Reuses the existing --value key=value pattern and __make_value_map
parser from create/update commands. Values override the devVersion
values dict, which flows through to stream URL resolution.

This allows workflows to pass e.g. --value channel=apple-blossom
to override the channel used in a preview stream URL template.

Renames set_values to values on BakeryConfigFilter to match the
existing naming convention throughout the codebase.
Maps the dev-channel workflow input to --value channel={value}
when calling bakery ci matrix. This lets image repo development
workflows accept a branch codename from upstream dispatches
and override the channel in the devVersion config.

Both bakery-build-native.yml and bakery-build.yml accept the
new optional input. Empty string is a no-op.

Also adds test for values override in load_dev_versions.
Verifies that passing values={"channel": "globemaster-allium"}
overrides the default "latest" and propagates through to the
product artifact resolver.
Use bash arrays for bakery command construction in shared
workflows. Inputs are quoted via env vars and conditionally
appended, preventing word-splitting or metacharacter injection.

Fix globemaster-allium test to assert mock was called and at
least one call includes the expected channel value, preventing
false-positive pass on zero calls.
Pass value_overrides through as_image_version() and
get_version() instead of mutating dev_version.values
in-place. The original devVersion model now stays
unchanged after load_dev_versions(), preventing
double-application on repeated calls and keeping the
model consistent with the YAML config.
Catch KeyError from format_map on stream URLs and
raise a clear ValueError naming the missing placeholder
and suggesting --value to set it. This prevents an
unhelpful KeyError when URLs gain {channel} or similar
placeholders without the caller passing the value.

Rename __make_value_map to _make_value_map — the
double-underscore prefix triggers name mangling but
the function is imported across four CLI modules.

Add tests for ReleaseStreamPath with URL placeholders:
static URL, placeholder resolution, and missing key.
The matrix step was the only place passing --dev-stream
and --value to bakery. Every subsequent step (build,
test, merge, readme) re-invokes BakeryConfig which
calls load_dev_versions() independently. Without the
same overrides, URL resolution can produce a different
version, causing the --image-version filter to find no
match.

Add --dev-stream and --value to the bakery run dgoss,
bakery ci merge, and bakery ci readme CLI commands. Pass
DEV_STREAM and DEV_CHANNEL env vars through to all
workflow steps in both bakery-build-native.yml and
bakery-build.yml.
@bschwedler bschwedler force-pushed the release-stream-filter branch from 8d5c9df to fe11468 Compare April 13, 2026 16:39
@bschwedler bschwedler marked this pull request as ready for review April 13, 2026 16:42
@bschwedler bschwedler requested a review from ianpittwood as a code owner April 13, 2026 16:42
Add image-version input to bakery-build-native.yml and
bakery-build.yml so callers can filter to a specific
product version. Also add --image-version to bakery ci
matrix for parity. This lets upstream dispatches target
the exact version they just published rather than
building all resolved dev versions.
Always pass BakeryConfigFilter to merge/readme settings
instead of None when --value is empty. The default_factory
handles empty values correctly; None fails validation.

Update test import from __make_value_map to _make_value_map
to match the rename in the previous commit.
Use short repo names in subgraph labels, full workflow
filenames with click links to GitHub, and explicit
parameter names on all dispatch and workflow_call edges.

Removes intermediate bot nodes from per-product diagrams
so dispatch arrows go directly from product repo to
image repo with parameters shown on the edge.
@ianpittwood
Copy link
Copy Markdown
Contributor

Superseded by #457

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.

2 participants