Skip to content

scripts: tie each tested version to its image in the Supabase guide - #697

Open
Kiran01bm wants to merge 1 commit into
mainfrom
kiran01bm/pd202-guide-version-image-map
Open

Kiran01bm wants to merge 1 commit into
mainfrom
kiran01bm/pd202-guide-version-image-map

Conversation

@Kiran01bm

Copy link
Copy Markdown
Collaborator

check-guide-versions.sh now requires each pinned image's version to appear next to that image's name in the Supabase guide, and reports a pin it cannot name or a non-version tag as UNCHECKED.

Why

The Supabase guide lists the component versions pg-sprite is tested against, and a script checks the list against the pinned images so the guide cannot go stale. The script only looked for each version somewhere in the paragraph, so when two images share a version, a wrong number for one of them still passed. A tag like latest or 14 passed on any matching word.

What

  • A short_name map per image (a case statement, because macOS's bash 3.2 has no associative arrays):

    Image Written in the guide as
    supabase/postgres supabase/postgres:17.6.1.136
    postgrest/postgrest PostgREST 14.18
    supabase/supavisor Supavisor 2.10.0
    supabase/gotrue Auth 2.197.0
    supabase/realtime Realtime 2.153.6
  • The version must follow the mapped name, across a line wrap too. The existing version-boundary rules stay.

  • A pin with no map entry, or a tag that is not a dotted numeric version (optionally v-prefixed), is UNCHECKED and exits 2. A mismatch still exits 1, and 1 wins over 2.

  • scripts/check-guide-versions_test.sh gains cases for each of these. 12 of its 22 cases fail against the old script.

  • The script header, docs/testing.md, integration/supabase/README.md, the Makefile comment, and the comment in docs/supabase.md describe the new rule. The guide's prose is unchanged.

Before / after

Realtime is re-pinned to Auth's version, v2.197.0, but the guide still says "Realtime 2.153.6".

compose: supabase/gotrue:v2.197.0, supabase/realtime:v2.197.0
guide:   "... Auth 2.197.0 ... Realtime 2.153.6 ..."

Before
  realtime pin ──▶ look for "2.197.0" anywhere ──▶ found (it is Auth's)
  result       ──▶ exit 0; the guide's stale Realtime number ships

After
  realtime pin ──▶ look for "Realtime 2.197.0" ──▶ not found
  result       ──▶ exit 1: MISSING supabase/realtime:v2.197.0:
                   ... do not name Realtime 2.197.0

The check matched a pin's version anywhere in the paragraph, so two pins
at one version let a stale mention pass; require it next to the image's name.
@Kiran01bm
Kiran01bm marked this pull request as ready for review December 2, 2026 05:19
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-12-02T05:19:10.785250Z
We couldn’t complete this review. Comment @codex review to try again.
7473298 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@aparajon

aparajon commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

🤖 Review 1/2 (correctness) of 7473298: 0 blocking, 2 non-blocking.

Inspected the whole change at 7473298d316cf138155c9317c1494ad8978d348e: scripts/check-guide-versions.sh and its test, read against the real inputs it gates, compose/supabase.yml and the first paragraph under "What works today" in docs/supabase.md. CI at the time of posting: 11 of 17 checks green, including build, lint, the unit tests (no Docker; docs guards) job and the smoke test; the Supabase compatibility job (where make test-image-pins drives the test script) and the PostgreSQL 14 to 17 and other packages legs were still running.

The change makes the check stricter in the right direction: a pin's version must now follow that image's own name, so two images on one version cannot stand in for each other, and a pin the check cannot name (no short_name entry, or a tag that is not a dotted numeric version) is UNCHECKED instead of passing on a stray word. I traced the script by reading, since I ran no code here:

  • The real guide still passes. All five pins resolve: supabase/postgres:17.6.1.136 (docs/supabase.md#L230), PostgREST 14.18, Supavisor 2.10.0, Auth 2.197.0 (#L233-L234) and Realtime 2.153.6, each preceded by a space or backtick and followed by a comma, a space (the wrap joins lines with one) or a sentence-ending dot. The unit tests job, which runs make check-guide-versions on the real files, agrees.
  • The 22 cases of the test script all take the branch their message names. I counted 12 that the old script fails, which is the PR's number: seven message changes, the name-less version, the shared-version case and the three UNCHECKED cases.
  • The comparison is anchored well. The version keeps its old boundary rule; the name must not follow a letter, digit, _, ., / or - (#L123), so a registry-prefixed reference or -Auth cannot satisfy it. Exit 1 is tested before exit 2 (#L192 and #L196), as the PR says.

Invariants (docs/invariants.md): none of its entries governs a docs guard or a fixture check (they cover the engine, the checkpoint and the control plane), and the repo keeps process rules in AGENTS.md. Nothing is weakened or moved.

Non-blocking

  1. The new rules the PR leans on are not each pinned by a test, so three mutants survive by reading. The cases added cover the name-less version, the shared version, the missing short name and the two bad tags, and each of them holds. Three claims have no case: (a) the leading boundary on the name (#L123): replace (^|[^[:alnum:]_./-]) with (^|.) or nothing and every case still passes, because no case writes the name as the tail of another word (OAuth 2.197.0); (b) the colon form used for supabase/postgres: (#L94-L102, #L169-L172): the postgres pin is only ever matching in the test file, so a stale postgres version is never shown to fail; (c) "1 wins over 2", stated in the PR body: no case has a missing pin and an uncheckable one together. All three are small additions. Reasoned from the code, not run.
Test case: three cases that kill those mutants (not run here)
expect "a name that ends another word does not count" 1 \
	"MISSING      supabase/gotrue:v2.197.0: the guide's tested versions do not name Auth 2.197.0" \
	"$compose" "# Guide

## What works today

A local \`supabase/postgres:17.6.1.136\` database. OAuth 2.197.0 was tested."

expect "a stale postgres version fails even though Auth is current" 1 \
	"MISSING      supabase/postgres:17.6.1.137: the guide's tested versions do not name supabase/postgres:17.6.1.137" \
	"${compose/17.6.1.136/17.6.1.137}" "$(guide_with 2.197.0)"

expect "a missing version wins over an image that cannot be checked" 1 "" \
	"$compose_bumped  widget:
    image: acme/widget:1.2.3@$D1
" "$(guide_with 2.197.0)"

Each is meant to pass at the head and to fail with the mutation named above; I did not run them.

  1. A pin with a suffix, such as a pre-release or a flavor tag, can no longer be checked, which the old script allowed. is_version accepts only dots and digits (#L106-L108), and a tag that is not one exits 2 (#L165-L168). The old word-boundary rule matched a pin like v2.197.0-rc1 when the guide wrote 2.197.0-rc1, so a repo that pinned such a tag passed before and now fails with no way to satisfy the check short of changing the tag. Nothing in compose/supabase.yml does this today, so it is latent; it fires on the first pin with a suffix (an upstream release candidate, or a -<flavor> tag). The header's reason, "which no sentence can name unambiguously" (#L21-L25), is true of latest and 14 but not of 2.197.0-rc1, which the guide can write in full and the version boundary at #L123 already tells apart from 2.197.0. Either let the dotted-numeric core carry an optional - or + suffix and require the guide to write all of it, or keep the strict rule and say in the README step that a suffixed tag needs the script changed first. A latest or major-only tag is correctly refused either way.

Verified

  • Read both scripts end to end and the diff of the four docs files; compared every claim in the PR body (the name table, "across a line wrap", exit codes, "12 of its 22 cases fail against the old script") with the code and found each true.
  • I ran no code: this review is a trace of the script and test file against the real compose and guide, so the mutation table below is by reading.
Mutant Caught by
short_name entry for supabase/gotrue returns nothing "an image with no short name" shape is reached; the real-file check-guide-versions in the unit job fails
names_version ignores the name and matches the version alone (the old rule) "a version written without the image's name" and "another image's mention"
is_version accepts any tag "a latest tag" and "a major-only tag"
${#missing} and ${#unchecked} checks swapped (2 beats 1) survives: no case has both (finding 1)
Leading boundary on the name removed survives (finding 1)
Postgres colon form replaced with the whitespace form the positive cases (the guide writes postgres:17.6.1.136 with no space)

This review was generated by Claude Code (claude-sonnet-5-5).

@aparajon

aparajon commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

🤖 Review 2/2 (OSS adoption and integration) of 7473298: 0 blocking, 2 non-blocking.

Read the change from two seats: a contributor who bumps or adds a Supabase image and needs the guard to tell them exactly what to write, and an importer or fork that keeps its own compose file and guide and runs the same script through PINS_FILE and GUIDE_FILE. Nothing here is a Go surface: the whole change is a shell guard, its test and four docs, so the question is what the failure says and what the docs promise.

Non-blocking

  1. A contributor learns the postgres pin is written differently from the other four only from a failure. Four images are written as a name and a version (Auth 2.197.0), but supabase/postgres is written as an image reference with a colon and no space (supabase/postgres:17.6.1.136, short_name). The only forms shown to someone editing the guide are the comment above the heading, which gives Auth 2.197.0 (docs/supabase.md#L227), and the README step, which gives Realtime 2.153.6 (integration/supabase/README.md#L108). Someone bumping postgres who writes "Postgres 17.6.1.137" gets a clear MISSING line naming supabase/postgres:17.6.1.137, so it costs one CI round trip, not a dead end. A half-sentence in the README step ("the five names are in short_name; the database image is written as its reference") saves that round trip, and costs nothing to keep true because the table is in one place.

  2. A new image fails only after the PR is pushed, and neither the compose file nor the guard's own message says where to add its name. The README and docs/testing.md both say a new image needs a short_name entry (README.md#L110-L112, testing.md#L242), and the UNCHECKED line names the function (has no name in short_name), but not the file: a contributor who sees it in CI output has to search for it. Putting the script path in that message (scripts/check-guide-versions.sh short_name) closes it. For an importer that points PINS_FILE at its own compose file, this matters more: every one of its images exits 2 until it forks the script, since the map is compiled in. A one-line note in the script header or docs/testing.md that the map is the extension point, and that a fork edits it, would make the integration path an intended one. Both are comment-sized.

What reads well for adopters

  • The PR body shows one concrete mistake (Realtime re-pinned to Auth's version while the guide still says Realtime 2.153.6) before and after, with the failure line a contributor would see. That is the clearest statement of the bug the guard now catches.
  • The failure names the exact string to write (do not name Realtime 2.197.0), so fixing the guide does not need the script open. The UNCHECKED messages separate "no name for this image" from "this tag has no dotted version", which are different fixes.
  • The case statement instead of an associative array keeps the script runnable on macOS's bash 3.2, which is the right call; the reason sits in the PR body rather than beside short_name, so a one-line comment there would keep a later change from swapping it for a map.
  • The new rule reads as an extension of the old one: the version-boundary rules are unchanged, exit 1 still beats exit 2, and the guide's prose is untouched, so existing readers of docs/supabase.md see no change.

This review was generated by Claude Code (claude-sonnet-5-5).

@aparajon aparajon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Stamping with comments: 0 blocking, 4 non-blocking (see the review comments above).

This stamp was left by Claude Code (claude-sonnet-5-5).

@JashLal

JashLal commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

🤖 Reviewed 7473298. One false match remains at the version boundary.

A guide entry of Auth 2.197.0rc1 can satisfy a pin of v2.197.0. The version's trailing class excludes digits, dot, plus and hyphen, so it consumes the r and reports success. That's inconsistent with the check's requirement that the version stand as its own word. Exclude letters and underscores as continuations, and add a case with 2.197.0rc1 alongside the existing hyphenated prerelease case. Keep the period-at-sentence-end case. Matcher

The full diff shows each known image checked against its own mapped name, including the special Postgres image-reference form. GitHub's 18 reported checks passed, including the docs guard and Supabase compatibility.

Review based on the full GitHub diff, PR discussion and reported checks. Builderbot and inline review threads were unavailable. I did not run tests locally.

@JashLal JashLal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Approved by Jash’s AI agent after reviewing 7473298. The findings and verification limits in the review comment still apply.

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.

3 participants