Skip to content

fix(ci): destrava gates do main (seller-scope + TS2322 quoteService + non-null) [rebased]#421

Merged
adm01-debug merged 1 commit into
mainfrom
claude/fix-main-gates-rebased
May 26, 2026
Merged

fix(ci): destrava gates do main (seller-scope + TS2322 quoteService + non-null) [rebased]#421
adm01-debug merged 1 commit into
mainfrom
claude/fix-main-gates-rebased

Conversation

@adm01-debug
Copy link
Copy Markdown
Owner

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

Destrava os gates do CI no main (rebaseado sobre e14f8f0)

Supersede #413 (que tinha um fix redundante de useUserManagement — o main já corrigiu via untypedFrom — e estava sobre um main antigo). Esta PR está rebaseada sobre o main atual e corrige as regressões que bloqueiam todos os PRs no CI. Nenhuma foi introduzida por mim; confirmei rodando os gates contra o main puro.

Correções (3 arquivos)

  1. Seller-scope gateSidebarReorganized.tsx: a anotação // rls-allow: estava 2 linhas acima do .from('discount_approval_requests'); o checker só a aceita na linha do .from(...) ou imediatamente acima. Reposicionada. (Comportamento inalterado — segue admin-only via enabled: isAdmin.)
    • ⚠️ Este arquivo também aparece com reformatação do Prettier (o pre-commit hook formatou o arquivo, que não estava em conformidade no main). É só formatação — sem mudança de lógica.
  2. TypeScript gatequoteService.ts (logHistory): TS2322 ×4 vindos do feat(quotes): migrate updateQuote to transactional backend RPC #404. options?: Record<string,unknown> produzia {} ao inserir em colunas tipadas. Campos string agora narrowed via typeof; metadata cast para Json.
  3. ESLint baseline gateCoverageInsightsDashboardPage.tsx: removido non-null assertion redundante (acesso já guardado por values.length < 2).

Verificação local (todos verdes, sobre e14f8f0)

  • check-tsc-baseline.mjs: 484 vs 486 → ✅ sem regressão (−2)
  • check-eslint-baseline.mjs: ✅ sem regressão
  • check-seller-scope.mjs: ✅ pass

O main está acumulando regressões de baseline pela leva intensa de merges (#384#404) mais rápido do que são corrigidas. Recomendo, além desta PR, uma rodada dedicada de estabilização (ou reforçar os gates como required nos PRs de origem) para não repetir o ciclo.

Test plan

  • CI verde nos 3 gates que estavam vermelhos no main
  • Admin → Usuários e badge de aprovações pendentes seguem OK
  • Histórico de orçamento (logHistory) grava normalmente

Fecha #413.

https://claude.ai/code/session_01HjiGVkF3Df9GiFjDbfxDYn


Generated by Claude Code


Summary by cubic

Unblocks CI on main by fixing the seller-scope check, TypeScript TS2322 errors in quoteService, and an ESLint non-null assertion. No behavior changes.

  • Bug Fixes
    • Seller-scope: Move // rls-allow to the line above .from('discount_approval_requests') so the checker picks it up; logic unchanged. Includes Prettier-only formatting in the file.
    • TypeScript: Resolve TS2322 in quoteService.logHistory by narrowing string fields and casting metadata to Json.
    • ESLint: Remove redundant non-null assertion in CoverageInsightsDashboardPage.

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

…TS2322 quoteService)

Rebaseado sobre o main atual (e14f8f0). Regressões pré-existentes que bloqueavam
todos os PRs no CI (nenhuma introduzida por mim):

- SidebarReorganized.tsx: anotação `// rls-allow` reposicionada para
  imediatamente acima do `.from('discount_approval_requests')` (o checker não a
  reconhecia 2 linhas acima). Sem mudança de comportamento.
- CoverageInsightsDashboardPage.tsx: removido non-null assertion redundante
  (acesso já guardado por `values.length < 2`).
- quoteService.ts (logHistory): `options?: Record<string,unknown>` gerava `{}`
  ao inserir em colunas tipadas (TS2322 ×4, vindo do #404). Campos string agora
  são narrowed via typeof; `metadata` cast para `Json`.

Nota: o fix anterior de useUserManagement.ts foi descartado — o main já corrigiu
via `untypedFrom`.

Gates verdes localmente: tsc 484/486 (sem regressão), eslint (sem regressão),
seller-scope (pass).

https://claude.ai/code/session_01HjiGVkF3Df9GiFjDbfxDYn
@supabase
Copy link
Copy Markdown

supabase Bot commented May 26, 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 26, 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 26, 2026 2:25am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Warning

Review limit reached

@adm01-debug, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 30 minutes and 54 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9fae5b65-aea1-4ac3-ac3d-6ce4051b00c3

📥 Commits

Reviewing files that changed from the base of the PR and between ea1a853 and 46278aa.

📒 Files selected for processing (3)
  • src/components/layout/SidebarReorganized.tsx
  • src/pages/tools/CoverageInsightsDashboardPage.tsx
  • src/services/quoteService.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/fix-main-gates-rebased

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

@adm01-debug adm01-debug marked this pull request as ready for review May 26, 2026 02:29
Copilot AI review requested due to automatic review settings May 26, 2026 02:29
@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.

@adm01-debug adm01-debug merged commit 692a25e into main May 26, 2026
44 of 48 checks passed
@adm01-debug adm01-debug deleted the claude/fix-main-gates-rebased branch May 26, 2026 02:29
@adm01-debug adm01-debug review requested due to automatic review settings May 26, 2026 02:54
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