fix(www): clarify environment setup and configuration errors by dnywh · Pull Request #52050 · supabase/supabase · GitHub
Skip to content

fix(www): clarify environment setup and configuration errors - #52050

Open
dnywh wants to merge 3 commits into
masterfrom
dnywh/fix-changelog-dev-process
Open

dnywh wants to merge 3 commits into
masterfrom
dnywh/fix-changelog-dev-process

Conversation

@dnywh

@dnywh dnywh commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Missing environment variables cause inconsistent behaviour in www. Changelog throws an unclear authentication error, Events logs an unhelpful missing-key message, and Customer.io subscription routes repeat their own credential checks.

Solution

Add one shared check that names missing variables and links to the environment setup instructions. Use it in changelog, Events and both Customer.io clients. Subscription requests still return HTTP 500 when credentials are missing. Optional Notion events still log errors and let committed event content render, so an unavailable source does not fail the site build.

Document setup in the www README and add blank placeholders to the example environment file.

Before After
CleanShot 2026-10-21 at 12 15 57@2x CleanShot 2026-10-21 at 12 14 58@2x

Review instructions

  1. Pull this branch locally. Back up apps/www/.env.local outside the repository.
  2. Temporarily revert that apps/www/.env.local file to match apps/www/.env.local.example.
  3. Run pnpm dev:www from the repository root and open the local changelog. Expect the Next.js development error overlay to name the missing variables and link to the README setup instructions.
  4. Restore the original environment file and restart www. With valid credentials, the changelog should load normally.

@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
zone-www-dot-com Ready Ready Preview, v0 Oct 21, 2026 1:20am UTC
7 Skipped Deployments
Project Deployment Actions Updated
studio Ignored Ignored Oct 21, 2026 1:20am UTC
design-system Skipped Skipped Oct 21, 2026 1:20am UTC
docs Skipped Skipped Oct 21, 2026 1:20am UTC
kb Skipped Skipped Oct 21, 2026 1:20am UTC
studio-self-hosted Skipped Skipped Oct 21, 2026 1:20am UTC
studio-staging Skipped Skipped Oct 21, 2026 1:20am UTC
ui-library Skipped Skipped Oct 21, 2026 1:20am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: supabase/supabase/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e860babe-3da5-4e17-add0-73586b2e43c1
📥 Commits

Reviewing files that changed from the base of the PR and between e854b84 and 223fa4a.

📒 Files selected for processing: 10
  • apps/www/.env.local.example
  • apps/www/README.md
  • apps/www/app/api-v2/submit-form-newsletter/route.tsx
  • apps/www/app/api-v2/submit-form-security-newsletter/route.tsx
  • apps/www/app/api-v2/submit-form-subprocessor-updates/route.tsx
  • apps/www/lib/changelog-repo.ts
  • apps/www/lib/customerio.ts
  • apps/www/lib/events.ts
  • apps/www/lib/required-env.test.ts
  • apps/www/lib/required-env.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

The app adds a shared validator for missing or blank environment variables. Integration clients and newsletter routes update their credential handling, with tests and setup documentation covering the changes.

Changes: Environment Variable Validation

Layer / File(s) Summary
Define required environment checks
apps/www/lib/required-env.ts, apps/www/.env.local.example, apps/www/README.md
A shared validator reports missing or blank variable names and setup guidance. The example environment file and README document configuration and credential handling.
Validate integration credentials
apps/www/lib/changelog-repo.ts, apps/www/lib/customerio.ts, apps/www/lib/events.ts
Changelog and Customer.io clients use the shared validator. Notion Events validates its API key within its existing error-handling path.
Handle missing newsletter credentials
apps/www/app/api-v2/submit-form-newsletter/route.tsx, apps/www/app/api-v2/submit-form-security-newsletter/route.tsx, apps/www/app/api-v2/submit-form-subprocessor-updates/route.tsx, apps/www/lib/required-env.test.ts
Newsletter routes pass empty strings when Customer.io credentials are absent and use existing error handling. Tests cover environment validation and integration behavior.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: fsansalvadore, shaziyabandukia

Merge Risk: ⚪ Minimal · up to 223fa

The environment setup changes are mergeable based on the available evidence. The existing test configuration issue remains separate from this change.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 8 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main changes: improved www environment setup documentation and configuration error handling.
Description check Passed The description clearly explains the problem, solution, expected behavior, and numbered review procedure. The checklist section is omitted, but the core required information is complete.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 8 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@dnywh
dnywh requested a lite review from Copilot October 21, 2026 01:14
@dnywh
dnywh marked this pull request as ready for review October 21, 2026 01:14
@dnywh
dnywh requested a review from a team as a code owner October 21, 2026 01:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Only non-blocking nits remain regarding static changelog-build diagnostics.

No open issues 🎉

What changed in this PR

Improves www environment configuration diagnostics and setup guidance.

Changes:

  • Adds shared missing-environment-variable validation.
  • Applies validation across Events, changelog, and Customer.io integrations.
  • Documents setup and updates example environment placeholders.
File Description
apps/​www/​README.md Documents environment setup; static changelog builds retain a legacy diagnostic path (nit).
apps/​www/​lib/​required-env.ts Adds shared environment validation.
apps/​www/​lib/​required-env.test.ts Tests validation and integrations.
apps/​www/​lib/​events.ts Handles optional Notion configuration failures gracefully.
apps/​www/​lib/​customerio.ts Validates Customer.io credentials.
apps/​www/​lib/​changelog-repo.ts Validates changelog credentials; static builds retain a legacy diagnostic path (nit).
apps/​www/​app/​api-v2/​submit-form-subprocessor-updates/​route.tsx Uses shared Customer.io validation.
apps/​www/​app/​api-v2/​submit-form-security-newsletter/​route.tsx Uses shared Customer.io validation.
apps/​www/​app/​api-v2/​submit-form-newsletter/​route.tsx Uses shared Customer.io validation.
apps/​www/​.env.local.example Adds credential placeholders.

Review effort: Lite

This branch has not been deployed

No deployments
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