Skip to content

fix(devcontainer): repair postCreateCommand and pin Feature versions#1057

Open
talpitoo wants to merge 3 commits into
developfrom
fix/devcontainer-postcreate-and-lockfile
Open

fix(devcontainer): repair postCreateCommand and pin Feature versions#1057
talpitoo wants to merge 3 commits into
developfrom
fix/devcontainer-postcreate-and-lockfile

Conversation

@talpitoo

@talpitoo talpitoo commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Fixes two independent problems that make opening a fresh dev container fail or appear to hang (root-caused from the Dev Containers creation logs and Docker events after a full cleanup + reclone).

1. postCreateCommand has been broken since #1004

It still called npm run build:lib, but #1004 removed that script from the root package.json (2026-06-24). On every fresh container create, npm install succeeded, then postCreate aborted with Missing script: "build:lib" — so the library build and the Playwright/Chromium install (everything after the &&) never ran. Existing containers never re-run postCreate, which is why this went unnoticed.

Fixed by building the core package directly:

npm install && cd packages/openbridge-webcomponents && npm run build && npx playwright install --with-deps chromium

2. Unpinned Features cause surprise multi-minute image rebuilds

node:1 / git:1 are floating tags. Any upstream Feature release invalidates the feature-install Docker layer (several apt rounds + git PPA + node toolchain), so a container create that used to be instant silently turns into a ~6-minute image rebuild (measured 5m52s). Worse, cancelling the "Starting Dev Container" spinner mid-build discards the uncommitted layer, so every retry starts from zero — which is exactly what a full cleanup (container + volume removed, fresh clone) ran into.

Fixed by committing devcontainer-lock.json (generated by the Dev Containers CLI, pins git 1.3.8 / node 1.7.1 by digest), so image builds keep hitting the cached layer until the pins are deliberately updated. The README documents the upgrade path (npx @devcontainers/cli upgrade --workspace-folder .).

Related: #1004 (script removal), #1037 (persistent home volume — unaffected by this PR; the volume caches $HOME, not image layers).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated the dev container initialization to run the full build workflow during setup (while keeping the existing Chromium install step).
  • Documentation
    • Updated manual setup instructions to build only the core workspace instead of all libraries.
    • Added guidance that dev container feature versions are pinned via a lockfile for consistent, repeatable installs, with instructions to intentionally refresh it when desired.

- postCreateCommand called `npm run build:lib`, removed from the root
  package.json in #1004 — postCreate failed after `npm install`, so the
  library build and the Playwright install never ran. Build the core
  package directly instead.
- Commit devcontainer-lock.json (git 1.3.8 / node 1.7.1 by digest) so
  upstream Feature releases no longer invalidate the multi-minute
  feature-install image layer on every fresh container create; document
  the lockfile and its upgrade path in the README.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7496221e-8bb5-42a7-93d5-cff63a5f0b8e

📥 Commits

Reviewing files that changed from the base of the PR and between bd5e35e and 6c65c40.

📒 Files selected for processing (1)
  • .devcontainer/README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .devcontainer/README.md

📝 Walkthrough

Walkthrough

The Dev Container now locks Git and Node feature artifacts, documents lockfile maintenance, runs the full package build during post-creation, and updates manual setup to build only the core workspace.

Changes

Dev Container setup

Layer / File(s) Summary
Pin Dev Container features
.devcontainer/devcontainer-lock.json, .devcontainer/README.md
The lockfile pins Git and Node feature versions, resolved digests, and integrity hashes; documentation explains deterministic installs and lockfile upgrades.
Run the full post-create build
.devcontainer/devcontainer.json
postCreateCommand now runs npm run build while retaining dependency installation, the package directory change, and Chromium installation.
Update manual build instructions
README.md
Manual setup now builds only the packages/openbridge-webcomponents workspace.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: tibnor, jon-daeh, ulrik-jo

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main devcontainer fix and the feature version pinning added in this change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/devcontainer-postcreate-and-lockfile

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

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.devcontainer/README.md:
- Around line 48-50: Update the documentation around the devcontainers CLI
upgrade command in the README to explicitly state that it must be run from the
repository root, so the relative --workspace-folder . resolves correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 608cf74b-0193-45b8-a08d-864769f03457

📥 Commits

Reviewing files that changed from the base of the PR and between 5c94459 and 112b2bf.

📒 Files selected for processing (3)
  • .devcontainer/README.md
  • .devcontainer/devcontainer-lock.json
  • .devcontainer/devcontainer.json

Comment thread .devcontainer/README.md
@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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