Skip to content

#362 Install the latest starship with its install script in the devcontainers - #371

Merged
TheAngryByrd merged 2 commits into
masterfrom
agent/i362-devcontainer-starship
Nov 22, 2026
Merged

TheAngryByrd merged 2 commits into
masterfrom
agent/i362-devcontainer-starship

Conversation

@TheAngryByrd

@TheAngryByrd TheAngryByrd commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Fixes #362

TL;DR: The devcontainers install the latest starship with the official install script instead of the devcontainers-extra starship 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):

  1. #362 Install the latest starship ... is the change. Start with .devcontainer/Dockerfile and .devcontainer/devcontainer.json. The Content/Library and Content/Console copies are identical files. Then read the one-line check in build.yml and the lode notes in lode/ci/action-versions.md.
  2. #362 Guard the devcontainers ... adds DevcontainerPolicyTests.fs and its lode entry.

Proposed Changes

The devcontainer CI jobs failed from time to time:

urllib.error.HTTPError: HTTP Error 403: rate limit exceeded
ERROR: Feature "Starship (via Github Releases)" (ghcr.io/devcontainers-extra/features/starship) failed to install!

The ghcr.io/devcontainers-extra/features/starship feature installs through the gh-release feature and nanolayer. For every version, nanolayer reads https://api.github.com/repos/starship/starship/releases/tags/<tag> without a token to find the asset (it resolves latest from git tags first). The feature has no token option. Both failed jobs stopped at that releases/tags call. 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:

 .devcontainer/Dockerfile (same in Content/Library and Content/Console)
+RUN curl -sS https://starship.rs/install.sh | sh -s -- --yes && starship --version

 .devcontainer/devcontainer.json (same in Content/Library and Content/Console)
   "features": {
     "ghcr.io/devcontainers/features/common-utils:2": { ... },
     "ghcr.io/devcontainers/features/github-cli:1": {},
-    "ghcr.io/devcontainers-extra/features/starship:1": {},
     "ghcr.io/devcontainers/features/dotnet:2": { ... }
   },
   "overrideFeatureInstallOrder": [ ... without the starship feature ... ]

 build-template-devcontainer (build.yml)
   starship --version
+  test "$(command -v starship)" = "/usr/local/bin/starship"
  • The script supports --version, and the Dockerfile does 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 downloads https://github.com/starship/starship/releases/latest/download/starship-<target>.tar.gz and makes no api.github.com call (BASE_URL and URL in install.sh). The Docker build runs as root, so the script writes to /usr/local/bin without sudo. --yes skips its prompt.
  • The latest release is the reason for this method: the maintainer wants each devcontainer to get the newest starship.
  • No other feature calls the GitHub REST API. common-utils uses apt and git. dotnet uses the .NET install script. github-cli 1.1.3 (the image that :1 resolves to) resolves the version with git ls-remote and downloads the .deb from GitHub Releases. If git ls-remote gives no version, its installer exits 1. Unreleased code on upstream main adds a REST API fallback.
  • onCreateCommand still adds eval "$(starship init zsh)" to ~/.zshrc. It runs as vscode after the features, so the prompt setup does not change.
  • && starship --version fails the image build when the install produced no starship, in all three devcontainers and in the generated repositories' own build-devcontainer jobs. Docker caches no failed layer.
  • The new check in build-template-devcontainer fails if another starship is in front of the script one.
  • New DevcontainerPolicyTests.fs: no non-comment line of a devcontainer.json names a starship feature, and each Dockerfile has the active install line. Controls: a revert to the feature fails it (root/.devcontainer/devcontainer.json should not use a starship feature), a commented # RUN line fails it, and a JSON comment that names the old feature passes it.
  • Lode: lode/ci/action-versions.md ("Starship in the devcontainers"), lode/ci/workflows.md, lode/tests/policy-tests.md, and lode/tests/summary.md.

Trade-offs

  • The script and the release are not pinned. Two uncached builds can get different starship versions, and a change of the script reaches the next uncached build.
  • The script extracts the archive with no checksum check. The curl calls set no timeout, and the download and extraction have no size limit. The script leaves its archive (about 5 MB) in /tmp of the image.
  • The RUN line is a pipe, and /bin/sh runs it without pipefail. When curl gets no script (for example a DNS failure), sh exits 0. An HTTP error body runs as a script and fails (2 for an HTML page, 127 for a plain-text body). && starship --version covers the exit-0 case.

