chore(edge): deletar edge function órfã 'github-fix-config' (F1-1.x)#112
Conversation
A edge function 'github-fix-config' (170 linhas) era código de auditoria/setup abandonado. Critérios pra delete: - ❌ 0 chamadas no front (src/, tests/, e2e/) - ❌ 0 chamadas em outras edges -⚠️ Categoria 'dev' no edge-authz-manifest (claramente ferramenta de dev) -⚠️ Tentava modificar tsconfig.node.json via API GitHub — arquivo que foi deletado em #109 — então estava semanticamente quebrada de qualquer jeito - ✅ NÃO tem segredos próprios, só usa GITHUB_TOKEN/REPO/DEFAULT_BRANCH Mudanças: - Deletado: supabase/functions/github-fix-config/index.ts (170 linhas) - supabase/functions/_shared/edge-authz-manifest.ts (-1 entry) - supabase/functions/_shared/cors-snapshot.json (-1 entry) - supabase/functions/_shared/authorize.ts (atualizado comentário) - scripts/check-edge-structured-logging.mjs (-1 entry no array) Mantida: 'github-credentials-test' (TEM painel admin que usa, em src/components/admin/connections/GitHubCredentialsTester.tsx). Risk: 🟢 zero. Função zumbi, código já obsoleto. Test plan: - [x] 0 refs restantes em src/ scripts/ supabase/ .github/ - [x] cors-snapshot.json válido - [x] eslint baseline passa - [ ] Edge typecheck CI verde (com 1 função a menos) - [ ] CodeRabbit OK
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
💤 Files with no reviewable changes (3)
WalkthroughEste PR remove completamente o edge function ChangesRemoção do github-fix-config e Consolidação de Manifesto
Estimated code review effort🎯 2 (Simples) | ⏱️ ~10 minutos Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Remove uma Edge Function de dev (github-fix-config) que ficou órfã/zumbi após a remoção do tsconfig.node.json (PR #109), e ajusta os “SSOTs”/gates que listam funções existentes.
Changes:
- Deleta
supabase/functions/github-fix-config/index.ts(função órfã). - Remove a função dos snapshots/manifestos compartilhados (AuthZ e CORS).
- Atualiza o gate de CI de structured logging para não listar uma edge inexistente e ajusta comentário de contexto no
authorize.ts.
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 |
|---|---|
supabase/functions/github-fix-config/index.ts |
Remove a edge function órfã. |
supabase/functions/_shared/edge-authz-manifest.ts |
Remove a entrada de AuthZ da edge deletada. |
supabase/functions/_shared/cors-snapshot.json |
Remove a entrada de CORS snapshot da edge deletada. |
supabase/functions/_shared/authorize.ts |
Atualiza comentário que citava a edge removida. |
scripts/check-edge-structured-logging.mjs |
Remove a edge deletada da allowlist de legado. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // ---------------- Dev-only ---------------- | ||
| "secrets-manager": { category: "dev", rationale: "is_dev() inline check", enforcedBy: "custom" }, | ||
| "connection-tester": { category: "dev", rationale: "is_dev() inline check", enforcedBy: "custom" }, | ||
| "github-credentials-test": { category: "dev", rationale: "is_dev() inline check", enforcedBy: "custom" }, | ||
| "github-fix-config": { category: "dev", rationale: "Escreve no repo via PAT — dev only", enforcedBy: "shared-authorize" }, | ||
| "external-db-inspect": { category: "dev", rationale: "is_dev() inline check", enforcedBy: "custom" }, | ||
| "rls-audit": { category: "dev", rationale: "Auditoria via service-role + has_role inline", enforcedBy: "custom" }, |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5ecd9a8ca
ℹ️ 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".
| "allowOrigin": null | ||
| }, | ||
| { | ||
| "name": "health-check", |
There was a problem hiding this comment.
Regenerate the CORS snapshot metadata
Removing this function entry without regenerating the snapshot leaves cors-snapshot.json internally inconsistent: total and counts.shared still say 85 while the functions array now contains 84 entries. The CI workflow’s “CORS snapshot freshness” step (.github/workflows/ci.yml:155-158) runs node scripts/build-cors-snapshot.mjs --check, which compares those metadata fields against the generated snapshot, so this change should update the generated totals/counts along with the removed function entry.
Useful? React with 👍 / 👎.
Plano
Deletar a edge function
github-fix-config(170 linhas) que é órfã/zumbi.Critérios validados
src/,tests/,e2e/)edge-authz-manifesttsconfig.node.jsonque foi deletado)O que a função fazia
Tentava consertar
tsconfig.node.jsonvia GitHub API (PUT em/contents/tsconfig.node.json) comcomposite:truee semnoEmit. Era código de auditoria que provavelmente foi gerado automaticamente por um Claude/Lovable antigo pra resolver erros de TypeScript no config — algo que eu já fiz manualmente em #109.Mudanças
supabase/functions/github-fix-config/index.tssupabase/functions/_shared/edge-authz-manifest.tssupabase/functions/_shared/cors-snapshot.jsonsupabase/functions/_shared/authorize.tsscripts/check-edge-structured-logging.mjsTotal: 5 arquivos, +2/-181 linhas
NÃO mexido (deliberadamente)
github-credentials-test(também categoria "dev") — MANTIDA, tem painel admin chamando ela:src/components/admin/connections/GitHubCredentialsTester.tsxRisk
🟢 Zero. Função zumbi sem callers. Código já obsoleto após #109.
Test plan
src/,scripts/,supabase/,.github/após patchcors-snapshot.jsonainda é JSON válidoSummary by CodeRabbit
Notas de Lançamento