From cb64d1ac6429f3e8ab7bb53c64b02acd56e38059 Mon Sep 17 00:00:00 2001 From: junkfactory <2998269+junkfactory@users.noreply.github.com> Date: Sun, 13 Sep 2026 00:48:28 -0700 Subject: [PATCH] fix(ci): describe the release commit before committing the version bump On the v1.0.0 cut, tag.sh ran 'jj commit' with an empty working copy: jj auto-created a fresh commit and the version bump stayed in the parent, leaving the tagged commit undescribed. Describe the empty @ first when it has no description, so 'jj commit' folds the bump into a properly-described 'chore: release vX.Y.Z' commit. --- .github/ci/tag.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/ci/tag.sh b/.github/ci/tag.sh index 34b46fc..c12d26d 100755 --- a/.github/ci/tag.sh +++ b/.github/ci/tag.sh @@ -40,14 +40,31 @@ npx vitest run # version it names. npm bumps package.json + package-lock.json without # touching VCS; the bump is committed on main as `chore: release vX.Y.Z` # and the tag points at that commit. +# +# Empty-WC handling: after a `jj new main` the working copy is an empty +# commit on top of main. `jj commit` on it would auto-create a new +# undescribed commit and leave the bump in the parent (seen on v1.0.0: +# the tag pointed at a descriptionless commit). Instead, describe the +# empty @ FIRST, then `jj commit` folds the bump into that described +# commit — the tag lands on a properly-described release commit. if [[ -n "${DRY_RUN:-}" ]]; then echo "DRY_RUN: npm version $VERSION --no-git-tag-version" - echo "DRY_RUN: jj commit -m 'chore: release $TAG'" + echo "DRY_RUN: jj describe -m 'chore: release $TAG' # if @ is empty" + echo "DRY_RUN: jj commit -m 'chore: release $TAG' # if @ has changes" echo "DRY_RUN: jj bookmark set main -r @" echo "DRY_RUN: jj tag set $TAG -r @" echo "DRY_RUN: jj git push --bookmark main --tag $TAG" else npm version "$VERSION" --no-git-tag-version + if [[ "$(jj status)" == *"working copy has no changes"* ]]; then + # Can't happen right after npm version, but guards re-runs. + jj describe -m "chore: release $TAG" + fi + # @ is non-empty (the bump): describe it first if it's the empty + # scaffold commit, then fold the bump into it. + if [[ "$(jj log -r @ --no-pager -T 'description')" == "" ]]; then + jj describe -m "chore: release $TAG" + fi jj commit -m "chore: release $TAG" jj bookmark set main -r @ jj tag set "$TAG" -r @