Options that were not used

  • The feature with a fixed version: nanolayer still calls releases/tags/<tag>.
  • A token for the feature: neither the feature nor nanolayer accepts one.
  • The Debian package (apt-get install starship): trixie has 1.22.1, older than the latest release, and bookworm has no package.
  • An image cache (cacheFrom): the first build of each cache key still makes the API call.

Evidence

$ docker run --rm i371-script bash -c 'set -e; starship --version | head -1; command -v starship; test "$(command -v starship)" = "/usr/local/bin/starship" && echo path-check-pass'
starship 1.27.0
/usr/local/bin/starship
path-check-pass
  • The pipe risk, checked in the same image:
$ curl -sS https://starship.invalid/install.sh | sh -s -- --yes; echo "pipe exit=$?"
curl: (6) Could not resolve host: starship.invalid
pipe exit=0

# the same failure with the Dockerfile line, in a docker build
curl: (6) Could not resolve host: starship.invalid
/bin/sh: 1: starship: not found
ERROR: process "/bin/sh -c curl -sS https://starship.invalid/install.sh | sh -s -- --yes && starship --version" did not complete successfully: exit code: 127

At 9cb7f87, run 45050243775, attempt 2 built all three devcontainers with their features: build-devcontainer, build-template-devcontainer (Content/Library), and build-template-devcontainer (Content/Console) passed, with the /usr/local/bin/starship check. The DevcontainerPolicy test passed in the other partitions.

Explainer video

pr371-v2-web.mp4

Flaky test

  • Audit policy.Console Build CI=True transitive advisories failed in run 45050243775, attempt 1, job integration-tests (Debug, ubuntu-latest, other): expected: 1, actual: 0. Verdict: test defect on master, not caused by this PR. AdvisoryFeed reuses the URL http://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 change AuditPolicyTests.fs or any audit setting. Fix: Audit policy tests read cached advisory data when a feed port repeats #374.

What this PR does not change

  • The feature tags float (common-utils:2, github-cli:1, dotnet:2). A later feature version can add a GitHub API call, and no check looks for one.
  • No check keeps the three Dockerfiles and the three devcontainer.json files identical. They are identical now, as before this PR.
  • The gate job build does 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

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • Build and tests pass locally (Docker build of the devcontainer Dockerfile: starship version and path. The full devcontainer builds with features run in CI)
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

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

TheAngryByrd added a commit that referenced this pull request Nov 22, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TheAngryByrd
TheAngryByrd requested a balanced review from Copilot November 22, 2026 07:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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

Comment thread lode/ci/action-versions.md Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are identified for the change to install Starship from Debian packages.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are recorded for the switch to Debian-packaged Starship in the devcontainers.

No open issues 🎉

Review effort: Balanced

@TheAngryByrd
TheAngryByrd marked this pull request as ready for review November 22, 2026 09:46
@TheAngryByrd
TheAngryByrd force-pushed the agent/i362-devcontainer-starship branch from ed8999f to 82296c3 Compare November 22, 2026 14:24
TheAngryByrd added a commit that referenced this pull request Nov 22, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TheAngryByrd TheAngryByrd changed the title #362 Install starship from the Debian package in the devcontainers #362 Install the latest starship with its install script in the devcontainers Nov 22, 2026
@TheAngryByrd
TheAngryByrd force-pushed the agent/i362-devcontainer-starship branch from 2e32c09 to d74dcdf Compare November 22, 2026 15:45
TheAngryByrd added a commit that referenced this pull request Nov 22, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TheAngryByrd
TheAngryByrd force-pushed the agent/i362-devcontainer-starship branch from d74dcdf to fa86a0b Compare November 22, 2026 17:16
…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>
@TheAngryByrd
TheAngryByrd force-pushed the agent/i362-devcontainer-starship branch from fa86a0b to 9e24d50 Compare November 22, 2026 17:23
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>

@TheAngryByrd TheAngryByrd left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Reviewer notes for the key lines of this change.

Automated reviewer notes from Claude Code.

Comment thread .devcontainer/Dockerfile

# 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

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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 "//")

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues for the change replacing the Starship devcontainer feature with the official installer.

No open issues 🎉

Review effort: Balanced

@TheAngryByrd
TheAngryByrd merged commit a69a4a2 into master Nov 22, 2026
44 of 51 checks passed
@TheAngryByrd
TheAngryByrd deleted the agent/i362-devcontainer-starship branch November 22, 2026 19:59
TheAngryByrd added a commit to TheAngryByrd/IcedTasks that referenced this pull request Nov 23, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants