Skip to content

fix(ci): corrige posição da anotação rls-allow em QuoteViewPage (destrava seller-scope gate)#175

Merged
adm01-debug merged 1 commit into
mainfrom
fix/seller-scope-annotation-quoteview
May 23, 2026
Merged

fix(ci): corrige posição da anotação rls-allow em QuoteViewPage (destrava seller-scope gate)#175
adm01-debug merged 1 commit into
mainfrom
fix/seller-scope-annotation-quoteview

Conversation

@adm01-debug
Copy link
Copy Markdown
Owner

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

Problema

O job Lint, Typecheck & Test falha no CI (inclusive no main) por causa do step Seller-scope checker (scripts/check-seller-scope.mjs), não por lint nem typecheck.

A violação reportada era:

• src/pages/quotes/QuoteViewPage.tsx:210  [quotes]
    .from('quotes')

Causa-raiz

A query já tinha a anotação // rls-allow:, mas posicionada 2 linhas acima do .from('quotes'):

// rls-allow: lookup por id; RLS valida ownership   ← linha 208
await supabase                                        linha 209
  .from('quotes')                                     linha 210

A função hasAllowAnnotation(lines, idx) do checker só aceita a anotação na mesma linha do .from(...) ou imediatamente acima (idx-1). Como idx-1 era await supabase (não o comentário), o gate não reconhecia a allowlist e falhava.

Correção

Move o comentário para imediatamente acima do .from('quotes') (comentário entre encadeamentos é TSX válido):

await supabase
  // rls-allow: lookup por id; RLS valida ownership
  .from('quotes')

A query é inalterada — segue sendo um lookup por id onde o RLS valida ownership (não requer seller_scope explícito). Apenas 1 linha reposicionada.

Validação

  • node scripts/check-seller-scope.mjs → ✅ passa (0 violações).
  • Parse TSX (esbuild) → ✅ sem erro de sintaxe.
  • Diff: 1 arquivo, +1/−1.
  • Integridade verificada por blob sha (092fd89d) no GitHub.

Summary by cubic

Fixes CI failure by moving the // rls-allow: annotation in src/pages/quotes/QuoteViewPage.tsx to immediately above .from('quotes') so scripts/check-seller-scope.mjs recognizes it. This unblocks the seller-scope gate and the Lint, Typecheck & Test job; no query behavior changes.

Written for commit e863ab9. Summary will update on new commits. Review in cubic

Summary by CodeRabbit

  • Chores
    • Ajuste interno na organização do código sem impacto nas funcionalidades visíveis ao usuário.

Review Change Stack

…rava seller-scope gate)

O check-seller-scope.mjs so aceita a anotacao // rls-allow: na mesma linha
do .from(...) ou imediatamente acima. A anotacao estava 2 linhas acima
(separada por 'await supabase'), entao o gate marcava QuoteViewPage.tsx:210
como violacao e derrubava o job 'Lint, Typecheck & Test' no CI.

Move o comentario para imediatamente acima de .from('quotes'). Query
inalterada (lookup por id, RLS valida ownership). Apenas reposiciona 1 linha.
Copilot AI review requested due to automatic review settings May 23, 2026 20:52
@supabase
Copy link
Copy Markdown

supabase Bot commented May 23, 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 ↗︎.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 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 23, 2026 8:53pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a15f0914-2400-489b-9354-46fc034015ba

📥 Commits

Reviewing files that changed from the base of the PR and between 104de66 and e863ab9.

📒 Files selected for processing (1)
  • src/pages/quotes/QuoteViewPage.tsx

Walkthrough

O PR repositiona um comentário de justificativa RLS no handler de cancelamento de sincronização em QuoteViewPage.tsx. O comentário é movido de uma posição anterior para imediatamente após o await supabase, mantendo a mesma query sem alterações funcionais.

Changes

Reposicionamento de Comentário RLS

Layer / File(s) Summary
Repositionamento do comentário RLS no update de status
src/pages/quotes/QuoteViewPage.tsx
O comentário // rls-allow: lookup por id; RLS valida ownership é movido para ficar imediatamente após await supabase, melhorando a clareza da justificativa de segurança junto ao ponto de execução. Nenhuma alteração funcional na query ou fluxo.

🎯 1 (Trivial) | ⏱️ ~2 minutos

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed O título descreve com precisão a mudança principal: reposicionar a anotação rls-allow em QuoteViewPage para resolver a falha do seller-scope checker no CI.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/seller-scope-annotation-quoteview

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

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

Repositions the // rls-allow: annotation directly above .from('quotes') so the seller-scope checker recognizes it and the CI gate passes.

Changes:

  • Move annotation comment one line down into the method chain.

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

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Re-trigger cubic

@adm01-debug
Copy link
Copy Markdown
Owner Author

Superado por #176, que aplicou a mesma correção (reposicionar a anotação // rls-allow: para imediatamente acima de .from('quotes')) e já está no main (c91d4ecc). O diff deste PR vs main agora é vazio. Fechando como redundante. ✅ O step Seller-scope checker passa no main.

@adm01-debug adm01-debug merged commit 8935dd5 into main May 23, 2026
29 of 31 checks passed
@adm01-debug adm01-debug deleted the fix/seller-scope-annotation-quoteview branch May 23, 2026 21:49
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