From fc56c69af72c6c2c3f9aab7467863cd35c1e44b7 Mon Sep 17 00:00:00 2001 From: Amog Iska Date: Tue, 5 May 2026 17:26:37 -0500 Subject: [PATCH 1/2] chore(claude): add version-alignment + downstream-pipeline checks to release skill When cutting v0.3.7 we discovered the extension's default_version had been pinned at 0.1 across the entire 0.3.x distribution series, which violated Theory's policy that the extension version should track the distribution major.minor. The release skill happily created tags without catching this. Update the skill to: - Verify pg_stat_ch.control's default_version equals the new tag's major.minor, with bump-type-specific guidance on what to do if not. - Verify the canonical sql/pg_stat_ch--.sql exists and, if default_version was bumped this release, that the pg_stat_ch----.sql migration script is in place too (refs PR #84 as the precedent for the conditional-DDL migration). - After tagging, remind the operator of the downstream handoffs: pgext-packaging auto-bump (or manual update-pg-stat-ch.yml dispatch), AMI build via postgres-vm-images/trigger-build.yml, AMI ID rollout via clickgres-platform/clickgres-pg-amis-latest.yml. --- .claude/skills/create-new-release/SKILL.md | 39 +++++++++++++++++++--- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/.claude/skills/create-new-release/SKILL.md b/.claude/skills/create-new-release/SKILL.md index 4c756e2..5241212 100644 --- a/.claude/skills/create-new-release/SKILL.md +++ b/.claude/skills/create-new-release/SKILL.md @@ -1,6 +1,6 @@ --- name: create-new-release -description: Create and push a new semver release tag. Asks for release type (patch/minor/major), validates commit exists on remote, bumps version, and pushes the tag. +description: Create and push a new semver release tag. Asks for release type (patch/minor/major), verifies META.json version, verifies pg_stat_ch.control's default_version is aligned with distribution major.minor (Theory's policy), confirms the canonical SQL file and any required migration script are in place, validates HEAD is on remote, then pushes the tag and reminds the operator of the downstream pgext-packaging / AMI-build / clickgres-platform handoffs. --- # Create New Release @@ -29,20 +29,51 @@ Create and push a new semantic version release tag. 5. **Verify META.json version matches the new tag**: Read `META.json` and check that both `version` and `provides.pg_stat_ch.version` match the new version (without the `v` prefix). If they don't match, abort and tell the user to update `META.json` first — PGXN uses this file for the release version. -6. **Validate current commit exists on remote**: +6. **Verify extension `default_version` is aligned with the distribution major.minor** (Theory's policy from PR #33): + The extension version in `pg_stat_ch.control` (`default_version`) must equal the new tag's `MAJOR.MINOR`. So a `v0.3.7` tag requires `default_version = '0.3'`; a `v0.4.0` tag requires `default_version = '0.4'`. + + ```bash + ext_version=$(grep -E "^default_version" pg_stat_ch.control | sed -E "s/.*'([^']+)'.*/\1/") + want="." # derived from the new tag + ``` + + If `ext_version != want`, abort and tell the user the alignment is wrong. The fix depends on the bump type: + + - **Patch bump** (e.g., 0.3.6 → 0.3.7): `default_version` should already equal the existing major.minor. If it doesn't, the previous release was misaligned — that's a separate fix (the user has to land a PR that bumps `default_version`, renames the canonical SQL file `pg_stat_ch--.sql` → `pg_stat_ch--.sql`, and adds a migration `pg_stat_ch----.sql` for existing installs). See PR #84 for a precedent. + - **Minor or major bump** (e.g., 0.3.x → 0.4.0): the bump itself changes major.minor, so the user must, in the *same release*, also: (a) bump `default_version` to the new major.minor, (b) rename `sql/pg_stat_ch--.sql` → `sql/pg_stat_ch--.sql`, (c) add `sql/pg_stat_ch----.sql` doing whatever DDL is required to migrate from the prior shape (or a no-op `DO $$ ... $$` block guarded on catalog state if the SQL surface didn't change). + + Do not tag the release until alignment holds. + +7. **Verify the canonical SQL file and migration script are in place**: + ```bash + ls sql/pg_stat_ch--.sql # canonical install file + ``` + The canonical SQL file `sql/pg_stat_ch--.sql` must exist (e.g., `sql/pg_stat_ch--0.3.sql` for `default_version = '0.3'`). + + If `default_version` was bumped in this release relative to the previous tag, also verify: + ```bash + ls sql/pg_stat_ch----.sql + ``` + The migration script for the prior `default_version` must exist. If either file is missing, abort and tell the user to add them (see PR #84 for the conditional-DDL pattern that handles both legacy and current catalog shapes). + +8. **Validate current commit exists on remote**: ```bash git fetch origin git branch -r --contains HEAD ``` If no remote branch contains HEAD, abort with an error asking the user to push their commits first. -7. **Create and push the tag**: +9. **Create and push the tag**: ```bash git tag -a -m "Release " git push origin ``` -8. **Report success** with the new tag name. +10. **Report success** with the new tag name. Then remind the user of the downstream pipeline: + - `clickgres-pgext-packaging`'s hourly cron will auto-open `chore(pg_stat_ch): upgrade to `. Merging it triggers `deb.yml` → S3 APT repo upload (~30–60 min) → GitHub release on the packaging repo signals the .debs are live. + - To skip the hourly wait, manually dispatch `update-pg-stat-ch.yml` in `clickgres-pgext-packaging` immediately after the release tag is published. + - After the .debs are in S3: trigger `postgres-vm-images / trigger-build.yml` to bake them into a new AMI (~55–60 min). Confirm the AMI build's `apt-get download` log line shows `+` for `postgresql-{16,17,18}-pg-stat-ch`. + - After the AMI build: trigger `clickgres-platform / clickgres-pg-amis-latest.yml` to fetch new AMI IDs and open the `automated/pg-ami-upgrade` helm PR. Merge that to roll the fleet. ## Version Parsing From ceec09de88d3822f0554b5845665279a2cf67f08 Mon Sep 17 00:00:00 2001 From: Amog Iska Date: Wed, 6 May 2026 09:37:56 -0500 Subject: [PATCH 2/2] chore(claude): drop personal attribution in release-skill version-policy refs --- .claude/skills/create-new-release/SKILL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.claude/skills/create-new-release/SKILL.md b/.claude/skills/create-new-release/SKILL.md index 5241212..e37bc0c 100644 --- a/.claude/skills/create-new-release/SKILL.md +++ b/.claude/skills/create-new-release/SKILL.md @@ -1,6 +1,6 @@ --- name: create-new-release -description: Create and push a new semver release tag. Asks for release type (patch/minor/major), verifies META.json version, verifies pg_stat_ch.control's default_version is aligned with distribution major.minor (Theory's policy), confirms the canonical SQL file and any required migration script are in place, validates HEAD is on remote, then pushes the tag and reminds the operator of the downstream pgext-packaging / AMI-build / clickgres-platform handoffs. +description: Create and push a new semver release tag. Asks for release type (patch/minor/major), verifies META.json version, verifies pg_stat_ch.control's default_version is aligned with the distribution major.minor (the versioning policy established in PR #33), confirms the canonical SQL file and any required migration script are in place, validates HEAD is on remote, then pushes the tag and reminds the operator of the downstream pgext-packaging / AMI-build / clickgres-platform handoffs. --- # Create New Release @@ -29,7 +29,7 @@ Create and push a new semantic version release tag. 5. **Verify META.json version matches the new tag**: Read `META.json` and check that both `version` and `provides.pg_stat_ch.version` match the new version (without the `v` prefix). If they don't match, abort and tell the user to update `META.json` first — PGXN uses this file for the release version. -6. **Verify extension `default_version` is aligned with the distribution major.minor** (Theory's policy from PR #33): +6. **Verify extension `default_version` is aligned with the distribution major.minor** (the versioning policy established in PR #33): The extension version in `pg_stat_ch.control` (`default_version`) must equal the new tag's `MAJOR.MINOR`. So a `v0.3.7` tag requires `default_version = '0.3'`; a `v0.4.0` tag requires `default_version = '0.4'`. ```bash