Skip to content

feat(utility): add ddev utility addon-update-checker command#8373

Open
stasadev wants to merge 3 commits intoddev:mainfrom
stasadev:20260501_stasadev_addon-update-checker
Open

feat(utility): add ddev utility addon-update-checker command#8373
stasadev wants to merge 3 commits intoddev:mainfrom
stasadev:20260501_stasadev_addon-update-checker

Conversation

@stasadev
Copy link
Copy Markdown
Member

@stasadev stasadev commented May 1, 2026

The Issue

Running the DDEV add-on update checker requires remembering the command curl -fsSL https://ddev.com/s/addon-update-checker.sh | bash, which is impossible to recall without looking it up every time. On top of that, when maintaining multiple add-ons, you have to cd into each directory and run the command individually - there's no way to check all add-ons at once and then feed the combined output to an AI to fix everything in one go.

How This PR Solves The Issue

Adds ddev utility addon-update-checker, which fetches and runs the update checker script automatically:

  • If the target directory contains install.yaml, the checker runs there.
  • Otherwise it scans immediate subdirectories for install.yaml and runs the checker in each one - useful for workspaces with multiple add-ons.
  • Each run is clearly labeled with the directory, live output, and exit code (green for success, red for failure), with NO_COLOR support.
  • Falls back to the raw GitHub script URL if the primary URL is unavailable.
  • Uses util.FindBashPath() for cross-platform bash discovery.
  • Supports -d/--dir flag to target a specific directory or workspace.

The workspace scanning logic lives in the bash script itself (see ddev-addon-template#104), so it also works when running the script directly via curl. The Go command simply fetches the script and runs it once in the target directory.

Manual Testing Instructions

https://ddev--8373.org.readthedocs.build/en/8373/users/extend/creating-add-ons/#keeping-your-add-on-up-to-date
https://ddev--8373.org.readthedocs.build/en/8373/users/usage/commands/#utility-addon-update-checker

Run in a single add-on directory:

cd /path/to/my-addon   # must contain install.yaml
ddev utility addon-update-checker

Run across a workspace of add-ons:

ddev utility addon-update-checker -d /path/to/my-addons-workspace

Verify that a directory without install.yaml fails with a clear error:

ddev utility addon-update-checker -d /tmp

Automated Testing Overview

TestUtilityAddonUpdateCheckerCmd in utility-addon-update-checker_test.go covers three cases:

  • SingleAddon: directory with install.yaml — verifies the dir is reported in output.
  • MultipleAddons: workspace with two subdirs each containing install.yaml — verifies both are checked.
  • NoInstallYaml: empty directory — verifies the command fails with "No install.yaml found".

Release/Deployment Notes

New ddev utility addon-update-checker subcommand. No breaking changes. Documentation added to commands.md and creating-add-ons.md.

Update https://github.com/ddev/ddev-addon-template and https://ddev.com/blog/ddev-add-on-maintenance-guide/ after the next release.

@stasadev stasadev requested review from a team as code owners May 1, 2026 10:00
@stasadev stasadev changed the title feat(utility): add ddev utility addon-update-checker command feat(utility): add ddev utility addon-update-checker command May 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

@stasadev stasadev requested a review from tyler36 May 1, 2026 10:11
@rfay
Copy link
Copy Markdown
Member

rfay commented May 1, 2026

Pretty cool!

I doubt that it would belong in ddev utility or ddev/ddev in general if we had some better place for it. But we haven't thought of one!

@stasadev
Copy link
Copy Markdown
Member Author

stasadev commented May 1, 2026

FWIW, the test checks whether the update checker is actually working (i.e. available).

@stasadev
Copy link
Copy Markdown
Member Author

stasadev commented May 1, 2026

And having a dedicated command increases the chance that people actually use it.

I’ve caught myself doing this several times: I work on an add-on, think it would be good to check for updates, then realize I need to google the command to run, and end up telling myself, "No, I’ll do it later."

@stasadev
Copy link
Copy Markdown
Member Author

stasadev commented May 1, 2026

I've simplified the logic by moving the support for workspaces to the script itself.

Static validation fail is handled in #8375

stasadev and others added 3 commits May 1, 2026 18:51
## The Issue

Running the DDEV add-on update checker requires remembering the command
`curl -fsSL https://ddev.com/s/addon-update-checker.sh | bash`, which is
impossible to recall without looking it up every time. On top of that,
when maintaining multiple add-ons, you have to `cd` into each directory
and run the command individually — there's no way to check all add-ons
at once and then feed the combined output to an AI to fix everything in
one go.

## How This PR Solves The Issue

Adds `ddev utility addon-update-checker` (alias: `ddev ut addon-update-checker`),
which fetches and runs the update checker script automatically:

- If the target directory contains `install.yaml`, the checker runs there.
- Otherwise it scans immediate subdirectories for `install.yaml` and runs
  the checker in each one — useful for workspaces with multiple add-ons.
- Each run is clearly labelled with the directory, live output, and exit
  code (green for success, red for failure).
- Falls back to the raw GitHub script URL if the primary URL is unavailable.
- Uses `util.FindBashPath()` for cross-platform bash discovery.
- Supports `-d`/`--dir` flag to target a specific directory or workspace.

## Manual Testing Instructions

Run in a single add-on directory:

```shell
cd /path/to/my-addon   # must contain install.yaml
ddev utility addon-update-checker
```

Run across a workspace of add-ons:

```shell
ddev utility addon-update-checker -d /path/to/my-addons-workspace
```

Verify that a directory without `install.yaml` fails with a clear error:

```shell
ddev utility addon-update-checker -d /tmp
```

## Automated Testing Overview

`TestUtilityAddonUpdateCheckerCmd` in `utility-addon-update-checker_test.go`
covers three cases:

- `SingleAddon`: directory with `install.yaml` — verifies the dir is
  reported and an exit code is printed.
- `MultipleAddons`: workspace with two subdirs each containing
  `install.yaml` — verifies both are checked and two exit codes appear.
- `NoInstallYaml`: empty directory — verifies the command fails with
  "No install.yaml found".

## Release/Deployment Notes

New `ddev utility addon-update-checker` subcommand. No breaking changes.
Documentation added to `commands.md` and `creating-add-ons.md`.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@stasadev stasadev force-pushed the 20260501_stasadev_addon-update-checker branch from 9e5011b to c845a0f Compare May 1, 2026 15:51
Copy link
Copy Markdown
Collaborator

@tyler36 tyler36 left a comment

Choose a reason for hiding this comment

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

Works well. This is great!

Confirmed:

  • ✅ inside addon directory
  • ✅ inside parent directory containing multiple addon folders

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants