From 5c550e85872ecfd98158256c49c13f6789ec8b2a Mon Sep 17 00:00:00 2001 From: Jon Kazama Date: Tue, 12 May 2026 02:22:59 +0200 Subject: [PATCH] fix(scripts): adapt verify-changelog-sync to **vX.Y.Z** subblock format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit yaml.changelog and repo.json.Changelog now use **vX.Y.Z** subblock headers instead of the older **Hellion Chat X.Y.Z** form. Updated the three regex patterns (yaml check, repo.json check, version counter) and re-enabled Block C in preflight.sh — the SKIP workaround is no longer needed. --- scripts/preflight.sh | 4 ++-- scripts/verify-changelog-sync.sh | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/preflight.sh b/scripts/preflight.sh index 3f1f595..adc53bf 100755 --- a/scripts/preflight.sh +++ b/scripts/preflight.sh @@ -13,8 +13,8 @@ echo "==> preflight: Block A — version consistency" echo "==> preflight: Block B — manifest shape" ./scripts/verify-manifest-shape.sh -echo "==> preflight: Block C — changelog sync - SKIPPED (Changed HellionChat.yaml for better readability, but this is a non-code change and the changelog is already up to date with the previous version bump.TODO: Script fix)" -# ./scripts/verify-changelog-sync.sh +echo "==> preflight: Block C — changelog sync" +./scripts/verify-changelog-sync.sh echo "==> preflight: Block D — plugin compile health" dotnet build HellionChat/HellionChat.csproj --configuration Release --nologo --verbosity quiet diff --git a/scripts/verify-changelog-sync.sh b/scripts/verify-changelog-sync.sh index e8fadd8..012f12d 100755 --- a/scripts/verify-changelog-sync.sh +++ b/scripts/verify-changelog-sync.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # verify-changelog-sync.sh — Block C. # Strips .0 suffix from repo.json AssemblyVersion to derive the 3-digit tag/version. -# yaml.changelog is a single multi-line block with **Hellion Chat X.Y.Z** subblocks. +# yaml.changelog is a single multi-line block with **vX.Y.Z** subblocks. set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" @@ -16,11 +16,11 @@ ok() { echo "verify-changelog-sync: OK — $1"; } VER="$(jq -r '.[0].AssemblyVersion' "$REPO_JSON" | sed -E 's/\.0$//')" TAG="v$VER" -grep -qE "^[[:space:]]*\*\*Hellion Chat ${VER}" "$YAML" \ - || fail "$YAML changelog missing **Hellion Chat ${VER}** subblock. Fix: add the v${VER} block at the top of the changelog field." +grep -qE "^[[:space:]]*\*\*v${VER}[^0-9]" "$YAML" \ + || fail "$YAML changelog missing **v${VER}** subblock. Fix: add the v${VER} block at the top of the changelog field." -jq -r '.[0].Changelog' "$REPO_JSON" | grep -qE "^[[:space:]]*\*\*Hellion Chat ${VER}" \ - || fail "$REPO_JSON Changelog missing **Hellion Chat ${VER}** subblock. Fix: copy the yaml changelog over." +jq -r '.[0].Changelog' "$REPO_JSON" | grep -qE "^[[:space:]]*\*\*v${VER}[^0-9]" \ + || fail "$REPO_JSON Changelog missing **v${VER}** subblock. Fix: copy the yaml changelog over." FORGE_FILE="$FORGE_DIR/${TAG}.md" [ -f "$FORGE_FILE" ] || fail "$FORGE_FILE missing. Fix: create from previous tag's file as template." @@ -39,7 +39,7 @@ FOOTER_LEN=80 TOTAL=$((TITLE_LEN + ${#BODY} + FOOTER_LEN)) [ "$TOTAL" -le 5500 ] || fail "Forge embed total ~${TOTAL} chars > 5500 cap." -YAML_VERSIONS="$(grep -cE '^[[:space:]]*\*\*Hellion Chat' "$YAML" || true)" +YAML_VERSIONS="$(grep -cE '^[[:space:]]*\*\*v[0-9]+\.[0-9]+\.[0-9]+' "$YAML" || true)" [ "$YAML_VERSIONS" -le 4 ] || fail "$YAML changelog has $YAML_VERSIONS version subblocks (max 4). Fix: move oldest to docs/CHANGELOG.md." ok "yaml/repo.json/forge-post in sync for $TAG, embed-total ~${TOTAL}/5500, $YAML_VERSIONS/4 subblocks"