Commit graph

16 commits

Author SHA1 Message Date
Bryan Helmkamp
a1adbe89ca Fix Dependabot security alerts: update aws-lc-sys, jsonwebtoken, git2
- aws-lc-sys 0.37.1 → 0.38.0 (3 high: PKCS7 bypass, AES-CCM timing)
- jsonwebtoken 9 → 10.3.0 (medium: type confusion auth bypass)
- git2 0.19 → 0.20.4 (low: undefined behavior in Buf deref)
- Fix pre-existing clippy warning in arc-devcontainer

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 00:42:23 -05:00
Bryan Helmkamp
dc3867a3c4 Fix cargo fmt formatting across workspace
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 00:36:44 -05:00
Bryan Helmkamp
f9e30c7ae0 allow dead code in arc-devcontainer for now 2026-03-03 14:49:22 -05:00
Bryan Helmkamp
864cb5d853 Fix 3 feature spec bugs: shorthand version, option env names, install user vars
- Normalize string option values ("1.18") to {"version": "1.18"} so
  shorthand syntax correctly sets the VERSION env var
- Add option_id_to_env_name() to convert option IDs like "node-version"
  to NODE_VERSION per the dev container spec
- Emit _REMOTE_USER, _CONTAINER_USER, _REMOTE_USER_HOME, and
  _CONTAINER_USER_HOME in feature install snippets, threading remoteUser
  from devcontainer.json through resolve_features/generate_layer

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-03 10:07:23 -05:00
Bryan Helmkamp
eab81aee99 Simplify feature fetch functions: extract shared helpers
- Extract read_feature_metadata(), extract_tgz(), and create_feature_dir()
  helpers to eliminate copy-paste across fetch_feature_oci/local/https
- Move ensure_oras() out of per-feature calls into a once-per-resolve
  check via oras_checked flag
- Simplify dockerfile::generate() to take &HashMap instead of
  &Option<HashMap>, removing an unnecessary clone in the caller

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 00:59:41 -05:00
Bryan Helmkamp
ba2b6faef3 Add e2e tests for 5 devcontainer spec gaps using local features
Create a local-features fixture with 3 local feature directories that
exercise all gap fixes through the full DevcontainerResolver pipeline:
- dependsOn auto-injection (base-utils not in features map, injected)
- feature containerEnv merge (3 features contribute env vars)
- feature lifecycle hooks (appended after devcontainer.json commands)
- local path feature references (all features use ./ paths)
- install ordering (dependsOn/installsAfter edges respected)

Also fix a concurrency bug: resolve_features now uses a unique temp
dir per invocation instead of a shared /tmp/devcontainer-features/
that caused parallel test corruption.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 00:51:26 -05:00
Bryan Helmkamp
cf05084f7c Fix clippy collapsible_if warning in topo_sort
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 00:46:23 -05:00
Bryan Helmkamp
afaffa2538 Update DEVCONTAINER-COMPATIBILITY.md for 5 new spec gaps
Document support for: feature dependsOn, feature containerEnv, feature
lifecycle hooks (onCreateCommand/postCreateCommand/postStartCommand),
subdirectory file discovery, and local path/HTTPS feature references.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 00:45:44 -05:00
Bryan Helmkamp
f17c457a15 Add local path and HTTPS feature references to arc-devcontainer
Features can now be referenced as local paths (./feature or ../feature)
or HTTPS URLs (https://example.com/feature.tgz) in addition to OCI
registry references. A dispatch function routes fetches based on the
feature ID prefix. The oras CLI is only required for OCI refs.

Also updates dir_name_from_id to handle local paths (strip ./) and
URLs (strip .tgz extension), and passes devcontainer_dir to
resolve_features instead of build_context.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 00:45:17 -05:00
Bryan Helmkamp
62b4e9df74 Add subdirectory file discovery to arc-devcontainer
When neither .devcontainer/devcontainer.json nor .devcontainer.json
exists, scan .devcontainer/ for subdirectories containing a
devcontainer.json. Subdirectories are sorted alphabetically and the
first match is used. Standard locations still take priority.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 00:42:34 -05:00
Bryan Helmkamp
d437f038d0 Add feature lifecycle hooks to arc-devcontainer
Features can now declare onCreateCommand, postCreateCommand, and
postStartCommand lifecycle hooks. These are collected in install order
via ResolvedFeatures and appended after the devcontainer.json lifecycle
commands during resolution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 00:41:21 -05:00
Bryan Helmkamp
22e992d8ed Add feature containerEnv support to arc-devcontainer
Add containerEnv field to FeatureMetadata and introduce ResolvedFeatures
struct that collects container_env from each feature in install order.
Feature containerEnv is merged with devcontainer.json containerEnv
(devcontainer.json wins on conflicts) before generating the Dockerfile.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 00:38:49 -05:00
Bryan Helmkamp
88508a4b5f Add feature dependsOn support to arc-devcontainer
Add dependsOn field to FeatureMetadata for declaring hard feature
dependencies per the devcontainer spec. The topo_sort function now
handles both installsAfter and dependsOn edges with deduplication.
Missing dependsOn targets are auto-injected (fetched and added to
the sorted feature set with the specified options).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 00:36:39 -05:00
Bryan Helmkamp
4ad60489b9 Fix 4 spec compliance gaps in arc-devcontainer
- Stop baking remoteEnv into Dockerfile (only containerEnv belongs as ENV)
- Merge forwardPorts with compose ports in compose mode (with dedup)
- Support build.target (parsed with variable substitution)
- Handle forwardPorts string formats like "8080:80" and "9090"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 00:06:23 -05:00
Bryan Helmkamp
ee11a46b86 Fix 4 critical gaps in arc-devcontainer: onCreateCommand, build.args, containerEnv, compose array
- Add onCreateCommand lifecycle hook (parsed, resolved, exposed as on_create_commands)
- Expose build.args on DevcontainerConfig for docker build --build-arg
- Wire containerEnv into generated Dockerfile as ENV directives (remoteEnv overrides on collision)
- Support dockerComposeFile as array of paths with merge semantics (last wins for image/build/user, ports accumulate, env overrides)
- Update DEVCONTAINER-COMPATIBILITY.md and INTEGRATION.md docs
- Add e2e tests with realistic Python and compose project fixtures

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 23:43:45 -05:00
Bryan Helmkamp
5e337b4cb3 Add arc-devcontainer crate for parsing and resolving devcontainer.json
Standalone crate that reads devcontainer.json (with JSONC support), fetches
OCI Features via oras, and produces a resolved config containing a generated
Dockerfile, lifecycle hooks, environment variables, and forwarded ports.

Supports image, Dockerfile, and Docker Compose modes with devcontainer
variable substitution. No coupling to arc-workflows or DaytonaSandbox.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 22:38:12 -05:00