Repository navigation
#362 Install the latest starship with its install script in the devcontainers - #371
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The documentation overstates the removal of GitHub API dependencies, since github-cli defaults to GitHub release installation and can fall back to an unauthenticated API request.
1 open issue
What changed in this PR
This PR addresses #362 by installing Starship from Debian packages in the repository and generated-template devcontainers, removing Starship’s dependency on unauthenticated GitHub release API calls.
Changes:
- Install Starship with apt in all three Dockerfiles and clean up package lists.
- Remove the Starship feature and its install-order entries while preserving shell initialization.
- Document the installation approach, version tradeoff, and CI checks; add a changelog entry.
| File | Description |
|---|---|
lode/ci/workflows.md |
Clarifies the package source for Starship in template CI checks. |
lode/ci/action-versions.md |
Documents the installation strategy and version tradeoff. |
Content/Library/.devcontainer/Dockerfile |
Installs Starship from Debian for library templates. |
Content/Library/.devcontainer/devcontainer.json |
Removes the library template’s Starship feature. |
Content/Console/.devcontainer/Dockerfile |
Installs Starship from Debian for console templates. |
Content/Console/.devcontainer/devcontainer.json |
Removes the console template’s Starship feature. |
CHANGELOG.md |
Records the devcontainer installation fix. |
.devcontainer/Dockerfile |
Installs Starship from Debian for repository development. |
.devcontainer/devcontainer.json |
Removes the repository’s Starship feature. |
Review effort: Balanced
ed8999f to
82296c3
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2e32c09 to
d74dcdf
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d74dcdf to
fa86a0b
Compare
…ntainers The devcontainers-extra starship feature resolves the latest release with an unauthenticated api.github.com call, which fails with HTTP 403 when a shared runner is over the rate limit. The root, library, and console Dockerfiles now run the official starship install script, which downloads the latest release from github.com/starship/starship/releases and makes no GitHub API call. `&& starship --version` fails the image build when the pipe gets no script, because sh then exits 0. The devcontainer.json files drop the starship feature, and the template devcontainer job checks that starship runs from /usr/local/bin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fa86a0b to
9e24d50
Compare
DevcontainerPolicy fails when a non-comment line of a devcontainer.json names a starship feature, or when a Dockerfile has no active install line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9e24d50 to
9cb7f87
Compare
TheAngryByrd
left a comment
There was a problem hiding this comment.
Reviewer notes for the key lines of this change.
Automated reviewer notes from Claude Code.
|
|
||
| # The install script downloads the latest release from github.com/starship/starship/releases and makes no GitHub API call. | ||
| # The pipe exits 0 when curl gets no script, so starship --version fails the build instead. | ||
| RUN curl -sS https://starship.rs/install.sh | sh -s -- --yes && starship --version |
There was a problem hiding this comment.
Reviewer note: This is the core change. The script downloads the latest release from GitHub Releases and makes no api.github.com call. /bin/sh has no pipefail, so when curl gets no script the pipe exits 0. && starship --version then fails the layer with 127, and Docker caches no failed layer. The Content/Library and Content/Console Dockerfiles are byte-identical copies of this file.
| set -e | ||
| dotnet --info | ||
| starship --version | ||
| test "$(command -v starship)" = "/usr/local/bin/starship" |
There was a problem hiding this comment.
Reviewer note: The template devcontainer job builds an image with all features. This check fails if another starship on PATH comes before the one that the script installed.
| let featureLines = | ||
| lines root "devcontainer.json" | ||
| |> Array.filter (fun line -> | ||
| not (line.StartsWith "//") |
There was a problem hiding this comment.
Reviewer note: The test skips JSONC comment lines, so a comment can name the old feature. The Dockerfile check compares whole trimmed lines, so a commented # RUN line fails it. The PR body lists the three controls.
* Install starship with its install script in the dev container The devcontainers-extra starship feature resolves the latest release with an unauthenticated api.github.com call. On a shared runner over the rate limit it fails with HTTP 403, and the build-devcontainer job fails before any build step. The Dockerfile now runs the official starship install script, which downloads the latest release from github.com/starship/starship/releases and makes no GitHub API call. The devcontainer.json drops the feature, and the CI job checks that starship runs from /usr/local/bin. Same change as TheAngryByrd/MiniScaffold#371. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Stop the devcontainer job when the starship check fails Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Fixes #362
TL;DR: The devcontainers install the latest starship with the official install script instead of the
devcontainers-extrastarship feature. The feature called the GitHub API without a token and failed with HTTP 403 on shared runners. The script downloads from GitHub Releases and makes no API call.How to review (2 commits):
#362 Install the latest starship ...is the change. Start with.devcontainer/Dockerfileand.devcontainer/devcontainer.json. TheContent/LibraryandContent/Consolecopies are identical files. Then read the one-line check inbuild.ymland the lode notes inlode/ci/action-versions.md.#362 Guard the devcontainers ...addsDevcontainerPolicyTests.fsand its lode entry.Proposed Changes
The devcontainer CI jobs failed from time to time:
The
ghcr.io/devcontainers-extra/features/starshipfeature installs through thegh-releasefeature and nanolayer. For every version, nanolayer readshttps://api.github.com/repos/starship/starship/releases/tags/<tag>without a token to find the asset (it resolveslatestfrom git tags first). The feature has no token option. Both failed jobs stopped at thatreleases/tagscall. A GitHub-hosted runner shares the unauthenticated rate limit, so the call fails when the limit is used up.The devcontainers now install the latest starship with the official install script:
--version, and theDockerfiledoes not pass it, so a build that runs this layer gets the latest release. A fresh CI runner starts with no layer cache. A second build in the same job, or a local rebuild, can reuse the cached layer. It downloadshttps://github.com/starship/starship/releases/latest/download/starship-<target>.tar.gzand makes noapi.github.comcall (BASE_URLandURLininstall.sh). The Docker build runs as root, so the script writes to/usr/local/binwithoutsudo.--yesskips its prompt.common-utilsuses apt and git.dotnetuses the .NET install script.github-cli1.1.3 (the image that:1resolves to) resolves the version withgit ls-remoteand downloads the.debfrom GitHub Releases. Ifgit ls-remotegives no version, its installer exits 1. Unreleased code on upstreammainadds a REST API fallback.onCreateCommandstill addseval "$(starship init zsh)"to~/.zshrc. It runs asvscodeafter the features, so the prompt setup does not change.&& starship --versionfails the image build when the install produced no starship, in all three devcontainers and in the generated repositories' ownbuild-devcontainerjobs. Docker caches no failed layer.build-template-devcontainerfails if another starship is in front of the script one.DevcontainerPolicyTests.fs: no non-comment line of adevcontainer.jsonnames a starship feature, and eachDockerfilehas the active install line. Controls: a revert to the feature fails it (root/.devcontainer/devcontainer.json should not use a starship feature), a commented# RUNline fails it, and a JSON comment that names the old feature passes it.lode/ci/action-versions.md("Starship in the devcontainers"),lode/ci/workflows.md,lode/tests/policy-tests.md, andlode/tests/summary.md.Trade-offs
/tmpof the image.RUNline is a pipe, and/bin/shruns it withoutpipefail. When curl gets no script (for example a DNS failure),shexits 0. An HTTP error body runs as a script and fails (2 for an HTML page, 127 for a plain-text body).&& starship --versioncovers the exit-0 case.Options that were not used
releases/tags/<tag>.apt-get install starship): trixie has 1.22.1, older than the latest release, and bookworm has no package.cacheFrom): the first build of each cache key still makes the API call.Evidence
build-template-devcontainer (Content/Console):HTTP Error 403: rate limit exceededin the starship feature.docker build --no-cacheofContent/Library/.devcontainer/Dockerfile:At
9cb7f87, run 45050243775, attempt 2 built all three devcontainers with their features:build-devcontainer,build-template-devcontainer (Content/Library), andbuild-template-devcontainer (Content/Console)passed, with the/usr/local/bin/starshipcheck. TheDevcontainerPolicytest passed in theotherpartitions.Explainer video
pr371-v2-web.mp4
Flaky test
Audit policy.Console Build CI=True transitive advisoriesfailed in run 45050243775, attempt 1, jobintegration-tests (Debug, ubuntu-latest, other):expected: 1,actual: 0. Verdict: test defect on master, not caused by this PR.AdvisoryFeedreuses the URLhttp://127.0.0.1:<port>/index.json, and NuGet reads cached advisory data when a port repeats. A local repro with a fixed port fails the same way, and a unique feed path passes. This PR does not changeAuditPolicyTests.fsor any audit setting. Fix: Audit policy tests read cached advisory data when a feed port repeats #374.What this PR does not change
common-utils:2,github-cli:1,dotnet:2). A later feature version can add a GitHub API call, and no check looks for one.Dockerfiles and the threedevcontainer.jsonfiles identical. They are identical now, as before this PR.builddoes not depend on the devcontainer jobs, so this failure never blocked a required check. It made the PR checks red and needed a rerun.Types of changes
Checklist
Dockerfile: starship version and path. The full devcontainer builds with features run in CI)Merge Danger
Door: two-way. A revert restores the feature.
Blast Radius: devcontainers of this repository and of new generated repositories. Each uncached image build downloads and runs the current install script and the latest release.
🤖 Generated with Claude Code