Skip to content

fix(cli): reject an unusable linked service image tag - #6797

Merged
avallete merged 4 commits into
developfrom
avallete/898cc5c0
Sep 24, 2026
Merged

avallete merged 4 commits into
developfrom
avallete/898cc5c0

Conversation

@avallete

@avallete avallete commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Summary

TL;DR: supabase link always prefixed Storage and PostgREST versions with v. A body that already started with v was saved as vv…, and startup then tried to pull that unpublished tag. New pins keep a single leading v. An already saved pin that is not a usable image tag, including vv…, now fails and is left on disk.

Before

flowchart LR
  probe["version body<br/>v1.77.1-versions"] --> prefix["always prefix v"]
  prefix --> pin["saved pin<br/>vv1.77.1-versions"]
  pin --> pull["pull unpublished tag"]
Loading

After

flowchart LR
  probe["Storage or PostgREST body"] --> tag["tagForServiceVersion"]
  tag --> pin["one leading v"]
  saved["saved pin"] --> check{"usable tag?"}
  check -->|yes| use["use pin"]
  check -->|no, including vv| err["error, file unchanged"]
Loading

Why

Storage's /version route returns its VERSION string as-is. A normal image is a bare semver such as 1.77.1, and the published tag is v1.77.1, so the CLI prefix is what turns the body into the tag. Some responses already include the prefix, including a suffix such as v1.77.1-versions. Prefixing those saved vv1.77.1-versions. That string was used as the storage-api tag, which is not published, so the pull failed. PostgREST's link pin had the same always-prefix behavior.

Existing vv… files are not rewritten. The next read fails and tells you to run supabase link again.

What changed

  • Storage and PostgREST link pins use tagForServiceVersion: a bare semver gains v, and a body that already starts with v is kept, including a suffix.
  • Reading a saved service pin that is not a usable image tag fails with InvalidServiceVersionTagError. The file is not changed.
  • Empty and missing pin files stay non-fatal.

Linked issue

None.

A /version body that already starts with v was prefixed again, so link
saved an unpublished storage tag.
@avallete
avallete requested a review from a team as a code owner September 24, 2026 11:29
@avallete
avallete enabled auto-merge September 24, 2026 11:31

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 AI Review

The PR fixes newly written Storage pins when the version response already starts with v. Review of the PR code confirms three follow-ups: the link path can still double-prefix PostgREST versions, previously saved vv… Storage pins remain unchanged, and the changed normalization paths in the shared service probes lack tests. Codex reported no additional findings.

Findings

Severity Location Category Sources Claim
🟠 MAJOR apps/cli/src/command-internal/tenant-versions.ts:57 backward-compatibility claude Previously saved vv… Storage pins are not repaired by this change, so affected projects continue to resolve an invalid Storage image tag until the pin is replaced.
🟡 MINOR apps/cli/src/shared/services/services.shared.ts:383 test-coverage claude The shared PostgREST and Storage probes have no test for the changed already-prefixed or uppercase V normalization behavior.
🟡 MINOR apps/cli/src/command-internal/tenant-versions.ts:36 correctness claude A PostgREST info.version that already starts with v becomes a vv… rest pin during supabase link.

Findings outside the diff

  • 🟡 MINOR apps/cli/src/command-internal/tenant-versions.ts:36 — A PostgREST info.version that already starts with v becomes a vv… rest pin during supabase link.

Stats

Claude findings: 3 · Codex findings: 0 · Confirmed: 3 · Refuted: 0 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6-sol · Trigger: auto · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

Comment thread apps/cli/src/command-internal/tenant-versions.ts
Comment thread apps/cli/src/shared/services/services.shared.ts
avallete and others added 2 commits September 24, 2026 14:32
PostgREST pins keep an existing v prefix, matching Storage. A saved
pin that is not a usable tag, including vv…, fails and is not rewritten.
@avallete avallete changed the title fix(cli): keep a leading v on linked storage versions fix(cli): reject an unusable linked service image tag Sep 24, 2026
…shot

The new tag is the telemetry identity for an unusable linked service pin.
@avallete
avallete disabled auto-merge September 24, 2026 13:00
@avallete
avallete added this pull request to the merge queue Sep 24, 2026
Merged via the queue into develop with commit a701cde Sep 24, 2026
32 of 34 checks passed
@avallete
avallete deleted the avallete/898cc5c0 branch September 24, 2026 13:19
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.

2 participants