fix(ci): repair TypeScript gate (decode base64 supabase-untyped, distributive Omit)#326
fix(ci): repair TypeScript gate (decode base64 supabase-untyped, distributive Omit)#326adm01-debug wants to merge 1 commit into
Conversation
…fix bridge Omit The TS gate was red on main (521 errs vs 508 baseline, +13). Root causes: - src/lib/supabase-untyped.ts was committed as a base64 blob instead of TS, so it exported nothing -> 8x TS2305 "no exported member 'untypedFrom'" across personalization/intelligence/products/trends + 3x TS2304 in the file. Decoded back to the real TypeScript. - bridge-status-events.ts: emitBridgeStatus used Omit<Union,'ts'>, which collapses the discriminated union to common keys and drops variant props (reason/attempt/attempts) -> 5x TS2353 in external-db/invoke.ts. Switched to a DistributiveOmit. - kill-switch-client.test.ts: mockFrom had no params, so spread args tripped TS2556. Gave it a rest param. Result: tsc drops to 502 errors (6 under the old baseline), no regressions. Both baselines refreshed (.tsc-baseline.json 502, .eslint-baseline.json 131) so Gate 1 (Lint+TypeScript) and Lint/Typecheck&Test pass. The 4 absorbed eslint items are pre-existing drift in kill-switch files (not touched here). https://claude.ai/code/session_01MBTzmQYmrgwLnwfxRS3PNU
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Warning Review limit reached
Your plan includes 5 reviews of capacity. Refill in 26 minutes. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR aims to get the CI TypeScript “baseline gate” back to green by addressing root causes of new TS errors (rather than regenerating the full Supabase types.ts) and then updating the stored baselines accordingly.
Changes:
- Decodes/restores
src/lib/supabase-untyped.ts(previously committed as base64) sountypedFrom()is actually exported and typechecking can proceed. - Fixes
emitBridgeStatustyping for a discriminated-union event by using a distributive omit pattern, eliminating invalid property errors downstream. - Adjusts a Supabase mock in
kill-switch-clienttests to accept rest args, fixing a TS spread/args error; refreshes.tsc-baseline.jsonand.eslint-baseline.json.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/lib/supabase-untyped.ts | Restores readable TS source and untypedFrom() export; adds explanatory header comment. |
| src/lib/external-db/bridge-status-events.ts | Fixes union-typing issue in emitBridgeStatus via distributive omit; minor formatting cleanup. |
| src/lib/external-db/tests/kill-switch-client.test.ts | Updates mocked .from() to accept rest args to satisfy TS. |
| .tsc-baseline.json | Updates TS error baseline totals and per-file counts to match new tsc output. |
| .eslint-baseline.json | Updates ESLint baseline totals/counts to match current lint output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * CI guard: `.github/workflows/lint-untyped-from.yml` fails the build if | ||
| * any `untypedFrom("X")` call references a table NOT in types.ts — | ||
| * which is the precise condition that caused a 2026-05-24 silent | ||
| * failures (tables missing from the database). |
🚪 Fechando esta PR — duplicada de #332Após auditoria comparativa, esta PR é subconjunto estrito da #332. Detalhamento: Arquivos sobrepostos (exatamente os mesmos)
O que o #332 traz a mais
ConclusãoManter as duas PRs abertas com o mesmo fix de Validação: o fix de TS gate (a motivação desta PR) será entregue em produção pelo #332, com mais 10 bugs reais juntos. 🤖 Decisão tomada via plano master coordenado — ver #332 para o bloco completo. |
Objetivo
Deixar o gate de TypeScript verde (parte do plano aprovado "atualizar baseline / alinhar tipos"). Em vez de regenerar o
types.tsinteiro (que pioraria — testei: surgem ~30 mismatches latentes pois o frontend depende do shape atual dos tipos), encontrei e corrigi a causa-raiz do gate vermelho.Diagnóstico
mainestava 521 erros de TS vs baseline 508 (+13) — por isso o "TypeScript gate" falhava em todo PR. Raízes:src/lib/supabase-untyped.tsestava commitado em base64 (mesmo padrão da migration base64), então não exportavauntypedFrom→ 8× TS2305 ("no exported member 'untypedFrom'") em personalization/intelligence/products/trends + 3× TS2304 no próprio arquivo. → decodificado para o TS real.bridge-status-events.ts:emitBridgeStatususavaOmit<BridgeStatusEvent,'ts'>, masBridgeStatusEventé união discriminada —Omitsobre união colapsa para chaves comuns e perdereason/attempt/attempts→ 5× TS2353 emexternal-db/invoke.ts. → trocado porDistributiveOmit.kill-switch-client.test.ts:mockFromsem parâmetros → spread tropeçava em TS2556. → rest param.Resultado (validado com
node_modulesinstalado)tsc: 521 → 502 erros (6 abaixo do baseline antigo), sem regressões ✅.tsc-baseline.json(502) e.eslint-baseline.json(131) → Gate 1 (Lint+TypeScript) e Lint/Typecheck & Test passam ✅Notas
useKillSwitchBanner,kill-switch-client,kill-switch-telemetry) — não tocados aqui (território da sessão concorrente); ficam visíveis no diff para correção futura.types.ts(a substituição integral piora o gate; seria um refactor dedicado para alinhar o frontend ao schema real de prod).https://claude.ai/code/session_01MBTzmQYmrgwLnwfxRS3PNU
Generated by Claude Code
Summary by cubic
Fixes the failing TypeScript CI gate by decoding the base64-committed
supabase-untypedfile and correctingemitBridgeStatustyping. TS errors drop to 502 and Gate 1 (Lint+TypeScript) passes again.src/lib/supabase-untyped.tsand restoreduntypedFrom<T>()for untyped tables.Omit<Union, 'ts'>with a distributiveOmitinbridge-status-events.tsto keep variant fields; fixes TS2353s inexternal-db/invoke.ts.mockFromto accept rest args inkill-switch-client.test.tsto resolve TS2556..tsc-baseline.jsonto 502 errors,.eslint-baseline.jsonto 131.Written for commit ea95780. Summary will update on new commits. Review in cubic