fix(release): version bumps now own the tracked .githooks markers
The v1.2.0 bump (fa3d8cc5c) reddened main: the tracked .githooks/* managed
sections embed the binary Version in their BEGIN/END markers, and
TestTrackedManagedHookSectionsMatchGenerator (added with the sections in
#5522) holds them byte-equal to the cmd/bd/hooks.go generator — but
update-versions.sh's hook step was a stale comment saying there were no
hook files to update (true of the old cmd/bd/templates/hooks/*, not of the
tracked rendered copies). update-versions.sh now rewrites the marker
version wholesale (not from CURRENT_VERSION — the markers were already
drifted at v1.1.0 when the 1.2.0 bump ran), and check-versions.sh gates
the markers so a bump that skips them is refused before the push instead
of reddening main after it.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
8a01f31a30
commit
ce20a64bb4
2 changed files with 35 additions and 6 deletions
|
|
@ -87,9 +87,25 @@ if command -v uv >/dev/null 2>&1; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# Hook templates are now generated dynamically by cmd/bd/hooks.go using the
|
||||
# Version constant from version.go, so no separate file check is needed.
|
||||
# (Previously checked cmd/bd/templates/hooks/pre-commit which no longer exists.)
|
||||
# Tracked managed git-hook sections (.githooks/*): the BEGIN/END markers embed
|
||||
# the binary Version, and TestTrackedManagedHookSectionsMatchGenerator holds
|
||||
# them equal to the cmd/bd/hooks.go generator output. A version bump that skips
|
||||
# them reddens main only after the push (that was the v1.2.0 bump), so gate the
|
||||
# markers here. Marker version only — full body equality stays the test's job.
|
||||
for hook in .githooks/*; do
|
||||
[ -f "$hook" ] || continue
|
||||
for prefix in "BEGIN" "END"; do
|
||||
marker=$(grep -oE -- "--- $prefix BEADS INTEGRATION v[^ ]+ ---" "$hook" | head -1)
|
||||
if [ -z "$marker" ]; then
|
||||
echo -e "${RED}❌ $hook: no '$prefix BEADS INTEGRATION' marker found${NC}"
|
||||
MISMATCH=1
|
||||
continue
|
||||
fi
|
||||
check_version "$hook" \
|
||||
"$(printf '%s' "$marker" | sed -E 's/.* v([^ ]+) ---/\1/')" \
|
||||
"$hook $prefix marker"
|
||||
done
|
||||
done
|
||||
|
||||
echo ""
|
||||
|
||||
|
|
|
|||
|
|
@ -137,9 +137,22 @@ update_file "README.md" "Alpha (v$CURRENT_VERSION)" "Alpha (v$NEW_VERSION)"
|
|||
echo " • default.nix"
|
||||
update_file "default.nix" "version = \"$CURRENT_VERSION\";" "version = \"$NEW_VERSION\";"
|
||||
|
||||
# 7. Hook templates — now generated dynamically by cmd/bd/hooks.go using the
|
||||
# Version constant from version.go. No template files to update.
|
||||
# (Previously updated cmd/bd/templates/hooks/* which no longer exist.)
|
||||
# 7. Tracked managed git-hook sections. The hooks a fresh `bd init` installs
|
||||
# are generated dynamically by cmd/bd/hooks.go, but this repo also TRACKS
|
||||
# rendered copies in .githooks/, whose BEGIN/END markers embed the binary
|
||||
# Version (hookSectionBeginLine), and TestTrackedManagedHookSectionsMatchGenerator
|
||||
# holds them byte-equal to the generator's output. Rewrite the marker version
|
||||
# wholesale rather than from CURRENT_VERSION — the v1.2.0 bump proved the
|
||||
# markers can already be drifted when the bump runs (they still said v1.1.0).
|
||||
echo " • .githooks/* managed section markers"
|
||||
for hook in .githooks/*; do
|
||||
[ -f "$hook" ] || continue
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
sed -i '' -E "s#(--- (BEGIN|END) BEADS INTEGRATION) v[^ ]+ ---#\1 v$NEW_VERSION ---#g" "$hook"
|
||||
else
|
||||
sed -i -E "s#(--- (BEGIN|END) BEADS INTEGRATION) v[^ ]+ ---#\1 v$NEW_VERSION ---#g" "$hook"
|
||||
fi
|
||||
done
|
||||
|
||||
# 8. Windows PE resource metadata
|
||||
echo " • cmd/bd/winres/winres.json"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue