Skip to content

fix(dockerfile): resolve nvm release without GitHub API, show curl errors, fixes #6 - #7

Merged
stasadev merged 1 commit into
mainfrom
20261016_stasadev_nvm_no_github_api
Oct 16, 2026
Merged

stasadev merged 1 commit into
mainfrom
20261016_stasadev_nvm_no_github_api

Conversation

@stasadev

Copy link
Copy Markdown
Member

Short Summary (TL;DR)

Get the latest nvm tag from the releases/latest redirect instead of the rate-limited GitHub API, and stop hiding curl errors during the build.

The Issue

The build used api.github.com (60 unauthenticated requests/hour per IP) to find the latest nvm tag. When the limit was hit, curl --silent hid the 403 and the build failed with only exit code 22.

How This PR Solves The Issue

  • Read the tag from the https://github.com/nvm-sh/nvm/releases/latest redirect, which is not API rate-limited
  • Check that the tag looks like vX.Y.Z and fail with a clear message otherwise
  • Use curl -fsS --retry 3 so HTTP errors are printed
  • Download install.sh to a file before running it, so a failed download doesn't pipe a partial script into bash

Manual Testing Instructions

ddev add-on get ddev/ddev-nvm --pr 7
ddev restart
ddev nvm --version

Automated Testing Overview

No new tests, the existing tests cover the build.

Release/Deployment Notes

None.

…rors

## Short Summary (TL;DR)

Get the latest nvm tag from the `releases/latest` redirect instead of the rate-limited GitHub API, and stop hiding curl errors during the build.

## The Issue

- Fixes #6

The build used `api.github.com` (60 unauthenticated requests/hour per IP) to find the latest nvm tag. When the limit was hit, `curl --silent` hid the 403 and the build failed with only exit code 22.

## How This PR Solves The Issue

- Read the tag from the `https://github.com/nvm-sh/nvm/releases/latest` redirect, which is not API rate-limited
- Check that the tag looks like `vX.Y.Z` and fail with a clear message otherwise
- Use `curl -fsS --retry 3` so HTTP errors are printed
- Download `install.sh` to a file before running it, so a failed download doesn't pipe a partial script into bash

## Manual Testing Instructions

```bash
ddev add-on get ddev/ddev-nvm --pr 7
ddev restart
ddev nvm --version
```

## Automated Testing Overview

No new tests, the existing tests cover the build.

## Release/Deployment Notes

None.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@stasadev
stasadev merged commit 16332ab into main Oct 16, 2026
4 checks passed
@stasadev
stasadev deleted the 20261016_stasadev_nvm_no_github_api branch October 16, 2026 10:07
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.

Adding this add-on causes failures on ddev restart

1 participant