Skip to content

Commit ca7d3f3

Browse files
authored
fix(ci): pin supabase CLI to 2.105.0 — v2.106.0 breaks local gen types (#298)
* fix(ci): pin supabase CLI to 2.105.0 — v2.106.0 breaks local gen types supabase CLI v2.106.0 (released 2026-06-11 12:01 UTC) ported `gen types` to the new TypeScript CLI (supabase/cli#5514); the ported command demands an access token even for `--local` generation, so the types-drift step fails with "Access token not provided" on runners without SUPABASE_ACCESS_TOKEN. Both jobs installed `version: latest` and picked the release up within minutes (PR #297's run, two minutes after publish). Pin both setup-cli steps to 2.105.0 (last release before the port) and bump deliberately once upstream restores token-free local generation. * fix(ci): de-flake CLI telemetry race in the function-serve step The verify job's readiness poll resolved API_URL with a third `supabase status` call that runs concurrently with the backgrounded `functions serve`. The two CLI processes can race on ~/.supabase/telemetry.json ("error: NotFound: FileSystem.rename"), crashing status, leaving API_URL empty, and failing the poll with HTTP 000 for 30s (observed on this PR's first run; main passed the same script 40 minutes earlier — nondeterministic). Reuse the URL already captured into .env.local instead of calling status again, and set DO_NOT_TRACK=1 job-wide — the CLI's documented telemetry opt-out — so no two CLI invocations contend on the telemetry file anywhere in the job.
1 parent 611ded9 commit ca7d3f3

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ jobs:
1515
# redirects — these are the local-dev values from the config.toml comment.
1616
SUPABASE_AUTH_SITE_URL: http://127.0.0.1:3000
1717
SUPABASE_AUTH_REDIRECT_URL: https://127.0.0.1:3000
18+
# The CLI's telemetry writer can crash ("NotFound: FileSystem.rename
19+
# ~/.supabase/telemetry.json.tmp...") when two invocations run
20+
# concurrently — observed 2026-06-11 when `supabase status` raced the
21+
# backgrounded `functions serve`. CI needs no telemetry; this is the
22+
# CLI's documented opt-out.
23+
DO_NOT_TRACK: '1'
1824
steps:
1925
- uses: actions/checkout@v6
2026
- uses: actions/setup-node@v6
@@ -33,7 +39,11 @@ jobs:
3339
- run: npm run test:functions
3440
- uses: supabase/setup-cli@v2
3541
with:
36-
version: latest
42+
# Pinned: v2.106.0 (2026-06-11) ported `gen types` to the new TS CLI
43+
# and broke `--local` generation ("Access token not provided"),
44+
# failing the types-drift step. Bump deliberately after verifying
45+
# `supabase gen types typescript --local` works without a token.
46+
version: 2.105.0
3747
- run: supabase start
3848
- name: Regenerate supabase types and fail on drift (#132)
3949
run: |
@@ -53,7 +63,11 @@ jobs:
5363
# gateway is up but the function isn't — accepting it here lets the
5464
# e2e step run against a stalled function and exit non-zero with no
5565
# useful diagnostics. Require a 4xx (handler response) instead.
56-
API_URL="$(supabase status -o json | jq -r '.API_URL')"
66+
# Reuse the URL captured into .env.local above — another
67+
# `supabase status` here would run concurrently with the
68+
# backgrounded serve, the exact telemetry race that emptied
69+
# API_URL and failed this step on 2026-06-11.
70+
API_URL="$(grep '^SUPABASE_URL=' supabase/functions/.env.local | cut -d= -f2-)"
5771
ready=0
5872
for i in {1..30}; do
5973
STATUS=$(curl -sS --max-time 2 -o /dev/null -w '%{http_code}' \
@@ -81,6 +95,8 @@ jobs:
8195
env:
8296
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
8397
PROJECT_REF: ${{ secrets.SUPABASE_PROJECT_REF }}
98+
# Same telemetry opt-out as the verify job.
99+
DO_NOT_TRACK: '1'
84100
steps:
85101
- uses: actions/checkout@v6
86102
- uses: actions/setup-node@v6
@@ -90,6 +106,7 @@ jobs:
90106
- run: npm ci
91107
- uses: supabase/setup-cli@v2
92108
with:
93-
version: latest
109+
# Same pin as the verify job — keep both jobs on one CLI version.
110+
version: 2.105.0
94111
- run: supabase link --project-ref "$PROJECT_REF"
95112
- run: npm run migrations:check-drift

0 commit comments

Comments
 (0)