Skip to content

ci(contract-tests): retry + diagnóstico real no smoke do supabase start#510

Merged
adm01-debug merged 1 commit into
mainfrom
claude/upbeat-hypatia-tvPbu
May 29, 2026
Merged

ci(contract-tests): retry + diagnóstico real no smoke do supabase start#510
adm01-debug merged 1 commit into
mainfrom
claude/upbeat-hypatia-tvPbu

Conversation

@adm01-debug
Copy link
Copy Markdown
Owner

@adm01-debug adm01-debug commented May 29, 2026

Contexto

Durante a auditoria pós-merge do #509, o único check vermelho era o job "Smoke — HTTP against supabase functions serve" (workflow contract-tests.yml).

Diagnóstico

A falha foi no step Start Supabase stack (supabase start) — bring-up do stack local no CI. Os steps seguintes (serve + smoke) foram skipped e o "Unit — Zod schemas" passou. Ou seja: não é regressão de contrato/código, é flakiness de infra ao subir o stack. Pior: o dump de falha só mostrava /tmp/functions.log (vazio, pois o serve nem rodou), escondendo o erro real.

Nota: este job é continue-on-error: true (advisory) e roda só em pull_requestnunca roda no main nem bloqueia merge. O main já está verde. Esta PR é endurecimento de qualidade do CI, não correção de bloqueio.

Mudança (aditiva, sem risco)

  • supabase start agora roda com --debug e log capturado; 1 retry após supabase stop absorve flakiness transitória de bring-up sem mascarar falha persistente.
  • Step de falha ampliado (Dump diagnostics): supabase-start.log, functions.log, docker ps -a e supabase status — assim a próxima falha será diagnosticável.

Próximo passo provável

Se o erro real (agora visível) apontar drift do supabase/setup-cli@v1 version: latest, o follow-up é pinar o CLI numa versão estável (3 workflows usam latest hoje). Deixei de fora desta PR para não pinar no chute — espero o log real primeiro.

https://claude.ai/code/session_01QpLctApdgHrT7hBAS3dk71


Generated by Claude Code


Summary by cubic

Hardens the smoke job in contract-tests.yml by adding a retry and real diagnostics to supabase start, reducing CI flakiness and making failures actionable. The job remains advisory (continue-on-error) and PR-only, with no impact on main.

  • Bug Fixes
    • Run supabase start --debug with log capture; on first failure, supabase stop then retry once.
    • On failure, dump /tmp/supabase-start.log, /tmp/functions.log, docker ps -a, and supabase status.

Written for commit 3cd4663. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Chores
    • Melhorias na confiabilidade e observabilidade dos testes de integração com lógica de retry e diagnósticos aprimorados em caso de falhas.

Review Change Stack

O job smoke (advisory) falhava no step 'Start Supabase stack' (bring-up do
stack local), e o dump de falha só mostrava /tmp/functions.log — vazio, pois
o serve nem chegava a rodar, escondendo o erro real.

- supabase start agora roda com --debug e log capturado; uma retry após
  'supabase stop' absorve flakiness transitória de bring-up sem mascarar
  falha persistente.
- Step de falha renomeado para 'Dump diagnostics' e ampliado: supabase-start.log,
  functions.log, 'docker ps -a' e 'supabase status'.

Job permanece advisory (continue-on-error) e PR-only — sem impacto nos gates do main.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
we-dream-big Ready Ready Preview, Comment May 29, 2026 2:24pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f35b1876-45c2-4c44-a167-cebd66432ec3

📥 Commits

Reviewing files that changed from the base of the PR and between 8537ba8 and 3cd4663.

📒 Files selected for processing (1)
  • .github/workflows/contract-tests.yml

Walkthrough

O workflow contract-tests.yml do job smoke ganha robustez e observabilidade: o startup do Supabase agora usa uma função com --debug e implementa retry automático (stop + reinício na falha), e o bloco de diagnóstico de falha expande para coletar logs de startup, functions, containers Docker e status do Supabase.

Changes

Melhorias no job smoke

Layer / File(s) Summary
Startup do Supabase com retry e debug
.github/workflows/contract-tests.yml
Startup via função start_stack() com --debug, log em /tmp/supabase-start.log. Retry automático: falha na 1ª tentativa dispara supabase stop e reinício; erro na 2ª tentativa propaga.
Bloco de diagnóstico de falha expandido
.github/workflows/contract-tests.yml
Passo "Dump diagnostics on failure" (condicionado a failure()) coleta log do startup, log do functions serve, lista Docker (docker ps -a), e status do Supabase — substituindo dump anterior limitado.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/upbeat-hypatia-tvPbu

Comment @coderabbitai help to get the list of available commands and usage tips.

@supabase
Copy link
Copy Markdown

supabase Bot commented May 29, 2026

This pull request has been ignored for the connected project doufsxqlfjyuvxuezpln because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@adm01-debug adm01-debug marked this pull request as ready for review May 29, 2026 15:00
Copilot AI review requested due to automatic review settings May 29, 2026 15:00
@adm01-debug adm01-debug merged commit f3c5af5 into main May 29, 2026
45 of 49 checks passed
@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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Hardens the advisory “Smoke — HTTP against supabase functions serve” CI job by making supabase start failures diagnosable and less flaky, so future infra/CLI bring-up issues are actionable without implying a contract/code regression.

Changes:

  • Run supabase start with --debug and capture logs to /tmp/supabase-start.log.
  • Add a single retry for supabase start after supabase stop to absorb transient bring-up failures.
  • Expand failure diagnostics to include Supabase start logs, functions serve logs, docker ps -a, and supabase status.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +76 to +86
start_stack() {
supabase start --debug > /tmp/supabase-start.log 2>&1
}
# O bring-up do stack local é ocasionalmente flaky no CI (pull de imagens
# Docker, drift do CLI etc.). Uma retry após `supabase stop` absorve falhas
# transitórias sem mascarar erro persistente — o log é preservado p/ diagnóstico.
if ! start_stack; then
echo "::warning::supabase start falhou na 1ª tentativa — limpando e tentando novamente"
supabase stop || true
start_stack
fi
@adm01-debug adm01-debug deleted the claude/upbeat-hypatia-tvPbu branch May 29, 2026 20:42
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