Skip to content

[cli] Preserve --environment in web UI fallback URLs#15493

Merged
qiao merged 6 commits intomainfrom
cli/environment-web-ui-passthrough
Mar 13, 2026
Merged

[cli] Preserve --environment in web UI fallback URLs#15493
qiao merged 6 commits intomainfrom
cli/environment-web-ui-passthrough

Conversation

@qiao
Copy link
Copy Markdown
Member

@qiao qiao commented Mar 12, 2026

Summary

https://linear.app/vercel/issue/MKT-2932/pre-fill-web-fallback-ui-with-environment-and-prefix-is-these-flags

When integration add falls back to the browser (unsupported product, non-subscription billing plan, or auto-provision 422), the --environment flag was being dropped. This threads it through as an environment query param so the checkout page can pre-select the correct environments.

  • add.ts: pass environments to provisionResourceViaWebUI and append to URL
  • add-auto-provision.ts: append environment param to fallback URL
  • Tests for all three fallback scenarios

Related PRs

Follows the same pattern established by:

Test plan

  • Unit test: auto-provision fallback includes environment param
  • Unit test: unsupported product web UI includes environment param
  • Unit test: non-subscription plan web UI includes environment param

When `integration add` falls back to the browser (unsupported product,
non-subscription plan, or auto-provision 422), the user's --environment
selection was being dropped. Thread it through as an `environment` query
param so the checkout page can pre-select the correct environments.
@qiao qiao requested review from a team as code owners March 12, 2026 17:15
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 12, 2026

🦋 Changeset detected

Latest commit: 6a3c1ed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
vercel Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 12, 2026

📦 CLI Tarball Ready

The Vercel CLI tarball for this PR is now available!

Quick Test

You can test this PR's CLI directly by running:

npx https://vercel-r0sx7iekg.vercel.sh/tarballs/vercel.tgz --help

Use in vercel.json

To use this CLI version in your project builds, add to your vercel.json:

{
  "build": {
    "env": {
      "VERCEL_CLI_VERSION": "vercel@https://vercel-r0sx7iekg.vercel.sh/tarballs/vercel.tgz"
    }
  }
}

Python Runtime Wheel

A vercel-runtime wheel was also built for this PR.
To use in your Python project builds, also set this environment variable:

VERCEL_RUNTIME_PYTHON="vercel-runtime @ https://vercel-r0sx7iekg.vercel.sh/tarballs/vercel_runtime-0.9.0.dev1773435860+6a3c1ed-py3-none-any.whl"

Python Workers Wheel

A vercel-workers wheel was also built for this PR.
To use in your Python project builds, also set this environment variable:

VERCEL_WORKERS_PYTHON="vercel-workers @ https://vercel-r0sx7iekg.vercel.sh/tarballs/vercel_workers-0.1.0.dev1773435860+6a3c1ed-py3-none-any.whl"

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 12, 2026

🧪 Unit Test Strategy

Comparing: d8c186e6a3c1ed (view diff)

Strategy: Affected packages only

✅ Only testing packages that have been modified or depend on modified packages.

Affected packages - 1 (3%)
  1. vercel
Unaffected packages - 39 (98%)
  1. @vercel-internals/get-package-json
  2. @vercel/backends
  3. @vercel/build-utils
  4. @vercel/cervel
  5. @vercel/cli-auth
  6. @vercel/client
  7. @vercel/config
  8. @vercel/detect-agent
  9. @vercel/edge
  10. @vercel/elysia
  11. @vercel/error-utils
  12. @vercel/express
  13. @vercel/fastify
  14. @vercel/firewall
  15. @vercel/frameworks
  16. @vercel/fs-detectors
  17. @vercel/functions
  18. @vercel/gatsby-plugin-vercel-builder
  19. @vercel/go
  20. @vercel/h3
  21. @vercel/hono
  22. @vercel/hydrogen
  23. @vercel/koa
  24. @vercel/nestjs
  25. @vercel/next
  26. @vercel/node
  27. @vercel/oidc
  28. @vercel/oidc-aws-credentials-provider
  29. @vercel/python
  30. @vercel/python-analysis
  31. @vercel/redwood
  32. @vercel/related-projects
  33. @vercel/remix-builder
  34. @vercel/routing-utils
  35. @vercel/ruby
  36. @vercel/rust
  37. @vercel/static-build
  38. @vercel/static-config
  39. examples

Results

  • Unit tests: Only affected packages will run unit tests
  • E2E tests: Running in parallel via E2E Tests workflow
  • Type checks: Only affected packages will run type checks

This comment is automatically generated based on the affected testing strategy

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 12, 2026

Low Risk — CLI URL param passthrough + tests — no auth, billing logic, or schema changes.

  • add.ts: pass environmentstoprovisionResourceViaWebUI`, append as query param
  • add-auto-provision.ts: append environment` query param to fallback URL
  • add*.test.ts`: add tests for environment param in fallback URLs

Assessed at 6a3c1ed.

Copy link
Copy Markdown
Contributor

@tonypan2 tonypan2 left a comment

Choose a reason for hiding this comment

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

See inline comments.

🤖 Written by Claude Code on behalf of @tonypan

@qiao qiao merged commit 8ee6645 into main Mar 13, 2026
178 checks passed
@qiao qiao deleted the cli/environment-web-ui-passthrough branch March 13, 2026 21:20
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