Skip to content

Conversation

@jmgilman
Copy link
Collaborator

@jmgilman jmgilman commented Jan 4, 2026

Summary

  • Add devcontainer CLI integration as an alternative container runtime
  • Automatically detect and use devcontainer.json when present in repositories
  • Implement --devcontainer flag for explicit devcontainer mode
  • Add design document outlining the integration approach

Test plan

  • Run just check to verify all lints and tests pass
  • Test devcontainer detection with repos containing .devcontainer/devcontainer.json
  • Test explicit --devcontainer flag usage
  • Verify fallback to standard container runtime when no devcontainer config exists

🤖 Generated with Claude Code

claude and others added 4 commits January 4, 2026 06:09
Current behavior:
N/A - new documentation

New behavior:
Added a design document exploring approaches for integrating devcontainer
support into Headjack. The document covers three integration approaches:
1. Wrapping the official @devcontainers/cli (recommended)
2. Parsing devcontainer.json directly in Go
3. Hybrid approach using CLI for builds, native runtime for lifecycle

The document recommends Option 1 (CLI wrapper) due to full spec compliance,
automatic feature support, and reduced maintenance burden.
Current behavior:
Initial design document proposed multiple integration approaches with
separate code paths for devcontainer vs vanilla image handling.

New behavior:
Revised design to use a decorator pattern where DevcontainerRuntime
wraps an underlying Docker/Podman runtime and implements the same
containerRuntime interface. Key changes:
- No changes needed to Instance Manager
- DevcontainerRuntime delegates lifecycle ops to underlying runtime
- Run() calls devcontainer up, Exec() calls devcontainer exec
- Auto-detection: devcontainer.json used unless --image flag passed
- Added WorkspaceFolder field to RunConfig
- Documented Apple Containerization limitation
Current behavior:
Headjack only supported vanilla OCI images for container creation,
requiring users to manually configure container environments.

New behavior:
Added devcontainer support that automatically detects and uses
.devcontainer/devcontainer.json when present. Key changes:

- Added DevcontainerRuntime that wraps underlying Docker/Podman runtime
- DevcontainerRuntime uses devcontainer CLI for Run/Exec operations
- Lifecycle operations (Stop/Start/Remove) delegate to underlying runtime
- Auto-detection: devcontainer mode used unless --base flag is passed
- Added WorkspaceFolder field to container.RunConfig
- Added RemoteUser/RemoteWorkdir fields to catalog.Entry
- Extended Manager with Runtime/Executor accessors for runtime composition
- Apple Containerization not supported (warning printed, falls back to vanilla)

Closes: #49
Current behavior:
Code had linter errors: unchecked type assertion in manager.go,
overly permissive file permissions in tests, and unnecessary
fmt.Errorf usage.

New behavior:
- Added explicit ok check for type assertion in NewManager
- Changed test file permissions to 0o750/0o600 with new-style octal literals
- Replaced fmt.Errorf with errors.New where no formatting needed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 4, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
headjack 6cdd150 Commit Preview URL

Branch Preview URL
Jan 04 2026, 09:49 PM

jmgilman and others added 2 commits January 4, 2026 13:31
Current behavior:
N/A - new feature

New behavior:
Added devcontainer configuration for consistent development environments.
Includes Go 1.23, Node.js 22, Docker-in-Docker, golangci-lint, just,
hadolint, and GitHub CLI. Post-create script installs dependencies and
verifies tooling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jmgilman jmgilman merged commit 4d63859 into master Jan 4, 2026
4 checks passed
@jmgilman jmgilman deleted the claude/add-devcontainer-support-aqPNX branch January 4, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants