Skip to content

Harden Vitest backend env isolation for v0 project config parity - #1813

Draft
groupthinking with Copilot wants to merge 2 commits into
mainfrom
copilot/update-project-files
Draft

Harden Vitest backend env isolation for v0 project config parity#1813
groupthinking with Copilot wants to merge 2 commits into
mainfrom
copilot/update-project-files

Conversation

Copilot AI commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Canonical issue

Linked automatically by the system.

Outcome

This PR closes a project-file gap where NEXT_PUBLIC_* backend URLs could leak from shell/CI into web tests, causing non-hermetic behavior despite local test defaults.
Result: web route tests now stay deterministic under v0-style environment configuration.

Scope

  • Included:
    • Vitest env pinning: set NEXT_PUBLIC_BACKEND_URL and NEXT_PUBLIC_API_URL to '' in /apps/web/vitest.config.ts (alongside existing BACKEND_URL pin).
    • Regression guard: extended /apps/web/src/__tests__/test-env-isolation.test.ts to assert both NEXT_PUBLIC_* backend env vars are blank by default.
    • Example snippet:
      env: {
        BACKEND_URL: '',
        NEXT_PUBLIC_BACKEND_URL: '',
        NEXT_PUBLIC_API_URL: '',
      }
  • Explicitly excluded:
    • Production runtime behavior changes
    • API contract changes
    • Dependency or build pipeline changes

Risk

  • Risk level: low
  • Failure mode: tests may fail if future config intentionally relies on ambient NEXT_PUBLIC_* backend vars.
  • Rollback: revert the two touched files (apps/web/vitest.config.ts, apps/web/src/__tests__/test-env-isolation.test.ts).

Verification

List exact automated and manual checks, tied to the current head SHA.

  • Focused tests
  • Required CI
  • Review threads resolved

Production evidence

Not applicable: change is limited to test configuration and test assertions.

Agent handoff

  • One canonical issue is linked
  • No competing PR implements the same issue
  • Acceptance criteria are satisfied
  • Required checks pass on the current head
  • Human decision is requested only for product, security, irreversible infrastructure, or production approval

@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
v0-uvai Ready Ready Preview, v0 Sep 8, 2026 11:25pm UTC

Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Copilot AI changed the title [WIP] Update project files to reflect latest generated configuration Harden Vitest backend env isolation for v0 project config parity Sep 8, 2026
Copilot AI requested a review from groupthinking September 8, 2026 23:25
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.

Update project files

2 participants