Skip to content

fix(infra): decodifica .env.example de base64 — 4º caso do bug Lovable#467

Merged
adm01-debug merged 1 commit into
mainfrom
fix/decode-env-example-base64-20260526
May 26, 2026
Merged

fix(infra): decodifica .env.example de base64 — 4º caso do bug Lovable#467
adm01-debug merged 1 commit into
mainfrom
fix/decode-env-example-base64-20260526

Conversation

@adm01-debug
Copy link
Copy Markdown
Owner

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

🎯 Validação end-to-end do detector base64 + hotfix real

Este PR é simultaneamente:

  1. Hotfix de bug real.env.example estava em base64 (5824 chars, 1 linha)
  2. Primeiro teste end-to-end do workflow detect-base64-content.yml em um PR de verdade

O bug

Logo após mergear o PR #462 (que introduziu o detector), rodei a heurística contra o repo inteiro como parte da bateria de testes. Resultado:

=== Detector base64 em TODO o repo (HEAD = c24c2a1) ===
Arquivos escaneados: 3745
Violações encontradas: 1
  ⚠️ .env.example:1 (5824 chars)

Decodificando:

$ base64 -d < .env.example
# ============================================================================
# PromoGifts — Variáveis de ambiente do FRONTEND
# ============================================================================
# Todas as vars VITE_* são INLINEADAS no bundle do browser durante o build.
...
VITE_SUPABASE_URL=https://doufsxqlfjyuvxuezpln.supabase.co
VITE_SUPABASE_PROJECT_ID=doufsxqlfjyuvxuezpln
... (99 linhas, 4368 bytes)

São 99 linhas reais de configuração de ambiente. Foi commitado em algum momento (provavelmente por outro commit do Lovable em sessão anterior) e ninguém percebeu.

Por que ninguém pegou antes

É a 4ª ocorrência do mesmo padrão

PR Arquivo Resultado
#319 lint-untyped-from.sh + supabase-untyped.ts Quebrou compilação
#457 Mesmos arquivos reintroduzidos Quebrou de novo
#459 vercel.json + BUG_REPORT_20260526.md Quebrou 20 deploys Vercel
#463 (este) .env.example Silencioso (não bloqueava build)

Sanity checks

  • ✅ Conteúdo decodificado tem VITE_SUPABASE_URL e 16 outras vars esperadas
  • ✅ Sem secrets reais — apenas placeholders (sb_publishable_<your-anon-key-here>)
  • ✅ Run local do detector contra o arquivo decodificado: 0 violações
  • ✅ O detect-base64-content.yml deste PR deve passar verde

O que esperar do CI

O workflow Detect Base64-Encoded Content deve:

  • Rodar em pull_request automaticamente
  • Escanear apenas arquivos modificados no diff (no caso: .env.example)
  • Passar verde porque o conteúdo agora está em texto plano
  • Aparecer como check separado no PR (não bloqueante até virar required)

Se o workflow falhar contra este PR, é bug NO workflow — me avise.


🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com


Summary by cubic

Decoded .env.example from base64 to plain text so the template is readable and passes the detect-base64-content.yml check. This fixes a real repo file and runs the detector end-to-end on a live PR.

  • Bug Fixes
    • Replaced the base64 one-liner with a 99-line, human-readable env template (VITE_*, Sentry, feature flags, infra placeholders). No secrets included.
    • Local scan reports 0 violations; CI will scan the changed file and pass.

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

O workflow detect-base64-content.yml (introduzido no PR #462) detectou
.env.example salvo como uma única linha de 5824 chars de alfabeto base64
puro. Decodificando: 99 linhas de configuração legítima do FRONTEND
(VITE_SUPABASE_URL, VITE_SENTRY_DSN, feature flags, etc).

Mesmo padrão dos PRs #319, #457, #459. Quarta ocorrência em ~14 dias.

Co-authored-by: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 26, 2026 16: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.

@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 4:30pm

@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 ↗︎.

@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 16 minutes and 16 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: 50bc2ad8-78d3-453e-84e2-d4ed102bcf62

📥 Commits

Reviewing files that changed from the base of the PR and between efec57a and ba2f447.

📒 Files selected for processing (1)
  • .env.example
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/decode-env-example-base64-20260526

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

Decodifica o arquivo .env.example que estava commitado como uma única linha em base64, restaurando um template legível de variáveis de ambiente e validando end-to-end o workflow de detecção de conteúdo base64 no CI.

Changes:

  • Substitui o conteúdo base64 de .env.example por um template em texto plano com seções de variáveis Vite/Supabase, observabilidade e secrets server-side.
  • Mantém placeholders (sem secrets reais) e orientações de uso (.env.local / não commitar secrets).

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

Comment thread .env.example
# Obtenha a key em: Dashboard → Settings → API → Project API keys → anon public
VITE_SUPABASE_PUBLISHABLE_KEY=sb_publishable_<your-anon-key-here>

# ----------------------------------------------------------------------------
Comment thread .env.example
EXTERNAL_SUPABASE_SERVICE_KEY=
EXTERNAL_SUPABASE_ANON_KEY=
CRM_SUPABASE_URL=
CRM_SUPABASE_SERVICE_KEY=
@adm01-debug adm01-debug merged commit 8969f0b into main May 26, 2026
44 of 48 checks passed
@adm01-debug adm01-debug deleted the fix/decode-env-example-base64-20260526 branch May 29, 2026 13:37
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