Skip to content

feat(devcontainer): add a development configuration alongside the demo - #595

Draft
reitblatt wants to merge 1 commit into
reitblatt/codespaces-uxfrom
reitblatt/codespaces-dev
Draft

reitblatt wants to merge 1 commit into
reitblatt/codespaces-uxfrom
reitblatt/codespaces-dev

Conversation

@reitblatt

Copy link
Copy Markdown
Contributor

Stacked on #593: review that first. This PR's base is reitblatt/codespaces-ux, so the diff shows only the dev configuration.

Summary

Adds a second devcontainer configuration, Osprey development (.devcontainer/dev/devcontainer.json), for working on Osprey's code in Codespaces or locally. The demo from #593 stays the default, so the README badge and the plain Create codespace button still open the demo.

  • Tools: Python 3.11 (from .python-version, installed by uv), uv, Node 22.22 with Corepack 0.33.0 (the versions CI uses), Rust stable with protoc, and Docker-in-Docker.
  • Dependencies: updateContentCommand runs uv sync --dev, pnpm install --frozen-lockfile and pre-commit install --install-hooks, so a prebuild would include them.
  • Nothing starts on its own. postAttachCommand prints how to start things:
    • bash .devcontainer/scripts/start.sh brings up the demo's stack and test data.
    • ./run-tests.sh runs the integration tests.
    • pnpm start runs the UI dev server. The container sets REACT_APP_API_BASE_URL=/api, so it works through Codespaces' forwarded port.
  • Picking it: New with options… → Dev container configuration, or https://codespaces.new/roostorg/osprey?devcontainer_path=.devcontainer/dev/devcontainer.json (a badge for it is in docs/development/codespaces.md). Locally: npx @devcontainers/cli up --workspace-folder . --config .devcontainer/dev/devcontainer.json.
  • Docs: a "Development configuration" section in .devcontainer/README.md, the "For engineers" section of docs/development/codespaces.md, a pointer from docs/development/local.md, and the CLI line in AGENTS.md.

There's no CHANGELOG entry, because it's development tooling and doesn't affect deployments.

Testing

Built from a fresh clone of this branch with @devcontainers/cli@0.80.2 in the Coder workspace. I didn't create a real Codespace.

  • Setup takes about 2 minutes cold (image and features about 70 s, then tools and dependencies about 20 s), or 30 s with the image cached.
  • Installed versions: uv 0.13.6, Python 3.11.18, Node 22.22.3, pnpm 10.33.4 (in osprey_ui/), cargo 1.99.1 with rustfmt and clippy, libprotoc 3.21.12. The pre-commit hook was installed.
  • Ran inside the container:
    • uv run ruff check, pnpm run typecheck and cargo fmt --check all pass.
    • bash .devcontainer/scripts/start.sh brought up the full stack with fresh events in 97 s, pulling and building images on demand.
    • With the osprey-ui container stopped, pnpm start served the UI on 5002 and proxied /api/config to the API.
  • I used the same local iptables-nft workaround for Docker-in-Docker as in feat(devcontainer): one-click osprey demo in github codespaces #593 (a Linux 7.0 host issue, not a Codespaces one).

Known quirk: running pnpm from the repo root (outside osprey_ui/) fails. Outside a project, Corepack picks the latest pnpm (12.x), which Corepack 0.33.0 can't run. A laptop with CI's Corepack version does the same. Every pnpm command in the docs runs in osprey_ui/, where the packageManager pin applies.

Approval items

New third-party devcontainer features (dependencies), from the same source and license as the Docker-in-Docker feature approved on #593:

Item Source License
ghcr.io/devcontainers/features/node:1 devcontainers/features MIT; installs Node.js (MIT) via nvm (MIT)
ghcr.io/devcontainers/features/rust:1 devcontainers/features MIT; installs Rust via rustup (MIT/Apache-2.0)

Set up by install-tools.sh, not as features:

  • uv, from Astral's official install script (MIT/Apache-2.0). This is the same "latest" that CI's setup-uv installs.
  • protobuf-compiler, from Ubuntu's apt repository (BSD-3-Clause). CI installs it the same way.
  • Corepack 0.33.0, from npm (MIT). CI pins this version.

The VS Code extensions it recommends (Python, Ruff, ESLint, Prettier) are editor suggestions, not project dependencies.

Dependabot: #593's devcontainers entry (directory: "/") should also pick up .devcontainer/dev/devcontainer.json, since Dependabot looks in .devcontainer/<folder>/ too. Its first run after merge will confirm that.

Prebuilds

If you set up the demo prebuild recommended on #593, this configuration needs its own prebuild if you want one. Codespaces sets up prebuilds per configuration file.

🤖 Generated with Claude Code

Adds .devcontainer/dev/devcontainer.json: the toolchains (uv-managed Python,
Node 22.22 with Corepack, Rust stable with protoc) and project dependencies
installed, Docker-in-Docker available, and nothing started until asked.
The demo stays the default configuration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

1 participant