You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The spike (#728) established that --strategy bake and --strategy build emit the same
metadata contract, and #733 makes --metadata-file work on the bake path. Several docs and
help strings still assert the old, strategy-specific story, and one important behavioral
consequence of the metadata format is documented nowhere.
Known doc issues to fix
plugins/builtin/imagetools/imagetools.py:206 — imagetools merge help says the input is
"build metadata JSON files (produced by bakery build --strategy build)". Post-feat: carry --metadata-file through the bake build strategy #733 this is
actively misleading; either strategy produces valid input. Reword to
"produced by bakery build --metadata-file (either build strategy)".
cli/build.py--metadata-file help ("The path to write JSON build metadata to once builds
are finished") does not mention that the file is keyed by image-target UID, nor that with --strategy build it is written only after all targets succeed while with --strategy bake buildx owns the file. Document the write semantics, since a failed target
means downstream dgoss run / ci publish see a missing (bake) vs. absent (build) file
rather than a partial one.
cli/build.py--plan is bake-only and errors out under --strategy build
(cli/build.py:281-291); the help text does not say so.
--jobs help mentions it is ignored for --strategy bake, but the surrounding strategy
docs don't summarize the strategy differences anywhere a user would find them. A short
"choosing a build strategy" section (parallelism, --plan, --fail-fast scope, metadata
write semantics) in CONTRIBUTING.md or the bakery README would consolidate this.
BakePlan.build()'s metadata_file docstring is currently the only place that records
"one entry per bake target, keyed by the image target UID" — that fact belongs in
user-facing docs, not just a docstring.
For both strategies, a target built for more than one platform in a single invocation
produces one metadata entry describing an index/manifest-list descriptor with no platform field. BuildMetadata.platform (image/image_metadata.py) then returns None,
which means:
ImageTarget.image_reference(platform=...) (image_target.py:498-512) finds no
platform-matching metadata and falls back to a tag-based reference, so bakery dgoss run --metadata-file stops testing the exact built digest.
ImageTarget.get_merge_sources() (image_target.py:742-757) collapses to a single source
keyed on None, so per-platform merge inputs are lost.
Practical rule to write down: one platform per bakery build invocation when the metadata
file is going to be consumed by dgoss run or ci publish. This is what bakery-build-native.yml already does (one image/version/platform per runner) and what bakery-build.yml's QEMU path must keep in mind. This constraint predates and is unaffected
by the bake migration, but it has never been documented.
Acceptance criteria
No remaining doc or help text implies metadata files are --strategy build-only.
Strategy differences (parallelism, --plan, metadata write semantics) documented in one
discoverable place.
The one-platform-per-invocation constraint and its two concrete consequences are documented
alongside the --metadata-file option.
Context
The spike (#728) established that
--strategy bakeand--strategy buildemit the samemetadata contract, and #733 makes
--metadata-filework on the bake path. Several docs andhelp strings still assert the old, strategy-specific story, and one important behavioral
consequence of the metadata format is documented nowhere.
Known doc issues to fix
plugins/builtin/imagetools/imagetools.py:206—imagetools mergehelp says the input is"build metadata JSON files (produced by
bakery build --strategy build)". Post-feat: carry --metadata-file through the bake build strategy #733 this isactively misleading; either strategy produces valid input. Reword to
"produced by
bakery build --metadata-file(either build strategy)".cli/build.py--metadata-filehelp ("The path to write JSON build metadata to once buildsare finished") does not mention that the file is keyed by image-target UID, nor that with
--strategy buildit is written only after all targets succeed while with--strategy bakebuildx owns the file. Document the write semantics, since a failed targetmeans downstream
dgoss run/ci publishsee a missing (bake) vs. absent (build) filerather than a partial one.
cli/build.py--planis bake-only and errors out under--strategy build(
cli/build.py:281-291); the help text does not say so.--jobshelp mentions it is ignored for--strategy bake, but the surrounding strategydocs don't summarize the strategy differences anywhere a user would find them. A short
"choosing a build strategy" section (parallelism,
--plan,--fail-fastscope, metadatawrite semantics) in
CONTRIBUTING.mdor the bakery README would consolidate this.BakePlan.build()'smetadata_filedocstring is currently the only place that records"one entry per bake target, keyed by the image target UID" — that fact belongs in
user-facing docs, not just a docstring.
Multi-platform invocation consequence (document explicitly)
For both strategies, a target built for more than one platform in a single invocation
produces one metadata entry describing an index/manifest-list descriptor with no
platformfield.BuildMetadata.platform(image/image_metadata.py) then returnsNone,which means:
ImageTarget.image_reference(platform=...)(image_target.py:498-512) finds noplatform-matching metadata and falls back to a tag-based reference, so
bakery dgoss run --metadata-filestops testing the exact built digest.ImageTarget.get_merge_sources()(image_target.py:742-757) collapses to a single sourcekeyed on
None, so per-platform merge inputs are lost.Practical rule to write down: one platform per
bakery buildinvocation when the metadatafile is going to be consumed by
dgoss runorci publish. This is whatbakery-build-native.ymlalready does (one image/version/platform per runner) and whatbakery-build.yml's QEMU path must keep in mind. This constraint predates and is unaffectedby the bake migration, but it has never been documented.
Acceptance criteria
--strategy build-only.--plan, metadata write semantics) documented in onediscoverable place.
alongside the
--metadata-fileoption.