Skip to content

Promote Develop: Start the Devcontainer Snippets With Read-Only Mounts - #3870

Merged
ptr727 merged 2 commits into
mainfrom
develop
Nov 4, 2026
Merged

ptr727 merged 2 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Summary

Promotes #3866 and #3868 to main.

Closes #3858.
Closes #3860.

Each snippet was started with post-create on a Windows host's Docker Desktop, from a scratch tree and a synthetic home. Each feature pull request's body holds that measurement.

ptr727/ESPHome-Config carries the Python snippet with both defects, and stays as it is until a resync reaches it.

🤖 Generated with Claude Code

Part of #3858.

## Why

Neither catalog devcontainer snippet starts.

- `python:1-3.14-bookworm` is absent from the registry, and major 1 of
that image holds no Python 3.14 tag at all. The issue reads as a tag
that disappeared, but the registry shows no sign this one ever existed.
- `dotnet:1-10.0` still exists, but its `common-utils` feature build
fails on the image's yarn apt source.

## What Changed

- The Python snippet moves to `python:3-3.14-bookworm` and the .NET
snippet to `dotnet:2-10.0`.
- `docs/devcontainer.md` updates its table and states how the tags stay
current.

**How the tags stay current:** by hand, with the reason stated in the
doc. Dependabot's `devcontainers` ecosystem updates Features. GitHub's
supported-ecosystems page and containers.dev describe no `image` update,
and the `docker` ecosystem's documented scope does not name
`devcontainer.json`. So a Dependabot entry would not have moved these
tags. Each tag floats within its image major, so it takes that major's
updates without an edit.

## Verification

Each snippet ran through `devcontainer up` with post-create, using the
Dev Containers extension's bundled CLI (0.469.0) on Docker Desktop's
WSL2 backend. Each ran from a scratch tree holding the definition under
`.devcontainer/<language>/`, against a synthetic home, after a `docker
pull` and with `--build-no-cache`.

| Image | Result | Post-create |
| --- | --- | --- |
| `dotnet:1-10.0` | exit 1, `NO_PUBKEY` on `dl.yarnpkg.com`, which
confirms the issue's cached result on a fresh pull | not reached |
| `dotnet:2-10.0` | exit 0, .NET SDK 10.0.403 | `dotnet tool restore`
restored a synthetic manifest naming CSharpier |
| `python:3-3.14-bookworm` | exit 0, Python 3.14.10 on Debian bookworm |
uv 0.11.8 installed, `uv sync --frozen` ran on a synthetic project |

The prose gate passes over the diff. The full test suite was not run,
since no tracked file other than these three names the old tags and the
change touches no code.

## Not in This Change

- #3860, the read-only mounts, follows in its own pull request. Both
runs above still report `RW=true` on the mounts that issue covers.
- `ptr727/ESPHome-Config` carries the Python snippet with the old tag,
so its copy fails until a resync reaches it.

## Pre-existing findings, not filed

- `catalog/snippets/configs/dependabot.yml:16` (`pre-existing`): the
code-shipping reference config has no `devcontainers` pair, while the
audit reports drift for a repository holding `.devcontainer/` with that
ecosystem undeclared. A repository copying the reference learns this
from the audit, whose finding names the fix.

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

Part of #3860.

## Why

Each catalog devcontainer snippet declared its public key and
`allowed_signers` mounts in the object form with `"readonly": true`. The
Dev Containers CLI drops that key, so both host files were writable from
inside the container. `allowed_signers` is the file `git verify-commit`
and `git log --show-signature` trust, so a process in the container
could add a signer that outlives the container. `docs/devcontainer.md`
called both mounts read-only.

## What Changed

- Each snippet declares its mounts in the string form, the route the
[Dev Container metadata
reference](https://containers.dev/implementors/json_reference/)
documents as taking the same values as Docker's `--mount` flag. The `gh`
config mount moves with them, so the list holds one form, and it stays
read-write.
- `docs/devcontainer.md` states why the string form is used, so a later
tidy does not restore the object form. Its mode table was already what
the mounts should do, and now matches what they do.

## Verification

Each snippet ran through `devcontainer up` with post-create, using the
Dev Containers extension's bundled CLI (0.469.0) on Docker Desktop's
WSL2 backend, from a scratch tree and a synthetic home.

| Check | Before, on #3866's images | After, Python | After, .NET |
| --- | --- | --- | --- |
| `id_ed25519.pub` in `docker inspect` | `RW=true` | `RW=false` |
`RW=false` |
| `allowed_signers` in `docker inspect` | `RW=true` | `RW=false` |
`RW=false` |
| `.config/gh` in `docker inspect` | `RW=true` | `RW=true` | `RW=true` |
| Append to each read-only file as `vscode` | not run here, the issue
measured it succeeding | refused | refused |
| Create and remove a file in `.config/gh` | not run | works | works |
| Lines in the host's files afterward | not run | unchanged | unchanged
|

`up` exited 0 for each snippet, so the read-only mounts break neither
the feature build nor post-create. The full test suite was not run,
since no test parses these mounts and the change touches no code.

**Not measured:** a commit signed and verified in the container with
these mounts. The synthetic home holds no real key, so this probe shows
the signers file is readable at its path and refuses a write, and stops
there.

## Not in This Change

- `ptr727/ESPHome-Config` carries the Python snippet's old mount lines,
so its host files stay writable until a resync reaches it.
- #1763 touches the same `mounts` lines and rebases over this.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Copilot AI lite review requested due to automatic review settings November 4, 2026 17:50
@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • 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

Copilot AI 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.

🟢 Approval recommended

The reviewed image-tag, read-only mount, and documentation updates have no remaining active issues identified.

No open issues 🎉

What changed in this PR

This pull request promotes Dev Container snippet fixes to main, updating image tags and making signing-related mounts read-only.

Changes:

  • Updates the Python and .NET image tags.
  • Converts mount definitions to read-only string-form mounts where appropriate.
  • Documents image tag maintenance and mount behavior.
  • Notes that the scratch-tree instructions should include each language snippet’s post-create.sh script and satisfy the prose-length gate.

This pull request is ready to be approved.

File Description
docs/​devcontainer.md Documents updated images, manual tag maintenance, and mount syntax; its scratch-tree instructions need to include the accompanying post-create script.
catalog/​snippets/​devcontainer/​python/​devcontainer.json Updates the Python image and applies read-only bind mounts for host trust files.
catalog/​snippets/​devcontainer/​dotnet/​devcontainer.json Updates the .NET image and applies read-only bind mounts for host trust files.

Review effort: Lite

@codecov

codecov Bot commented Nov 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.31%. Comparing base (87c05af) to head (fcb0af5).
⚠️ Report is 466 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3870   +/-   ##
=======================================
  Coverage   83.31%   83.31%           
=======================================
  Files          29       29           
  Lines        9956     9956           
=======================================
  Hits         8295     8295           
  Misses       1661     1661           
Flag Coverage Δ
python-3.13 83.31% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727
ptr727 merged commit 94dedd4 into main Nov 4, 2026
14 checks passed
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.

Make the Devcontainer Snippets' Read-Only Mounts Actually Read-Only Repoint the Devcontainer Snippets at Images That Start

2 participants