[cli] Add --id flag to build and env pull for deployment-scoped env vars#15805
[cli] Add --id flag to build and env pull for deployment-scoped env vars#15805
Conversation
🦋 Changeset detectedLatest commit: 3c38cfb The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
📦 CLI Tarball ReadyThe Vercel CLI tarball for this PR is now available! Quick TestYou can test this PR's CLI directly by running: npx https://vercel-b2n2zalyx.vercel.sh/tarballs/vercel.tgz --helpUse in vercel.jsonTo use this CLI version in your project builds, add to your {
"build": {
"env": {
"VERCEL_CLI_VERSION": "vercel@https://vercel-b2n2zalyx.vercel.sh/tarballs/vercel.tgz"
}
}
}Python Runtime WheelA Python Workers WheelA |
🧪 Unit Test StrategyComparing: Strategy: Code changed outside of a package - running all unit tests Affected packages - 15 (38%)
Unaffected packages - 25 (63%)
Results
This comment is automatically generated based on the affected testing strategy |
|
Low Risk — CLI feature addition — new optional --id flag for fetching deployment-scoped env vars.
Assessed at 3c38cfb. |
3dfd1e8 to
29fb7ce
Compare
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## [email protected] ### Minor Changes - Add `vercel tokens` subcommands (`ls`, `add`, `rm`) for auth token API parity with the dashboard. ([#15812](#15812)) - Add `vercel project access-summary` subcommand to list member counts by role for a project. ([#15813](#15813)) - Add `vercel project members` and `vercel project access-groups` commands, and fix `vercel teams members` to fetch all pages from the paginated team members API. ([#15786](#15786)) ### Patch Changes - Add `--id` flag to `vercel build` and `vercel env pull` to fetch deployment-scoped environment variables ([#15805](#15805)) - Updated dependencies \[]: - @vercel/[email protected] ## @vercel/[email protected] ### Minor Changes - Add Mastra framework preset ([#15076](#15076)) ## @vercel/[email protected] ### Patch Changes - Updated dependencies \[[`d034d90dcf78316ddacdcce8fd51329fb7eefe82`](d034d90)]: - @vercel/[email protected] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Context
For the BYOC workflow,
vercel buildneeds access to the same environment variables that the build-container receives. Currently it loads env vars from local.envfiles created byvercel pull, which miss deployment-specific vars (integration overrides, system vars likeVERCEL_URL/VERCEL_DEPLOYMENT_ID, LaunchDarkly flags, etc.).This adds
--idsupport to bothvercel buildandvercel env pullso they can fetch the fully resolved env vars stored on a specific deployment.Changes
--idflag tovercel build— when provided, fetchesbuildEnvfrom the deployment via the env pull API instead of loading from local.envfiles. Polls if integrations are still provisioning (checksintegrationsStatusin the error response, 5s interval, 3min timeout matching the API).--idflag tovercel env pull— when provided, fetches env from the deployment in one shot (no polling). Writes to file same as before.pullEnvRecords()to accept deployment IDs — skips target/gitBranch path segments when the ID starts withdpl_.--idoption in both commands.References
pull-env-varsendpoint to accept deployment IDs)