feat(ports): support appPort arrays and share build-config resolution#173
Merged
Conversation
appPort now accepts a single value or an array per the containers.dev spec (new AppPort untagged enum), and appPort bindings are published as docker -p args alongside forwardPorts. Port publish-arg construction is extracted into tested helpers in docker.rs. Dockerfile build-config resolution is deduplicated into a shared resolve_devcontainer_build_config() helper used by both `build` and `up`, resolving dockerFile/build.dockerfile relative to the config dir. Also drops stale "MVP-only" comments from release.yml left over after the MVP/full feature gate was removed (#165). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…json The build-config refactor resolves dockerFile/build.dockerfile relative to the devcontainer.json location (spec-correct), so fixtures with the config under .devcontainer/ but the Dockerfile at the workspace root no longer resolve. Move those Dockerfiles into .devcontainer/ to match. Fixtures with a root-level .devcontainer.json (config dir == workspace root) and compose-based builds are unaffected and left unchanged. 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
Two related changes that were sitting uncommitted in the working tree, plus a small CI cleanup.
1.
appPortarray support (spec parity)AppPortuntagged enum (Single(PortSpec)|Multiple(Vec<PortSpec>)) replacingapp_port: Option<PortSpec>. Per the containers.dev spec,appPortmay be a single value or an array; previously only a scalar was accepted. Serialization round-trips the original shape.ports.rsandconfig.rsiterateapp_port.specs()everywhere.docker.rsnow publishesappPort(single or array) as docker-pbindings alongsideforwardPorts, with publish-arg construction extracted into testedport_spec_to_publish_arg/port_publish_argshelpers (ordering preserved:forwardPortsfirst, thenappPort).2. Shared build-config resolution (refactor)
commands/shared/build_resolution.rs::resolve_devcontainer_build_config()resolvingdockerFile/build.dockerfilerelative to the config dir (per the config-relative path rule).build/mod.rsandup/image_build.rsboth call it instead of duplicating extraction;upnow passesconfig_pathrather thanworkspace_folder. Net reduction of duplicated logic.3. CI cleanup
release.ymlleft over after the MVP/full feature gate was removed (refactor: ship full consumer surface as one binary (remove MVP/full feature gate) #165).Testing
Local gate is green:
cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningscargo test --doc --workspace(130 passed)cargo nextest run --profile dev-fast(2455 passed, 31 skipped)cargo deny check(advisories/bans/licenses/sources ok)AppPort(de)serialization, port publish args, and build-config resolution.🤖 Generated with Claude Code