Skip to content

Switch master to the stable pseudo-version and restore the shipped 0.2.0 script - #8

Merged
jnasbyupgrade merged 5 commits into
masterfrom
adopt-stable
Oct 26, 2026
Merged

jnasbyupgrade merged 5 commits into
masterfrom
adopt-stable

Conversation

@jnasbyupgrade

@jnasbyupgrade jnasbyupgrade commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Switches master to the stable pseudo-version (default_version in the control file, and the distribution and extension versions in META.in.json/META.json), so source edits regenerate the gitignored sql/trunklet-format--stable.sql instead of a released version's install script. It also restores sql/trunklet-format--0.2.0.sql to the script that actually shipped as 0.2.0, and adds sql/trunklet-format--0.2.0--stable.sql to bring a 0.2.0 install up to the current source.

Updating from 0.2.0 needs extension_drop and trunklet >= 0.3.3 first, on PostgreSQL 12 or later. 0.2.0 required only trunklet. The current version also requires extension_drop, so ALTER EXTENSION "trunklet-format" UPDATE fails with required extension "extension_drop" is not installed until you run CREATE EXTENSION extension_drop CASCADE;. The 0.2.0-to-stable update requires trunklet >= 0.3.3, because the registered drop command uses template_language__remove(ignore_missing_functions), new in 0.3.3. trunklet 0.2.0 has no update script to 0.2.1 or later, so users on trunklet 0.2.0 must drop and recreate trunklet, which also drops trunklet-format and any trunklet data. This PR raises both trunklet prereqs in META.in.json to 0.3.3, and HISTORY.asc and README.md describe these steps.

Before changing anything, the update script fails with trunklet >= 0.3.3 required; found <version> if the installed trunklet is older than 0.3.3.

The 0.2.0 install script

The stacked #3 adds a sql/trunklet-format--0.2.0.sql generated from the current source, which differs from what shipped as 0.2.0 in 153 lines (it includes later commits such as "Add support for dropping the extension"). This PR replaces it with the shipped script, taken from the 0.2.0 branch, which is byte-identical to the PGXN 0.2.0 release.

The update script

It registers the drop command that 0.2.0 lacked (via extension_drop__add), then replaces the format language's stored function bodies and recreates its two functions the same way trunklet.template_language__add() does.

Residual risk: this writes trunklet's private _trunklet tables and calls its private _trunklet._language_function__create(), because trunklet has no public API to replace a language. Removing and re-adding the language would fail on stored templates, or with cascade delete them. If trunklet changes those internals, this script has to follow.

Checked by hand on PostgreSQL 12 and 17. A real 0.2.0 install (shipped 0.2.0 control file and script) was updated with ALTER EXTENSION UPDATE and compared against a fresh stable install. These were identical: member objects, pg_get_functiondef output, comments, ACLs and owners of every member function, the _trunklet.language row, the registered extension_drop command, and the recorded required extensions. With the function replacement removed from the update script, the same comparison shows differences. After the update, a template stored before it still processes, the new optional-parameter syntax works, and DROP EXTENSION removes the language. Committed update-path testing arrives in #4.

make test doesn't pass on this branch alone, because the repo's Makefile doesn't work with pgxntool 2.4.0 yet (make install fails with "will not overwrite just-created"). The stacked #3 fixes that.

🤖 Generated with Claude Code

Set default_version and the META.json versions to `stable`, so editing
the source regenerates the gitignored sql/trunklet-format--stable.sql
instead of a released version's install script.

Restore sql/trunklet-format--0.2.0.sql to the script that shipped as
0.2.0 (identical to the PGXN 0.2.0 release), and add the 0.2.0--stable
update script, which brings a 0.2.0 install up to the current source.
Updating from 0.2.0 needs extension_drop created first, because 0.2.0
did not require it; HISTORY.asc and README.md say so.

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

coderabbitai Bot commented Oct 25, 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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: b3c6b0b1-583a-4412-94d5-4ea98b953eb5

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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
jnasbyupgrade added this pull request to stack #9 October 25, 2026 20:10
jnasbyupgrade and others added 4 commits October 25, 2026 15:16
The drop command registered by the install and update scripts calls
trunklet.template_language__remove() with ignore_missing_functions,
which trunklet 0.3.3 added, and the update script uses
_trunklet._language_function__create(), added in 0.3.0. Raise both
trunklet prereqs to 0.3.3, and say in HISTORY.asc and README.md that
updating from 0.2.0 needs trunklet updated first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
trunklet has no update script from 0.2.0, so ALTER EXTENSION trunklet
UPDATE only works from trunklet 0.2.1 or later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jnasbyupgrade
jnasbyupgrade marked this pull request as ready for review October 26, 2026 20:52
@jnasbyupgrade
jnasbyupgrade merged commit 76c0c3c into master Oct 26, 2026
1 check passed
@jnasbyupgrade
jnasbyupgrade deleted the adopt-stable branch October 26, 2026 20:54
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.

1 participant