Skip to content

feat(ports): support appPort arrays and share build-config resolution#173

Merged
pofallon merged 2 commits into
mainfrom
feat/app-port-array-and-build-resolution
Jun 2, 2026
Merged

feat(ports): support appPort arrays and share build-config resolution#173
pofallon merged 2 commits into
mainfrom
feat/app-port-array-and-build-resolution

Conversation

@pofallon
Copy link
Copy Markdown
Contributor

@pofallon pofallon commented Jun 1, 2026

Summary

Two related changes that were sitting uncommitted in the working tree, plus a small CI cleanup.

1. appPort array support (spec parity)

  • New AppPort untagged enum (Single(PortSpec) | Multiple(Vec<PortSpec>)) replacing app_port: Option<PortSpec>. Per the containers.dev spec, appPort may be a single value or an array; previously only a scalar was accepted. Serialization round-trips the original shape.
  • ports.rs and config.rs iterate app_port.specs() everywhere.
  • docker.rs now publishes appPort (single or array) as docker -p bindings alongside forwardPorts, with publish-arg construction extracted into tested port_spec_to_publish_arg / port_publish_args helpers (ordering preserved: forwardPorts first, then appPort).

2. Shared build-config resolution (refactor)

  • New commands/shared/build_resolution.rs::resolve_devcontainer_build_config() resolving dockerFile / build.dockerfile relative to the config dir (per the config-relative path rule).
  • build/mod.rs and up/image_build.rs both call it instead of duplicating extraction; up now passes config_path rather than workspace_folder. Net reduction of duplicated logic.

3. CI cleanup

Testing

Local gate is green:

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --doc --workspace (130 passed)
  • cargo nextest run --profile dev-fast (2455 passed, 31 skipped)
  • cargo deny check (advisories/bans/licenses/sources ok)
  • New unit tests for AppPort (de)serialization, port publish args, and build-config resolution.

🤖 Generated with Claude Code

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>
@github-actions github-actions Bot added the ci CI/CD changes label Jun 1, 2026
…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>
@pofallon pofallon merged commit d055abd into main Jun 2, 2026
11 checks passed
@pofallon pofallon deleted the feat/app-port-array-and-build-resolution branch June 2, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant