Automate manifest.json version updates during release #9

Merged
deluan merged 6 commits from claude/automate-manifest-versioning-MJ9WM into main 2026-02-07 18:17:09 -07:00
Showing only changes of commit 32b623f59d - Show all commits
+3 -10
View File
@@ -16,15 +16,8 @@ package: build
clean:
rm -f $(WASM_FILE) $(PLUGIN_NAME).ndp
release: test
release:
gemini-code-assist[bot] commented 2026-02-07 15:50:48 -07:00 (Migrated from github.com)
Review

critical

The shell variable ${V} will not be expanded within single quotes. This will result in the literal string "${V}" being written to manifest.json instead of the version number. To fix this, you should use double quotes for the sed expression and escape the inner double quotes.

Additionally, sed -i behaves differently on GNU/Linux versus macOS/BSD systems. For better portability, you might consider a different approach in the future, but fixing the variable expansion is the critical part.

@sed -i "s/\"version\": *\"[^\"]*\"/\"version\": \"${V}\"/" manifest.json
![critical](https://www.gstatic.com/codereviewagent/critical.svg) The shell variable `${V}` will not be expanded within single quotes. This will result in the literal string `"${V}"` being written to `manifest.json` instead of the version number. To fix this, you should use double quotes for the `sed` expression and escape the inner double quotes. Additionally, `sed -i` behaves differently on GNU/Linux versus macOS/BSD systems. For better portability, you might consider a different approach in the future, but fixing the variable expansion is the critical part. ``` @sed -i "s/\"version\": *\"[^\"]*\"/\"version\": \"${V}\"/" manifest.json ```
copilot-pull-request-reviewer[bot] commented 2026-02-07 15:53:32 -07:00 (Migrated from github.com)
Review

git push origin main v${V} pushes the local main ref, but the release commit is created on the current checked-out branch. If the user runs make release from a branch other than main, the tag will point to the release commit but origin/main will not receive that commit (and could even push an outdated local main). Consider either enforcing/releases from main (fail if not on main and git pull --ff-only), or push HEAD:main alongside the tag so the commit you just made is what gets pushed.

`git push origin main v${V}` pushes the local `main` ref, but the release commit is created on the *current* checked-out branch. If the user runs `make release` from a branch other than `main`, the tag will point to the release commit but `origin/main` will not receive that commit (and could even push an outdated local `main`). Consider either enforcing/releases from `main` (fail if not on `main` and `git pull --ff-only`), or push `HEAD:main` alongside the tag so the commit you just made is what gets pushed.
copilot-pull-request-reviewer[bot] commented 2026-02-07 15:53:33 -07:00 (Migrated from github.com)
Review

The release recipe uses bash-only syntax ([[ ... ]] / =~) and GNU sed -i semantics. Since the Makefile doesn’t set SHELL := bash, this target can fail on systems where /bin/sh is dash (common on Ubuntu) or where sed -i requires a backup suffix (macOS/BSD). Consider setting SHELL := /usr/bin/env bash (or rewriting to POSIX sh) and using a portable in-place edit approach for manifest.json.

The `release` recipe uses bash-only syntax (`[[ ... ]]` / `=~`) and GNU `sed -i` semantics. Since the Makefile doesn’t set `SHELL := bash`, this target can fail on systems where `/bin/sh` is `dash` (common on Ubuntu) or where `sed -i` requires a backup suffix (macOS/BSD). Consider setting `SHELL := /usr/bin/env bash` (or rewriting to POSIX sh) and using a portable in-place edit approach for `manifest.json`.
@if [[ ! "${V}" =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$$ ]]; then echo "Usage: make release V=X.X.X"; exit 1; fi
go mod tidy
@if [ -n "`git status -s`" ]; then echo "\n\nThere are pending changes. Please commit or stash first"; exit 1; fi
@if [[ "$$(git branch --show-current)" != "main" ]]; then echo "Releases must be created from the main branch"; exit 1; fi
@# Update version in manifest.json
@sed -i 's/"version": *"[^"]*"/"version": "${V}"/' manifest.json
git add manifest.json
git commit -m "Release v${V}" --allow-empty --no-verify
git tag v${V}
git push origin main v${V} --no-verify
gh workflow run create-release.yml -f version=${V}
@echo "Release v${V} workflow triggered. Check progress: gh run list --workflow=create-release.yml"
.PHONY: release