Skip to content

fix: download head builds with ddev utility download-ddev, for #58 - #65

Merged
rfay merged 2 commits into
mainfrom
20261122_rfay_head_download_ddev
Nov 25, 2026
Merged

rfay merged 2 commits into
mainfrom
20261122_rfay_head_download_ddev

Conversation

@rfay

@rfay rfay commented Nov 22, 2026

Copy link
Copy Markdown
Member

Short Summary (TL;DR)

version: head now installs stable DDEV, then replaces it with the main build that ddev utility download-ddev --head downloads from GitHub. Before, every head install depended on nightly.link, which fails intermittently.

The Issue

The head jobs in this repository's nightly tests fail every few weeks in the "Install DDEV" step. install_ddev_head.sh downloads https://nightly.link/ddev/ddev/workflows/main-build/main/ddev-linux-amd64.zip, and nightly.link returned an HTTP 404 or 500 while the artifact existed on GitHub:

Date Run Error
2026-11-22 44964784133 500 on two attempts, 2 hours apart
2026-10-02 36945282755 404 on amd64 only, arm64 passed
2026-09-28 36361796895 404
2026-09-23 35801261825 404

The same problem affects users who test against head. install_ddev_head.sh has no retry and no other source.

How This PR Solves The Issue

  • For head, the action runs the normal install script, which installs the latest stable release. Since v1.25.4, stable includes ddev utility download-ddev.
  • A new step runs ddev utility download-ddev --head. It finds the latest successful main-build run through the GitHub API, and downloads the artifact from GitHub. It uses nightly.link only when that fails.
  • The step overwrites the stable ddev and ddev-hostname in place, so the two binaries always match.
  • A new token input defaults to ${{ github.token }}, so users don't have to set anything. Without a token, download-ddev uses nightly.link to download.
  • ddev config global moves to its own step after the replacement, so it runs on the final binary.
  • head no longer swaps the install script for install_ddev_head.sh. A custom installScriptUrl now installs the stable base for head.
  • The steps pass inputs through env instead of putting ${{ inputs.* }} into the shell script.

Manual Testing Instructions

Run the tests workflow on this branch:

gh workflow run main.yml -R ddev/github-action-setup-ddev --ref 20261122_rfay_head_download_ddev

In the test (ubuntu-24.04, head) job, expand "Replace DDEV with the HEAD build". Expect Downloading ddev linux/amd64 from the latest main build..., with no nightly.link warning. Expect a version such as ddev version v1.25.6-1-g24cd0c83b. Check that the latest and 1.24.8 jobs don't run that step.

Automated Testing Overview

This repository's tests workflow covers head, latest and 1.24.8 on ubuntu-24.04 and ubuntu-24.04-arm. Claude Code ran ddev utility download-ddev --head locally on Linux amd64, without a token. It downloaded v1.25.6-1-g24cd0c83b. Claude Code ran the tests workflow on this branch (run 44979911977), and all six jobs passed. The head job installed v1.25.6-1-g24cd0c83b and logged no nightly.link fallback, so the workflow token downloaded the artifact from GitHub.

Release/Deployment Notes

A head install now downloads stable DDEV first. That adds a few seconds.

🤖 Developed with assistance from Claude Code

https://claude.ai/code/session_01UrTUMwauQvTgWac6bsCPsm


Generated by Claude Code

@rfay
rfay requested a review from stasadev November 22, 2026 03:32

@davereid davereid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

praise: Thanks, rfay. Looking up the build through the GitHub API with the workflow token gets around the nightly.link failures, and both head jobs in run 44979911977 downloaded from GitHub without falling back. Moving the inputs into env: also closes a script injection.

suggestion (non-blocking): The version input's description in action.yml still says only "Example: 1.24.0". Could it mention latest and head, as the README now does? The Marketplace and editors show that description.

suggestion (non-blocking): For head, the test in .github/workflows/main.yml only checks that the version isn't v1.24.8, so it would still pass if the replace step were skipped. Checking for the -g<sha> suffix would catch that. It could fail on the rare day main sits exactly on a release tag, so a follow-up is fine.

Drafted with Claude Code using project-triage. I had the PR checked against DDEV's source and the PR's CI logs, chose which findings to raise, and reviewed the final text.

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Works for me, two small things, neither blocking.

  1. +1 to davereid's suggestions. The version description in action.yml could mention latest and head. And the head test could check the -g<sha> suffix, so it fails if the replace step is skipped:
elif [[ ${{ matrix.version }} == 'head' ]]; then
  [[ "$(ddev --version)" =~ -g[0-9a-f]+$ ]]
  1. See the inline comment about the token input.

Claude Code ran stable v1.25.6 ddev utility download-ddev --head with no token, a valid token and an invalid token. All three downloaded the main build, the invalid token with a fallback to nightly.link.

🤖 Reviewed with assistance from Claude Code

Comment thread action.yml Outdated
required: true
default: 'https://ddev.com/install.sh'

token:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need this as an input? The step could set DDEV_GITHUB_TOKEN: ${{ github.token }} directly. The input only helps someone who wants to pass a PAT or blank the token, and it's one more input to support.

claude and others added 2 commits November 25, 2026 09:35
## Short Summary (TL;DR)

`version: head` now installs stable DDEV, then replaces it with the `main` build that `ddev utility download-ddev --head` downloads from GitHub. Before, every `head` install depended on nightly.link, which fails intermittently.

## The Issue

- For #58

The `head` jobs in this repository's nightly tests fail every few weeks in the "Install DDEV" step. `install_ddev_head.sh` downloads `https://nightly.link/ddev/ddev/workflows/main-build/main/ddev-linux-amd64.zip`, and nightly.link returned an HTTP 404 or 500 while the artifact existed on GitHub:

| Date | Run | Error |
| --- | --- | --- |
| 2026-11-22 | [44964784133](https://github.com/ddev/github-action-setup-ddev/actions/runs/44964784133) | 500 on two attempts, 2 hours apart |
| 2026-10-02 | [36945282755](https://github.com/ddev/github-action-setup-ddev/actions/runs/36945282755) | 404 on amd64 only, arm64 passed |
| 2026-09-28 | [36361796895](https://github.com/ddev/github-action-setup-ddev/actions/runs/36361796895) | 404 |
| 2026-09-23 | [35801261825](https://github.com/ddev/github-action-setup-ddev/actions/runs/35801261825) | 404 |

The same problem affects users who test against `head`. `install_ddev_head.sh` has no retry and no other source.

## How This PR Solves The Issue

- For `head`, the action runs the normal install script, which installs the latest stable release. Since v1.25.4, stable includes `ddev utility download-ddev`.
- A new step runs `ddev utility download-ddev --head`. It finds the latest successful `main-build` run through the GitHub API, and downloads the artifact from GitHub. It uses nightly.link only when that fails.
- The step overwrites the stable `ddev` and `ddev-hostname` in place, so the two binaries always match.
- A new `token` input defaults to `${{ github.token }}`, so users don't have to set anything. Without a token, `download-ddev` uses nightly.link to download.
- `ddev config global` moves to its own step after the replacement, so it runs on the final binary.
- `head` no longer swaps the install script for `install_ddev_head.sh`. A custom `installScriptUrl` now installs the stable base for `head`.
- The steps pass inputs through `env` instead of putting `${{ inputs.* }}` into the shell script.

## Manual Testing Instructions

Run the `tests` workflow on this branch:

```bash
gh workflow run main.yml -R ddev/github-action-setup-ddev --ref 20261122_rfay_head_download_ddev
```

In the `test (ubuntu-24.04, head)` job, expand "Replace DDEV with the HEAD build". Expect `Downloading ddev linux/amd64 from the latest main build...`, with no nightly.link warning. Expect a version such as `ddev version v1.25.6-1-g24cd0c83b`. Check that the `latest` and `1.24.8` jobs don't run that step.

## Automated Testing Overview

This repository's `tests` workflow covers `head`, `latest` and `1.24.8` on `ubuntu-24.04` and `ubuntu-24.04-arm`. Claude Code ran `ddev utility download-ddev --head` locally on Linux amd64, without a token. It downloaded `v1.25.6-1-g24cd0c83b`. Only CI can show that the workflow token downloads `ddev/ddev` artifacts from GitHub.

## Release/Deployment Notes

A `head` install now downloads stable DDEV first. That adds a few seconds.

🤖 Developed with assistance from [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UrTUMwauQvTgWac6bsCPsm
- Pass the workflow's own token to `ddev utility download-ddev`
  directly instead of through a new `token` input, so there is one
  less input to support.
- Mention `latest` and `head` in the `version` input's description.
- Check for the `-g<sha>` suffix in the `head` test, so it fails if the
  replace step is skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rfay
rfay force-pushed the 20261122_rfay_head_download_ddev branch from 4001e9f to fb10dfd Compare November 25, 2026 16:38
@rfay

rfay commented Nov 25, 2026

Copy link
Copy Markdown
Member Author

Did those things, thanks!

@stasadev
stasadev self-requested a review November 25, 2026 17:09
@rfay
rfay merged commit 798b95f into main Nov 25, 2026
8 checks passed
@rfay
rfay deleted the 20261122_rfay_head_download_ddev branch November 25, 2026 17:45
davereid added a commit to davereid/github-action-cache-ddev that referenced this pull request Nov 28, 2026
Updates the setup-ddev `main` pin, so the "Lint actions" job passes
again.

## Description

- `ci.yml`: pins `ddev/github-action-setup-ddev` to `798b95f # main`
instead of `222a22f`. setup-ddev's `main` moved on 2026-11-25, and
zizmor's online audit flags a `# main` comment on an older SHA.

## Links

- New setup-ddev commits: ddev/github-action-setup-ddev#64 and
ddev/github-action-setup-ddev#65 (`head` builds via `ddev utility
download-ddev`).

## Testing instructions

1. Check that the **CI** workflow's "Lint actions" job passes in this
PR's checks.
2. Check that the `cache-save` and `cache-restore` jobs for DDEV `head`
pass, since ddev/github-action-setup-ddev#65 changed how `head` is
downloaded.

## AI disclosure

Claude Code (Claude Opus) found why "Lint actions" failed on #15 and
updated the pin. I asked for the investigation and reviewed the change.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

4 participants