fix(env-upload): surface Vercel env var upload failures instead of skipping silently - #936
Draft
MattBro wants to merge 2 commits into
Draft
fix(env-upload): surface Vercel env var upload failures instead of skipping silently#936MattBro wants to merge 2 commits into
MattBro wants to merge 2 commits into
Conversation
…ipping silently The wizard wrote env vars to local .env files and, when no environment provider passed detect(), returned silently. A project that deploys to Vercel but has no usable CLI got no PostHog events in production and no indication anything was missing. Detect Vercel deploy markers (vercel.json, .vercel/) independently of CLI availability, so a skip on a Vercel-marked repo prints the failing cause (CLI missing / project unlinked / not authenticated), the env var key names, and the vercel env add commands to run. Values stay out of the output. The outro's change list gains a matching follow-up line, and the skip event carries deploy_target/skip_cause alongside a new vercel-markers-found tag so the deployer share is measurable. Also upsert on conflict: uploadEnvironmentVariable now removes and re-adds a variable Vercel reports as already existing, rather than failing the upload and telling the user to do it by hand. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Results will be posted here when complete. |
Review fixes: the remove-then-readd upsert path now retries once and names the data loss plainly if the re-add still fails; a detected provider whose uploads all fail now produces the same loud skip and telemetry as a missing provider instead of returning silently; the outro warning wiring is extracted into a tested helper pair. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LV8ErU3QavwTp2oMe9VSLS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the wizard finishes an install it tries to upload the env vars to the user's hosting provider (Vercel is the only provider today). That upload is skipped far more often than it succeeds — over the last 30 days: 5,504
wizard: env upload skippedevents vs 414wizard: env uploaded, and the skip event carries a single generic reason ("no environment provider found") with no detail on why.The skip is also silent for the user. If they deploy to Vercel without copying the vars themselves, the deployed site sends no events, and nothing during the wizard run warned them. This is a recurring theme in wizard feedback: analytics that work locally and are silently dead in production.
Changes
EnvUploadSkip) when a project looks like it deploys to a provider but the upload can't run, with a typed cause:cli-missing,project-unlinked, orunauthenticated.describeSkip(); the Vercel provider detects Vercel markers (vercel.json,.vercel/, etc.) and reports which precondition failed.deploy_targetandskip_causeproperties so the skip population becomes attributable, and successful uploads reportvariable_count/variable_keys.skip_cause: upload-failed) instead of a silent return, andenv uploadedno longer fires when nothing was uploaded.Test plan
pnpm test), including new tests for skip detection, the upload-failed path, the rm-then-readd failure path, and the outro warning wiring.pnpm run lint— no errors.