feat(fuzz): combinações de parâmetros críticos e execução paralela por Edge Functions#384
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 37 minutes and 17 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 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bea7f64c01
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return { fn: spec.name, crashes: fnCrashes, timeouts: fnTimeouts, stackLeaks: fnStackLeaks, issues: fnIssues }; | ||
| } | ||
|
|
||
| for (let i = 0; i < FUNCTION_SPECS.length; i += FUNCTION_CONCURRENCY) { |
There was a problem hiding this comment.
Guard function chunk size against non-positive values
If FUZZ_FUNCTION_CONCURRENCY is set to a negative number, FUNCTION_CONCURRENCY keeps that value (Number(env) || 3 treats negatives as truthy) and this loop never terminates because i decreases on each iteration. In CI or scripted runs with a bad env value, the fuzz job will hang indefinitely before producing a final report; clamp this setting to >= 1 (or fall back to default when invalid).
Useful? React with 👍 / 👎.
| if (issues.length > 0) { | ||
| console.log(` ❌ ${issues.join(" | ")} — payload: ${JSON.stringify(batch[j])?.substring(0, 80)}`); | ||
| allIssues.push({ fn: spec.name, issues }); | ||
| fnIssues.push({ payload: batch[j], issues }); |
There was a problem hiding this comment.
Avoid retaining full failing payloads in issue accumulator
The new aggregation path stores each failing payload object (fnIssues.push({ payload: batch[j], issues })) but only uses per-function counts at the end, so large fuzz inputs (e.g., 10k/100k strings and 500-item arrays generated in this script) are kept in memory unnecessarily for the whole run. When many requests fail—as is common during fuzzing—this can sharply increase memory usage and destabilize long test runs without adding reporting value.
Useful? React with 👍 / 👎.
…ull assertion Regressões pré-existentes no main (introduzidas pela leva #384–#399) que bloqueavam TODOS os PRs no CI: - SidebarReorganized.tsx: anotação `// rls-allow` estava acima de `const … await supabase`, não imediatamente acima do `.from(...)`, então o seller-scope checker não a reconhecia. Movida para a linha correta. - useUserManagement.ts: o embed `user_roles(role)` não é reconhecido pelos tipos gerados do Supabase, gerando TS2589 (instanciação profunda) e TS2352 (cast de SelectQueryError). Corrigido com select tipado como string + `.returns<ProfileWithRoles[]>()` e remoção do cast redundante. - CoverageInsightsDashboardPage.tsx: removido non-null assertion redundante (acesso já guardado por `values.length < 2`). Gates verdes localmente: tsc (484 vs 486, -2), eslint (sem regressão), seller-scope (pass). https://claude.ai/code/session_01HjiGVkF3Df9GiFjDbfxDYn
…ull assertion (#413) Regressões pré-existentes no main (introduzidas pela leva #384–#399) que bloqueavam TODOS os PRs no CI: - SidebarReorganized.tsx: anotação `// rls-allow` estava acima de `const … await supabase`, não imediatamente acima do `.from(...)`, então o seller-scope checker não a reconhecia. Movida para a linha correta. - useUserManagement.ts: o embed `user_roles(role)` não é reconhecido pelos tipos gerados do Supabase, gerando TS2589 (instanciação profunda) e TS2352 (cast de SelectQueryError). Corrigido com select tipado como string + `.returns<ProfileWithRoles[]>()` e remoção do cast redundante. - CoverageInsightsDashboardPage.tsx: removido non-null assertion redundante (acesso já guardado por `values.length < 2`). Gates verdes localmente: tsc (484 vs 486, -2), eslint (sem regressão), seller-scope (pass). https://claude.ai/code/session_01HjiGVkF3Df9GiFjDbfxDYn Co-authored-by: Claude <noreply@anthropic.com>
Motivation
Description
FUZZ_FUNCTION_CONCURRENCYeFUZZ_MAX_COMBINATIONSe aumenta oFUZZ_CONCURRENCYpadrão para melhorar paralelismo e controle de combinações por função.pickecombinee altera geradores para produzir combinações direcionadas (ex.:generateCnpjLookupPayloadsegenerateProductWebhookPayloads) com limite configurável por função.runFunctionSpece execução paralela de chunks de funções controlada porFUNCTION_CONCURRENCY, mantendo paralelismo por batch de payloads (CONCURRENCY).allIssuese impressão de um resumo agregado de falhas por função ao final do relatório mantendo o comportamentodry-runquando não há credenciais.Testing
node scripts/fuzz-testing.mjsem modoDRY-RUNe a execução completou com sucesso sem crashes, timeouts ou stack leaks.Payloads gerados: 262eRequests enviados: 0no modo dry-run confirmando a geração e validação estrutural dos payloads.dry-runpermanece intacto quandoSUPABASE_URL/SERVICE_ROLE_KEYnão estão presentes.Codex Task
Summary by cubic
Adds targeted parameter combinations and per-function parallel execution in the fuzz tester to raise coverage and cut runtime. Includes aggregated failure reporting and new env controls.
FUZZ_FUNCTION_CONCURRENCY,FUZZ_MAX_COMBINATIONS; defaultFUZZ_CONCURRENCYincreased to 6.pickandcombine; generators updated (e.g.,generateCnpjLookupPayloads,generateProductWebhookPayloads) to focus on critical fields with per-function limits.FUZZ_FUNCTION_CONCURRENCY, batch payloads byFUZZ_CONCURRENCY.Written for commit bea7f64. Summary will update on new commits. Review in cubic