Skip to content

fix(devcontainer): run the checkout's devops in devcontainer terminals - #2460

Merged
dan-petty merged 3 commits into
mainfrom
fix/2449-devcontainer-venv-path
Oct 28, 2026
Merged

dan-petty merged 3 commits into
mainfrom
fix/2449-devcontainer-venv-path

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

In the devcontainer of this repository, devops on PATH was the copy of the package that the image installed when it was built. .devcontainer/Dockerfile installs src/ into the system site-packages, /usr/local/bin/devops runs that copy, and .devcontainer/devcontainer.json set no PATH. A terminal where the .venv was not active ran the code of the commit that built the image, so commands that merged after the image build failed or behaved as before.

.devcontainer/devcontainer.json now sets remoteEnv.PATH to ${containerWorkspaceFolder}/.venv/bin:${containerEnv:PATH}. Terminals, tasks, devcontainer exec and the lifecycle commands find .venv/bin/devops, the editable install of the checkout, before the copy of the image. A merge needs no image rebuild.

The image keeps its dependency layer and its system install of the package. These consumers need that copy:

  • Child repositories that use ghcr.io/dan-petty/devops-cli/devcontainer. The scaffold of devops devcontainer init --published runs devops devcontainer post-create and post-start from the image.
  • .github/actions/devcontainer-smoke, which runs devops --version in the image for the DevContainer Image check and the release.
  • The first post-create of this repository, which runs before uv sync fills the .venv volume.

.devcontainer/image/devcontainer.json sets no remoteEnv, so the published image does not change. No workflow job runs in the image, so CI on a GitHub runner does not change.

The new invariant test tests/invariants/test_devcontainer_config.py parses both configurations and holds the two values, so the copy of the image cannot become the devops of a terminal again. A comment in the Dockerfile and step 2 of the README quick start tell which devops runs where.

Closes #2449

Change: openspec/changes/archive/2026-10-28-2449-devcontainer-venv-path/

…tainer PATH

The new invariant test fails: .devcontainer/devcontainer.json sets no remoteEnv, so a terminal runs the copy of devops that the image built.

Refs #2449
…iner PATH

remoteEnv.PATH makes devops in a devcontainer terminal and lifecycle command the editable install of the checkout. The image keeps its copy for child repositories and for the first post-create.

Refs #2449
@dan-petty

Copy link
Copy Markdown
Owner Author

Fail-to-pass evidence: the Fail-to-Pass Check run replays the new test on the base tree. It reports 1 failed on base (1 failed and 0 passed in tests/invariants/test_devcontainer_config.py; 0 errored). On the base, .devcontainer/devcontainer.json has no remoteEnv: assert (None, None) == ({'PATH': '${...PATH}'}, None).

Local checks before the push: uv run devops ci test tests/test_swallowed_failures_ratchet.py tests/test_architectural_invariants.py tests/invariants/ tests/test_devcontainer.py tests/test_workflow_contracts.py tests/test_third_party_telemetry.py tests/test_context_budget.py (270 passed), uv run mypy src (no issues), and uv run devops ci devcontainer (manifest valid).

Pending a person: rebuild or reopen the devcontainer, open a new terminal, and check that command -v devops gives <workspace>/.venv/bin/devops and that devops --version equals uv run devops --version.

@dan-petty
dan-petty marked this pull request as ready for review October 28, 2026 17:11
@dan-petty
dan-petty merged commit abd2d41 into main Oct 28, 2026
16 checks passed
@dan-petty
dan-petty deleted the fix/2449-devcontainer-venv-path branch October 28, 2026 17:11
dan-petty pushed a commit that referenced this pull request Oct 28, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.10.0](v0.9.0...v0.10.0)
(2026-10-28)


### Features

* **review:** devops review intake hands the findings of a session on
merged code to roadmap intake
([#2455](#2455))
([a5c7b82](a5c7b82))
* **security:** devops k8s audit runs Popeye in the tool sandbox with a
kube-api network profile that only reads the API server
([#2467](#2467))
([e02c3fb](e02c3fb))
* **security:** the App's installation tokens carry only the permissions
the roadmap jobs use
([#2482](#2482))
([9599ef2](9599ef2)),
closes [#2473](#2473)


### Bug Fixes

* **config:** a config file that is not valid YAML stops the load with
an error that quotes none of its text
([#2468](#2468))
([91fe5dc](91fe5dc))
* **config:** config set reports an unknown key as unknown, not as a key
that needs a value
([#2465](#2465))
([8b650a6](8b650a6))
* **devcontainer:** run the checkout's devops in devcontainer terminals
([#2460](#2460))
([abd2d41](abd2d41))
* **k8s:** loki runs from the grafana-community chart on loki 3.7.9, out
of reach of CVE-2026-21729
([#2470](#2470))
([96c50c9](96c50c9))
* **security:** a credential keyword at the end of a line no longer
masks the first word of the next line
([#2461](#2461))
([b754a73](b754a73))
* **security:** a credential value is masked also when the next line
starts with a parenthesis
([#2477](#2477))
([ece25ca](ece25ca)),
closes [#2471](#2471)
* **security:** pin kubeconform and replace Checkov with Trivy's
misconfiguration scan
([#2464](#2464))
([960e357](960e357))
* **security:** refuse GCONV_PATH, SHELLOPTS, BASHOPTS and PS4 from a
caller, and archive the merged security changes
([#2453](#2453))
([1f9231d](1f9231d))


### Code Refactoring

* **ai:** chat_structured is the one structured-output path
([#2452](#2452))
([3509732](3509732))
* **github:** pr check-readiness reads one merge-readiness verdict from
github/ ([#2456](#2456))
([16442c4](16442c4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.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.

fix(devcontainer): the devops on PATH is the editable install of the checkout, not a copy the image built

1 participant