Skip to content

Test upgrades from the previous release - #12

Merged
lemuelroberto merged 1 commit into
emfga:mainfrom
lemuelroberto:upgrade-coverage
Oct 30, 2026
Merged

lemuelroberto merged 1 commit into
emfga:mainfrom
lemuelroberto:upgrade-coverage

Conversation

@lemuelroberto

Copy link
Copy Markdown
Member

Implements upgrade coverage (rds-distribution decision 8): no tag can be cut unless upgrading from the previous release is tested.

What runs

A new reusable workflow, .github/workflows/upgrade.yml, runs a matrix over both channels a release ships:

Channel Install N-1 Upgrade
plain psql -1 -f cel4postgres--<prev>.sql psql -1 -f dist/cel4postgres--<head>.sql
pgtle pgtle.install_extension + CREATE EXTENSION cel4postgres VERSION '<prev>' pgtle.install_update_path + ALTER EXTENSION cel4postgres UPDATE TO '<head>'

For each channel it does the following (scripts/upgrade-check.sh):

  1. Downloads the latest published release (gh release download) and checks it against its SHA256SUMS.
  2. Installs it the way a consumer did.
  3. Registers a consumer schema, function, env and overload, then evaluates it.
  4. Upgrades to the build at hand.
  5. Checks that cel.version() (and extversion for pg_tle) report the new version, and that the consumer row survived and still evaluates.
  6. Runs the full go test ./..., conformance included, against the upgraded database.

Where it runs

  • CI: a new upgrade job on every pull request, so a change that breaks the upgrade fails where it is made.
  • Release: publish now needs: [smoke, pgtle, upgrade].

The ruleset's required check is still only test. If the upgrade jobs should also block merges, add upgrade / upgrade (plain) and upgrade / upgrade (pgtle) to it.

Other changes

  • scripts/pgtle-wrap.sh --update-from <old> emits pgtle.install_update_path instead of install_extension.
  • TestPinMatchesWorkflow now checks the cel-spec ref in upgrade.yml as well as in ci.yml.
  • docs/INSTALL.md: the "no in-place upgrade path" paragraph is replaced with the upgrade commands for both channels. It also says to re-run the grants after a release that adds functions (decision 5).

Not in this PR

Decision 6's per-release delta script, for drops and signature changes, does not exist yet; the upgrade is currently the idempotent installer alone. When a release first needs a delta, this job is where that will show up as a failure. Decision 7's origin column is also still pending.

Verified locally (0.0.2 → 0.0.3)

  • plain: upgrade passes, consumer row intact, then go test ./... against the upgraded database: all pass.
  • pgtle (pg_tle v1.5.3 on postgres 18.6): same result, all pass.
  • shellcheck scripts/*.sh: clean. The workflow YAML parses; actionlint was not available to run.

A consumer who installed 0.0.2 upgrades by running the next
artifact over it, and nothing so far checked that this works or
that it leaves their own registrations alone. Releasing without
that check is how the first broken upgrade reaches a database
nobody can reinstall casually.

The upgrade workflow installs the latest published release through
each shipped channel, registers a consumer overload, upgrades to
the build at hand -- psql over the old schema, or pg_tle's ALTER
EXTENSION UPDATE through a registered update path -- and then runs
the whole suite against the upgraded database, since an upgraded
install has to be exactly as conformant as a fresh one. CI runs it
on every pull request so a breaking change is caught where it is
made, and the release workflow's publish job needs it, so no tag is
cut without it.

The upgrade is the idempotent installer alone. The delta-script
convention for drops and signature changes stays unbuilt until a
release needs one; this job is what will say so.
@lemuelroberto
lemuelroberto merged commit 6984942 into emfga:main Oct 30, 2026
3 checks passed
@lemuelroberto
lemuelroberto deleted the upgrade-coverage branch October 30, 2026 01:22
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