Skip to content

fix(installer): valida formato da DB URL antes de usar nas migrations - #59

Open
felipetruman wants to merge 1 commit into
thaleslaray:mainfrom
felipetruman:fix/installer-dburl-validation
Open

fix(installer): valida formato da DB URL antes de usar nas migrations#59
felipetruman wants to merge 1 commit into
thaleslaray:mainfrom
felipetruman:fix/installer-dburl-validation

Conversation

@felipetruman

Copy link
Copy Markdown

Problema

No provision, dbUrl é construída por buildPoolerDbUrl/buildDirectDbUrl mas o formato final nunca é validado (só logado com hasDbUrl: !!dbUrl). Se os componentes vierem vazios/malformados (projectRef ou dbPass ausentes), a URL fica inválida e só quebra mais tarde, dentro das migrations, com erro obscuro difícil de diagnosticar no wizard.

Correção

Fail-fast logo após a resolução: se dbUrl está setada mas não casa com postgres://user:pass@host/db, aborta com mensagem clara apontando projectRef/dbPass.

  • URL vazia continua permitida (caminho "sem dbPass + pooler indisponível → migrations puladas", já tratado acima).
  • Sem mudança de schema, sem migration.

Test plan

  • Provision com dbPass válido → passa, migrations rodam.
  • Forçar dbUrl malformada → aborta no Step 5 com mensagem clara (antes era erro genérico nas migrations).

dbUrl é construída via buildPoolerDbUrl/buildDirectDbUrl mas o formato
final nunca era validado. Componentes vazios (projectRef/dbPass ausentes
ou malformados) geravam uma URL inválida que só quebrava depois, nas
migrations, com erro obscuro.

Adiciona fail-fast: se dbUrl está setada mas não casa com
postgres://user:pass@host/db, aborta o provision com mensagem clara.
URL vazia continua permitida (caminho "migrations puladas" já tratado).
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

@felipetruman is attempting to deploy a commit to the Thales Laray Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

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

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 72b5972f-7e05-483e-929f-a50ca208e23f

📥 Commits

Reviewing files that changed from the base of the PR and between 17c69e2 and 1633e73.

📒 Files selected for processing (1)
  • app/api/installer/provision/route.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

1 participant