Add dependency-backed dev version and Positron daily channel#567
Conversation
There was a problem hiding this comment.
This creates a bit of weirdness where Positron is considered as both a dependency and a product. We'll need to make it live in one of those worlds. I would vote for keeping it a dependency and finding a way to implement dev version or prerelease behaviors with dependency matrix builds.
I would still like a --latest flag for building matrix builds to single out the latest image only. Maybe a similar concept could be implemented for --pre-release to build the an image with dependency pre-releases if defined/available?
|
Another idea, we could move it fully into the product world and make a section for |
e754ad3 to
56b82eb
Compare
5af4cc6 to
8626fc7
Compare
f6f027d to
cea46e4
Compare
8626fc7 to
9706fbb
Compare
cea46e4 to
ca1be12
Compare
9706fbb to
3791b34
Compare
3791b34 to
2c81ace
Compare
ianpittwood
left a comment
There was a problem hiding this comment.
I think the mechanism makes more sense now, but we're missing docs updates. I would also like to possibly see a test suite or a more rigidly defined example of the configuration in action.
I've updated the documentation and extended the test suite. |
Uhhhh I don't see any commits since my last review? Did they not push or is GitHub having a goof? |
I forgot to push 🤦🏻 |
6ead903 to
0a6f341
Compare
ci merge, ci readme, clean cache-registry, clean temp-registry, get tags, and run dgoss all received the deprecated --dev-stream alias and coalesce block in the dev-build-dispatch branch, but only bakery build and ci matrix had CLI coverage for that behavior. Each command gets two tests: --dev-stream alone coalesces to dev_channel, and --dev-channel takes precedence when both are given.
Both test_dev_spec.py and test_dev_stream_deprecated.py duplicated the same from_context call-args extraction logic. Extract it to test/cli/conftest.py as settings_from_call so there is one place to update if the calling convention changes.
Add ProductEnum.POSITRON and support for DAILY release
channel. The POSITRON_DAILY_CDN_URL_TEMPLATE includes a
{positron_cdn_arch} placeholder that will be formatted at
fetch time by Task 3.
Add POSITRON to product_release_channel_url_map with a DAILY channel
backed by POSITRON_DAILY_CDN_URL_TEMPLATE. The channel URL contains a
{positron_cdn_arch} placeholder resolved via format_map before the
HTTP request, so the URL is arch-aware.
- Add positron_cdn_arch and positron_pkg_arch keys to
_make_resolver_metadata (amd64 → x86_64/x64)
- Apply format_map(metadata) to channel_url before fetching so
{positron_cdn_arch} resolves; no-op for static URLs used by
existing products
- Add POSITRON_DAILY_CDN_URL_TEMPLATE import
- Add 4 parametrized test cases for the new metadata keys
Created positron_daily_x86_64.json and positron_daily_arm64.json testdata files and added URL pattern matching in the patch_testdata_response fixture to map requests to the POSITRON_DAILY CDN endpoints to the local testdata files for unit tests.
The x86_64 identifier is used in some contexts (e.g., RHEL 9) and should map to the same CDN paths and package architecture as amd64, not trigger a fallback to x86_64 in the package arch mapping. Added test coverage for rocky, alma, and rhel with the x86_64 identifier to prevent regression.
Verify that pinned version_override bypasses the network call to CachedSession by asserting the mock is never called. This prevents future regressions where the offline path could be broken but the test would still pass due to CDN returning matching data by coincidence.
Positron was tracked as both a dependency (via SupportedDependencies.POSITRON in the matrix) and a product (via ProductEnum.POSITRON for daily preview builds), creating a dual-world conflict raised in issue #472. This replaces the product-side Positron code entirely with a generic ImageDevelopmentVersionFromDependencyPrerelease type (sourceType: dependency-prerelease) that resolves its version through the existing dependency constraint infrastructure with prerelease=True. The Containerfile template handles download URL construction from Image.Version and values passed via the devVersions values: field. - Add POSITRON_DAILY_URL_TEMPLATE to dependencies/const.py - Add prerelease: bool and daily_url() to PositronDependency; update _fetch_versions() to append the daily build when prerelease=True - Add ImageDevelopmentVersionFromDependencyPrerelease (sourceType: dependency-prerelease) in dev_version/dependency.py; register in DevelopmentVersionTypes union - Remove ProductEnum.POSITRON, POSITRON_DAILY_CDN_URL_TEMPLATE, and all product-side Positron resolver code from posit_product/ - Move positron daily testdata from posit_products/ to dependencies/ - Update conftest mock routing from product const to dependency const
Rename ImageDevelopmentVersionFromDependencyPrerelease to ImageDevelopmentVersionFromDependency and change sourceType from "dependency-prerelease" to "dependency". Add a prerelease: bool = False field to the class, passed through to the constraint constructor, replacing the hardcoded True. This makes prerelease intent explicit in bakery.yaml (on the devVersions entry) rather than implied by the sourceType name. The constraint class retains its prerelease field as an implementation detail; the devVersions prerelease field is the single user-facing point of control for prerelease resolution.
Add `devVersions` to the Image field table and a new `ImageDevelopmentVersion` section covering both sourceType variants (`stream` for product channels, `dependency` for prerelease resolution). Also extend the prerelease callout to mention `positron` alongside `quarto`, since both now support the `prerelease` field.
Replace the sparse 7-test file with full chain coverage: validation, version resolution (exact assertions), URL delegation, OS and registry behaviour, values passthrough, and as_image_version() integration tests.
- test_inert_when_no_spec: type-narrow to channel devVersions; the field doesn't exist on dependency-type devVersions - Add test for dev_spec with no channel pinning the sole stream devVersion - test_positron_prerelease_includes_daily: assert daily sorts to front - Add dedup test: daily version appearing in releases must not appear twice - Fix _fetch_versions to deduplicate before sorting (set() dedup) - Hoist DispatchVersionMismatchError imports to module level in test_channel.py and test_main.py; remove redundant local patch import - Add match= to both mismatch error tests - Strengthen test_no_override_scheduled_path_unchanged with exact version - Add download_url assertion to test_ppm_preview_override_renders_offline - Split test_empty_version_raises into two focused tests
The merge command accepted --dev-stream but delegated to publish without applying the dev_stream → dev_channel coalesce, so the flag was silently ignored.
0a6f341 to
51e9bf6
Compare
ImageDevelopmentVersionFromDependency had no channel field and
inherited the base get_release_channel() returning None, so
release_channel was never set in image version metadata. The
{{ Channel }} tag variable and any downstream channel routing
were therefore inert for dependency-sourced dev versions.
Add an optional channel: ReleaseChannelEnum | None field and
override get_release_channel() to return it. Callers set
channel: daily (or preview, once that stream is wired up)
in bakery.yaml to populate the metadata correctly.
Setting channel: release is always wrong here — the absent key
already causes image_target to treat a build as release, and
an explicit release value would make {{ Channel }} render
"release" and emit unwanted release-* tags.
Catch this at config parse time with a field validator.
Add channel to the sourceType: dependency field table and update the example to include channel: daily.
Positron's CDN URL is arch-parameterized, which doesn't fit the existing product channel model. Routing through the dependency constraint system reuses the arch-handling logic already in
PositronDependencyrather than duplicating it.Stacked on: