Skip to content

Add post-tag-version-bump to freeze default_version after a release - #95

Draft
jnasbyupgrade wants to merge 5 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:issue-20-stable-version-bump
Draft

jnasbyupgrade wants to merge 5 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:issue-20-stable-version-bump

Conversation

@jnasbyupgrade

@jnasbyupgrade jnasbyupgrade commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds make post-tag-version-bump, which bumps each extension's default_version to a placeholder alias (stable by default, via the new bump-default-version.sh script) so ongoing development after a release doesn't silently regenerate and overwrite the just-released version's SQL file.
  • Deliberately a separate, explicit step -- not wired into tag/dist, since both of those run routinely outside of an actual release (including in this project's own test suite) and dist is documented/tested to leave the repository clean.
  • New overridable variables, following the existing PGXNTOOL_ENABLE_*/PGXNTOOL_* pattern: PGXNTOOL_ENABLE_POST_TAG_VERSION_BUMP (default yes) and PGXNTOOL_POST_TAG_VERSION (default stable).
  • _.gitignore now ignores sql/*--stable.sql to match the default placeholder.

Fixes #20.

Related pgxntool-test PR: Postgres-Extensions/pgxntool-test#74

Test plan

  • bump-default-version.sh sanity-tested standalone against single/double-quoted control files, trailing comments, multiple files, and error cases
  • Paired test coverage in pgxntool-test PR (see cross-reference below)
  • Full test-all suite: 256/256 passed, 0 skipped

🤖 Generated with Claude Code

Committing versioned SQL files (sql/{ext}--{version}.sql) means ongoing
development after a release can silently regenerate and overwrite the file
that was just released, since `make` always regenerates whatever file
matches the current default_version. New target `post-tag-version-bump`
bumps each extension's default_version to a placeholder alias (`stable` by
default) via the new `bump-default-version.sh` script, so a subsequent
`make` freezes the released file instead of overwriting it.

Deliberately a separate, explicit step rather than wired into `tag`/`dist`:
both of those run routinely outside of an actual release (including from
this project's own test suite), and `dist` is documented/tested to leave
the repository clean -- auto-bumping on every such run would both break
that guarantee and risk bumping default_version on a version nobody meant
to release yet.

Controlled via two new variables, following the existing
PGXNTOOL_ENABLE_*/PGXNTOOL_* override pattern:
- PGXNTOOL_ENABLE_POST_TAG_VERSION_BUMP (default yes) makes the target a
  no-op when set to no
- PGXNTOOL_POST_TAG_VERSION (default stable) controls the placeholder value

_.gitignore now ignores sql/*--stable.sql to match the default placeholder.

Fixes Postgres-Extensions#20.

Related changes in pgxntool-test:
- Add test/standard/tag-version-bump.bats: standalone script-logic coverage
  for bump-default-version.sh, plus make -n dry-run and stub-based coverage
  of post-tag-version-bump's wiring, and a real end-to-end smoke test
- Add pgxntool/bump-default-version.sh to the exact distribution-contents
  manifest (test/lib/dist-expected-files.txt)

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: d322ac5b-6ea0-4745-bb47-abdd0dc729eb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

jnasbyupgrade and others added 2 commits September 16, 2026 16:28
…ersion-bump

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Merging master's PGXNTOOL_CONTROL_FILES -> _PGXNTOOL_CONTROL_FILES rename
(Postgres-Extensions#93) left this recipe referencing the old, now-undefined name, so it
invoked the bump script with no control files at all.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@jnasbyupgrade jnasbyupgrade left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, overall I think we're missing something here. For one thing, there's no discussion about setting the new version number as part of doing an actual release.

Do we have any existing docs about what the intended release process is? If not, lets start there; I think fleshing that out will make it clearer what we should actually be doing with this particular PR.

Comment thread base.mk Outdated
# explicit step in your own release process, right after the tag you're
# actually releasing has been created and pushed.
#
# Variable: PGXNTOOL_ENABLE_POST_TAG_VERSION_BUMP

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... as long as this is not wired into anything (ie, won't run unless explicitly called), we don't need a way to disable it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude here — agreed, removed the PGXNTOOL_ENABLE_POST_TAG_VERSION_BUMP toggle entirely (base.mk, README.asc, HISTORY.asc) and dropped the corresponding disable-case test coverage in the paired pgxntool-test PR. Since it's never auto-invoked, not calling the target already is the opt-out. Pushed as 4ec01a1.

Comment thread bump-default-version.sh Outdated
# everything else on that line (e.g. a trailing comment) and leaving the rest of
# the file untouched.
#
# Invoked by `make tag` (see base.mk) right after a new release tag is created,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh, is it? This contradicts what the makefile says.

@jnasbyupgrade jnasbyupgrade Sep 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude here — you're right, that comment was wrong (contradicted base.mk's own description of the target as deliberately not wired into tag). Fixed to say make post-tag-version-bump. Pushed as 4ec01a1.

post-tag-version-bump only ever runs when explicitly invoked (never wired
into tag/dist), so a PGXNTOOL_ENABLE_* opt-out is pointless -- not calling
the target is already the opt-out. Removes the variable, its validation,
and the ifeq-gated no-op branch, and the matching README/HISTORY mentions.

bump-default-version.sh's header also claimed it's invoked by `make tag`,
which contradicts base.mk's own comment describing the target as
deliberately NOT wired into tag/dist.

Addresses review comments on PR Postgres-Extensions#95.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jnasbyupgrade

jnasbyupgrade commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Claude here — re the top-level review comment about the release process not covering the new version number: agreed this needs a real answer, not a guess on my part, so I'm not picking an interpretation and building on it.

One relevant thing I can report factually rather than judge: ai/RELEASE.md (the shared, human-followable release doc for pgxntool-distributing repos) explicitly carves pgxntool-test out, pointing instead to pgxntool-test/.claude/skills/release/SKILL.md for its "different, paired mechanism tied to pgxntool's own release." That skill file is written as Claude Code instructions (imperative steps addressed to an agent), not something a human could follow standalone. So there currently isn't a human-readable release-process doc for pgxntool-test's own release, separate from whatever post-tag-version-bump's place in a release should be for plain PGXN-distributing repos. This is being tracked separately from this PR; flagging here since it's directly relevant to "do we have existing docs about the intended release process."

Leaving this open rather than resolving it inline — it's a design/process question, not something I should settle unilaterally.

Consumer-facing release checklist (drafted and reviewed separately on
docs/consumer-release-checklist, commit 98083b6), landed directly in this
PR so it answers the open review question about where the new version
number -- and post-tag-version-bump specifically -- fits into a release.
Added a step naming post-tag-version-bump at the point base.mk's own
comment says to run it: right after the tag is created and pushed,
distinguishing it from the release-version bump earlier in the checklist.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Post-release workflow: immediately bump default_version to 'unstable'

1 participant