Repository navigation
fix(cli): support installation-level metadata for integration add - #15444
Conversation
🦋 Changeset detectedLatest commit: bfcd0c8 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-hkolxtjaa.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-hkolxtjaa.vercel.sh/tarballs/vercel.tgz"
}
}
}Python Runtime WheelA Python Workers WheelA |
🧪 Unit Test StrategyComparing: Strategy: Affected packages only ✅ Only testing packages that have been modified or depend on modified packages. Affected packages - 1 (3%)
Unaffected packages - 39 (98%)
Results
This comment is automatically generated based on the affected testing strategy |
40c6c81 to
971d7a0
Compare
971d7a0 to
d33d5b4
Compare
d33d5b4 to
d6790f7
Compare
ad9ee3e to
39c0eaa
Compare
39c0eaa to
665d1ba
Compare
665d1ba to
24e9ef7
Compare
Integrations like Sentry have two metadata schemas: - Integration-level (e.g. name, region) for installation creation - Product-level (e.g. platform) for resource provisioning The CLI now merges both schemas so: - `--help` shows all metadata fields (installation + product) - `-m` flags accept installation-level keys without erroring - All metadata is sent to the auto-provision API in a single flat object The API (vercel/api#62975) extracts installation-level fields using the integration's metadataSchema.properties keys. Linear: MKT-2913 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
When `vc integration add <slug>` falls back to the browser because required metadata fields were not provided via -m flags, the CLI now shows which fields are missing and how to provide them, instead of just "Additional setup required." Example: `vc integration add sentry` without -m flags now shows: > Missing required metadata: name, region, platform. Opening browser... > Tip: Provide -m name=<value> -m region=us -m platform=javascript-nextjs > Run `vercel integration add sentry --help` for all metadata options. Server-handled fields (e.g. vercel-region) are excluded from the hint since the server fills defaults for those. Linear: MKT-3088 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…d arrays - Forward installationMetadata to browser fallback URL so installation-level config (e.g. Sentry region) isn't silently lost on browser redirect - Deduplicate required arrays in merged schemas to prevent double error messages when product and integration schemas share required keys - Replace duplicate test with a proper fallback URL test that verifies both metadata and installationMetadata are forwarded Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…g warning - Extract mergeMetadataSchemas() to format-schema-help.ts shared utility (was duplicated in add-help.ts and add-auto-provision.ts) - Add output.debug() warning when product and installation schemas have overlapping key names (product definition wins on collision) Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
24e9ef7 to
bfcd0c8
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 ## @vercel/[email protected] ### Minor Changes - [services] support multiple topics for a single worker service ([#15615](#15615)) - [services] support for specifying an env prefix for each service ([#15641](#15641)) - Simplify python runtime by always passing in app variable ([#15635](#15635)) ### Patch Changes - Namespace diagnostics keys by builder and service workspace, and aggregate per-builder `package-manifest.json` files into a single `project-manifest.json` ([#15399](#15399)) - Updated dependencies \[[`ac87d5a5ef5d79b55765e094efc957de987d7ac4`](ac87d5a), [`25a6a2daa46baba6e8d7dec90eb49213b8150b8c`](25a6a2d)]: - @vercel/[email protected] ## [email protected] ### Minor Changes - [services] support multiple topics for a single worker service ([#15615](#15615)) - [services] support for specifying an env prefix for each service ([#15641](#15641)) ### Patch Changes - fix(cli): support installation-level metadata for `integration add` ([#15444](#15444)) Integrations like Sentry have both product-level metadata (e.g. `platform`) and installation-level metadata (e.g. `name`, `region`). The CLI now: - Shows installation-level metadata fields in `--help` output - Accepts installation-level metadata keys via `-m` flags - Splits metadata into product and installation buckets, sending `installationMetadata` as a separate API field - Shows actionable hint when required metadata is missing on browser fallback (lists missing fields with example `-m` flags) - Forwards `installationMetadata` to browser fallback URL so installation config isn't lost on redirect - Logs debug warning when product and installation schemas have overlapping key names - Redirect sources now support domains ([#15670](#15670)) - Improve buy command error handling: handle new API error codes (invalid_plan, already_on_plan, invalid_status, forbidden, purchase_create_hosted_failed), distinguish 402 payment failures from server errors, and auto-open billing page in TTY mode for payment-related errors. ([#15699](#15699)) - Namespace diagnostics keys by builder and service workspace, and aggregate per-builder `package-manifest.json` files into a single `project-manifest.json` ([#15399](#15399)) - Updated dependencies \[[`69cd8ea307f507037fe735d7ba09c58fb4193e13`](69cd8ea), [`e921c3f3f42cd436525c05627109115bcffc9f4c`](e921c3f), [`bb98cc3b9a303b9e598c14feca5c0f36128bcf7f`](bb98cc3), [`4839214ae9cbcc95d448429bf93133e58284e03f`](4839214), [`ac87d5a5ef5d79b55765e094efc957de987d7ac4`](ac87d5a), [`ece813e0a9a75e3ad262817f00050c62f5ad67eb`](ece813e), [`d7107d025500d6be305895dfd5cd89d87e6eb9f0`](d7107d0), [`25a6a2daa46baba6e8d7dec90eb49213b8150b8c`](25a6a2d), [`f02b9da61d1acac5b426d8757e9bfb4ba4ffedd8`](f02b9da)]: - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] ## @vercel/[email protected] ### Minor Changes - [services] support multiple topics for a single worker service ([#15615](#15615)) - [services] support for specifying an env prefix for each service ([#15641](#15641)) ### Patch Changes - Updated dependencies \[[`13f719da050ba4b73b95b51e8edf7141c967b9a2`](13f719d)]: - @vercel/[email protected] ## @vercel/[email protected] ### Minor Changes - [services] support multiple topics for a single worker service ([#15615](#15615)) - [services] support for specifying an env prefix for each service ([#15641](#15641)) ### Patch Changes - Updated dependencies \[[`4839214ae9cbcc95d448429bf93133e58284e03f`](4839214), [`13f719da050ba4b73b95b51e8edf7141c967b9a2`](13f719d), [`ece813e0a9a75e3ad262817f00050c62f5ad67eb`](ece813e), [`d7107d025500d6be305895dfd5cd89d87e6eb9f0`](d7107d0), [`25a6a2daa46baba6e8d7dec90eb49213b8150b8c`](25a6a2d)]: - @vercel/[email protected] - @vercel/[email protected] - @vercel/[email protected] ## @vercel/[email protected] ### Minor Changes - Update uv to v0.10.11 ([#15623](#15623)) - Simplify python runtime by always passing in app variable ([#15635](#15635)) ### Patch Changes - Fix env marker-excluded deps erroneously flagged as lacking wheels ([#15668](#15668)) - Updated dependencies \[[`ac87d5a5ef5d79b55765e094efc957de987d7ac4`](ac87d5a), [`25a6a2daa46baba6e8d7dec90eb49213b8150b8c`](25a6a2d)]: - @vercel/[email protected] ## @vercel/[email protected] ### Minor Changes - Simplify python runtime by always passing in app variable ([#15635](#15635)) ### Patch Changes - Fix env marker-excluded deps erroneously flagged as lacking wheels ([#15668](#15668)) ## @vercel/[email protected] ### Patch Changes - Bump @vercel/nft to 1.5.0 ([#15683](#15683)) - Updated dependencies \[[`4839214ae9cbcc95d448429bf93133e58284e03f`](4839214), [`ece813e0a9a75e3ad262817f00050c62f5ad67eb`](ece813e), [`d7107d025500d6be305895dfd5cd89d87e6eb9f0`](d7107d0), [`25a6a2daa46baba6e8d7dec90eb49213b8150b8c`](25a6a2d)]: - @vercel/[email protected] ## @vercel/[email protected] ### Patch Changes - Updated dependencies \[[`69cd8ea307f507037fe735d7ba09c58fb4193e13`](69cd8ea)]: - @vercel/[email protected] ## @vercel/[email protected] ### Patch Changes - Updated dependencies \[[`4839214ae9cbcc95d448429bf93133e58284e03f`](4839214), [`13f719da050ba4b73b95b51e8edf7141c967b9a2`](13f719d), [`ece813e0a9a75e3ad262817f00050c62f5ad67eb`](ece813e), [`d7107d025500d6be305895dfd5cd89d87e6eb9f0`](d7107d0), [`25a6a2daa46baba6e8d7dec90eb49213b8150b8c`](25a6a2d)]: - @vercel/[email protected] - @vercel/[email protected] ## @vercel/[email protected] ### Patch Changes - Updated dependencies \[[`69cd8ea307f507037fe735d7ba09c58fb4193e13`](69cd8ea)]: - @vercel/[email protected] ## @vercel/[email protected] ### Patch Changes - Bump @vercel/nft to 1.5.0 ([#15683](#15683)) - Updated dependencies \[[`69cd8ea307f507037fe735d7ba09c58fb4193e13`](69cd8ea)]: - @vercel/[email protected] - @vercel/[email protected] ## @vercel/[email protected] ### Patch Changes - Updated dependencies \[[`69cd8ea307f507037fe735d7ba09c58fb4193e13`](69cd8ea)]: - @vercel/[email protected] ## @vercel/[email protected] ### Patch Changes - Updated dependencies \[[`4839214ae9cbcc95d448429bf93133e58284e03f`](4839214), [`ece813e0a9a75e3ad262817f00050c62f5ad67eb`](ece813e), [`d7107d025500d6be305895dfd5cd89d87e6eb9f0`](d7107d0), [`25a6a2daa46baba6e8d7dec90eb49213b8150b8c`](25a6a2d)]: - @vercel/[email protected] ## @vercel/[email protected] ### Patch Changes - Updated dependencies \[[`69cd8ea307f507037fe735d7ba09c58fb4193e13`](69cd8ea)]: - @vercel/[email protected] ## @vercel/[email protected] ### Patch Changes - Bump @vercel/nft to 1.5.0 ([#15683](#15683)) - Updated dependencies \[[`69cd8ea307f507037fe735d7ba09c58fb4193e13`](69cd8ea)]: - @vercel/[email protected] ## @vercel/[email protected] ### Patch Changes - Updated dependencies \[[`69cd8ea307f507037fe735d7ba09c58fb4193e13`](69cd8ea)]: - @vercel/[email protected] ## @vercel/[email protected] ### Patch Changes - Updated dependencies \[[`69cd8ea307f507037fe735d7ba09c58fb4193e13`](69cd8ea)]: - @vercel/[email protected] ## @vercel/[email protected] ### Patch Changes - Bump @vercel/nft to 1.5.0 ([#15683](#15683)) - fix(next): merge next-minimal-server.js.nft.json into server trace for prebuilt deployments ([#15688](#15688)) - Update to latest Next.js adapter ([#15695](#15695)) ## @vercel/[email protected] ### Patch Changes - Bump @vercel/nft to 1.5.0 ([#15683](#15683)) - Updated dependencies \[[`4839214ae9cbcc95d448429bf93133e58284e03f`](4839214), [`ece813e0a9a75e3ad262817f00050c62f5ad67eb`](ece813e), [`d7107d025500d6be305895dfd5cd89d87e6eb9f0`](d7107d0), [`25a6a2daa46baba6e8d7dec90eb49213b8150b8c`](25a6a2d)]: - @vercel/[email protected] ## @vercel/[email protected] ### Patch Changes - Bump @vercel/nft to 1.5.0 ([#15683](#15683)) ## @vercel/[email protected] ### Patch Changes - Bump @vercel/nft to 1.5.0 ([#15683](#15683)) ## @vercel/[email protected] ### Patch Changes - Redirect sources now support domains ([#15670](#15670)) ## @vercel/[email protected] ### Patch Changes - Updated dependencies \[]: - @vercel/[email protected] ## @vercel/[email protected] ### Minor Changes - Update uv to v0.10.11 ([#15623](#15623)) - Simplify python runtime by always passing in app variable ([#15635](#15635)) ### Patch Changes - Fix a flakey unit test ([#15647](#15647)) --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: JJ Kasper <[email protected]>
Summary
name,region) for installation creation, and product-level (platform) for resource provisioning--helpshows all fields and-mflags accept both installation-level and product-level keysinstallationMetadataas a separate API fieldname,region) are validated alongside product-level onesinstallationMetadatato browser fallback URL so installation config isn't lost on redirectChanges
types.ts: Added optionalmetadataSchematoIntegrationtypeformat-schema-help.ts: SharedmergeMetadataSchemas()utility — merges integration + product schemas with deduped required arrays (product wins on key collision)add-help.ts: Uses sharedmergeMetadataSchemas()for--helpdisplayadd-auto-provision.ts: Uses sharedmergeMetadataSchemas()for-mflag parsing, validates both required arrays, splits parsed keys into product vs installation buckets, shows missing metadata error (no browser) on fallback, forwardsinstallationMetadatato fallback URL, logs debug warning on key collisionauto-provision-resource.ts: SendsinstallationMetadataas a separate body field (omitted when empty)test/mocks/integration.ts: Addedacme-install-metamock with integration-level metadataSchemaadd-auto-provision.test.ts: 6 new tests for metadata splitting, required field validation, backward compat, fallback messaging, and fallback URL forwardingDeploy order
The API companion PR must deploy before this CLI version is published. The old API's
BodySchemahasadditionalProperties: false— sendinginstallationMetadatato the old API causes a 400. The CLI omits the field when empty, but Sentry users providing-m name=... -m install-region=...would trigger it.Companion PR
installationMetadata, fetches free plans, creates installations withskipAuthorizationCheckTest Plan
Unit Tests
Manual Testing
1. Sentry
--help— merged schema display✅ All three fields shown —
nameandregionfrom integration-level schema,platformfrom product-level schema. All marked required.2. Upstash/Neon/Prisma
--help— backward compat (no integration metadataSchema)✅ Only product-level schema shown. No installation-level fields (integration has no
metadataSchema).3. Sentry auto-provision — metadata splitting
✅
metadatacontains only product key (platform).installationMetadatacontains only installation keys (name,region). API accepted and returned 201.4. Sentry auto-provision — missing required installation fields
✅ Validation catches missing installation-level required fields. No API request made.
5. Prisma auto-provision — backward compat (no installationMetadata)
✅ No
installationMetadatafield in request body. All metadata goes to product. API accepted and returned 201.6. Sentry — missing metadata error on fallback (no browser)
✅ Shows error listing missing fields with example flags. Does NOT open browser — exits with code 1. Agent/human can retry with the required
-mflags.7. Prisma — no false hint for server-handled region
✅ Prisma's
regionusesvercel-regioncontrol (server-handled) — no missing metadata hint, provisions directly.8. Braintrust — no metadata required, provisions directly
✅ Integration has no required metadata fields. Provisions directly without any metadata-related messages.
Code Paths Covered
--helpwith integration metadataSchema--helpwithout integration metadataSchema-mflagsmetadata+installationMetadatametadata, noinstallationMetadatainstallationMetadataempty → omitted from bodyinstallationMetadatanon-empty → included in body-mflags, missing required metadata-mflags (server reason)installationMetadataparam in fallback URL-mflagsLinear: MKT-2913, MKT-3088