feat(build): support feature installation on image-reference configs#134
Merged
Conversation
Addresses half of the deferred "feature installation during build is not yet supported for compose or image-reference configurations" gate (build/mod.rs). Image-reference builds already route through `execute_docker_build` (a synthetic `FROM <image>` Dockerfile) which applies the deterministic `deacon-build:<hash>` tag, so the existing post-build feature-layering pass can handle them with no new integration path — only the gate needed to stop rejecting them. Compose builds still fail fast (tracked separately) since layering features onto a targeted compose service needs the `up` compose flow. Also fixes a latent bug the image-reference path exposed: after features are layered into a *new* image, the base build's tags (the `--image-name`s and the deterministic tag) still pointed at the pre-feature base image, so `--image-name` resolved to an image *without* the features. `execute_build` now re-tags the feature-extended image with each of those tags (new `retag_image` helper). This also corrects the Dockerfile+features path, whose canaries previously only checked the JSON outcome, not image contents. - `examples/build/image-reference-with-features`: base image alpine -> debian so the bash feature install script runs; the canary now verifies the feature artifact is present in the named image. - New `integration_build` regression test asserting `--image-name` resolves to the feature-extended image. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5 tasks
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
pofallon
added a commit
that referenced
this pull request
May 29, 2026
…139) Closes the last part of the deferred "feature installation during build is not yet supported for compose or image-reference configurations" gate (the image-reference half landed in #134). Compose builds now resolve the target service's shape and build a feature-extended image, matching `up`. - Refactor: extract the shape→feature-build core out of `up`'s `install_features_for_compose` into a reusable `pub(crate) resolve_compose_feature_image` (takes `&ComposeProject`, no project mutation). `up` calls it then sets `service_image_override`; behavior unchanged (both compose-feature integration tests still pass). - `build`: new `execute_compose_build_with_features` resolves the service shape (`image:` or `build:`), builds the feature-extended image via the shared helper, tags it with the deterministic `deacon-build:<hash>` tag plus any `--image-name`s (reusing `retag_image`), and writes the feature lockfile. The generic post-build layering pass is skipped for compose. - Remove the compose feature-install rejection gate. - Example `compose-with-features`: base alpine → debian (bash feature script); exec.sh + README now verify `/hello.txt` is present in the named image. - New docker-gated `integration_compose_features_build` test asserting `deacon build --image-name` on a compose+features config resolves to the feature-extended image. Fixes #135. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Addresses half of the deferred "feature installation during build is not yet supported for compose or image-reference configurations" gate (
build/mod.rs), surfaced this session by theimage-reference-with-featurescanary.Image-reference builds already route through
execute_docker_build(a syntheticFROM <image>Dockerfile) which applies the deterministicdeacon-build:<hash>tag, so the existing post-build feature-layering pass handles them with no new integration path — only the gate needed to stop rejecting them. Compose builds still fail fast (tracked separately): layering features onto a targeted compose service needs theupcompose flow.Latent bug also fixed
After features are layered into a new image, the base build's tags (the
--image-names and the deterministic tag) still pointed at the pre-feature base image — so--image-nameresolved to an image without the features.execute_buildnow re-tags the feature-extended image with each of those tags (newretag_imagehelper). This also corrects the Dockerfile + features path, whose canaries previously only checked the JSON outcome, not image contents.Changes
build/mod.rs: narrow the feature-install gate to compose-only; re-tag the feature-extended image with the base build's tags; refresh stale comments.examples/build/image-reference-with-features: basealpine:3.19→debian:bookworm-slim(bash feature script); canary verifies the feature artifact in the named image.integration_buildregression test asserting--image-nameresolves to the feature-extended image.Testing
test_build_image_reference_with_features_tags_final_imagepasses (Docker).buildkit-gated-feature,dockerfile-with-features,image-reference-with-featurescanaries all pass end-to-end (feature artifact present in the named image).cargo fmt/clippyclean.Remaining deferral
Compose + features build (
compose-with-featurescanary) — needs the compose-service feature-layering path; left as a tracked follow-up.🤖 Generated with Claude Code