Skip to content

fix(webapp): Vercel env var sync rejecting batches containing only reserved keys#3966

Merged
0ski merged 1 commit into
mainfrom
oskar/fix-vercel-sync-reserved-env-vars
Jun 16, 2026
Merged

fix(webapp): Vercel env var sync rejecting batches containing only reserved keys#3966
0ski merged 1 commit into
mainfrom
oskar/fix-vercel-sync-reserved-env-vars

Conversation

@0ski

@0ski 0ski commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Fix Vercel onboarding wizard to properly filter out reserved TRIGGER_ env vars

@changeset-bot

changeset-bot Bot commented Jun 16, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c978c4e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@0ski 0ski marked this pull request as ready for review June 16, 2026 12:37
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: cccd586e-5e59-4f33-b412-a6d554e881c4

📥 Commits

Reviewing files that changed from the base of the PR and between 22d7ae2 and c978c4e.

📒 Files selected for processing (5)
  • .server-changes/vercel-sync-reserved-env-vars.md
  • apps/webapp/app/models/vercelIntegration.server.ts
  • apps/webapp/app/presenters/v3/VercelSettingsPresenter.server.ts
  • apps/webapp/app/v3/environmentVariableRules.server.ts
  • apps/webapp/test/environmentVariableRules.test.ts
✅ Files skipped from review due to trivial changes (1)
  • .server-changes/vercel-sync-reserved-env-vars.md
🚧 Files skipped from review as they are similar to previous changes (4)
  • apps/webapp/app/models/vercelIntegration.server.ts
  • apps/webapp/app/presenters/v3/VercelSettingsPresenter.server.ts
  • apps/webapp/app/v3/environmentVariableRules.server.ts
  • apps/webapp/test/environmentVariableRules.test.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 10)
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 10)
  • GitHub Check: typecheck / typecheck

Walkthrough

The pull request centralizes environment variable filtering logic in environmentVariableRules.server.ts by exporting two new functions: isBlacklistedVariable, which encapsulates the existing whitelist/exact/prefix blacklist checks, and isReservedForExternalSync, which extends that logic with an additional reserved key list containing TRIGGER_VERSION and TRIGGER_PREVIEW_BRANCH. The existing removeBlacklistedVariables function is refactored to call isBlacklistedVariable instead of duplicating the predicate inline. Both the Vercel sync pipeline (vercelIntegration.server.ts) and the onboarding presenter (VercelSettingsPresenter.server.ts) replace their hardcoded exclusions of TRIGGER_SECRET_KEY/TRIGGER_VERSION with calls to isReservedForExternalSync. New tests cover the behavior of both exported helpers. A changelog entry documents the fix to prevent reserved environment variable keys from leaking during Vercel sync and onboarding preview operations.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is minimal and does not follow the required template structure with checklist, testing, changelog, and other sections. Complete the PR description using the repository template, including the checklist, testing steps, changelog, and screenshots sections.
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main fix: preventing Vercel env var sync from rejecting batches that contain only reserved keys.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch oskar/fix-vercel-sync-reserved-env-vars

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.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@0ski 0ski force-pushed the oskar/fix-vercel-sync-reserved-env-vars branch from ea346c0 to 6d8fe4b Compare June 16, 2026 13:39
devin-ai-integration[bot]

This comment was marked as resolved.

@0ski 0ski force-pushed the oskar/fix-vercel-sync-reserved-env-vars branch from 87f05a8 to 22d7ae2 Compare June 16, 2026 14:20
@0ski 0ski self-assigned this Jun 16, 2026
The Vercel integration pre-filter excluded only TRIGGER_SECRET_KEY/TRIGGER_VERSION,
while the env var repository blacklists TRIGGER_SECRET_KEY/TRIGGER_API_URL. When a
user's Vercel project had TRIGGER_API_URL set and it was the only var to sync for a
target, it was submitted, stripped as blacklisted, and the whole batch was rejected
with "You must set at least one valid variable.".

Derive the Vercel sync exclusion set from the canonical blacklist via a new
isReservedForExternalSync() helper so the two can no longer drift.

Fixes TRIGGER-CLOUD-1HV

fix: reserve TRIGGER_PREVIEW_BRANCH from external sync
@0ski 0ski force-pushed the oskar/fix-vercel-sync-reserved-env-vars branch from 22d7ae2 to c978c4e Compare June 16, 2026 14:22
@pkg-pr-new

pkg-pr-new Bot commented Jun 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

@trigger.dev/build

npm i https://pkg.pr.new/@trigger.dev/build@22d7ae2

trigger.dev

npm i https://pkg.pr.new/trigger.dev@22d7ae2

@trigger.dev/core

npm i https://pkg.pr.new/@trigger.dev/core@22d7ae2

@trigger.dev/python

npm i https://pkg.pr.new/@trigger.dev/python@22d7ae2

@trigger.dev/react-hooks

npm i https://pkg.pr.new/@trigger.dev/react-hooks@22d7ae2

@trigger.dev/redis-worker

npm i https://pkg.pr.new/@trigger.dev/redis-worker@22d7ae2

@trigger.dev/rsc

npm i https://pkg.pr.new/@trigger.dev/rsc@22d7ae2

@trigger.dev/schema-to-json

npm i https://pkg.pr.new/@trigger.dev/schema-to-json@22d7ae2

@trigger.dev/sdk

npm i https://pkg.pr.new/@trigger.dev/sdk@22d7ae2

commit: 22d7ae2

@0ski 0ski enabled auto-merge (squash) June 16, 2026 14:43
@0ski 0ski merged commit cf4aa7e into main Jun 16, 2026
30 checks passed
@0ski 0ski deleted the oskar/fix-vercel-sync-reserved-env-vars branch June 16, 2026 14:43
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