Skip to content

Add vc link add subcommand to append projects to existing repo.json#14968

Merged
TooTallNate merged 4 commits intomainfrom
02-10-add_vc_link_add_subcommand_to_append_projects_to_existing_repo.json
Feb 11, 2026
Merged

Add vc link add subcommand to append projects to existing repo.json#14968
TooTallNate merged 4 commits intomainfrom
02-10-add_vc_link_add_subcommand_to_append_projects_to_existing_repo.json

Conversation

@TooTallNate
Copy link
Copy Markdown
Member

@TooTallNate TooTallNate commented Feb 10, 2026

Allows adding additional Vercel Projects to an already-linked repository without overwriting previously linked projects. Filters out both API projects and locally-detected projects whose directories are already covered by existing entries in repo.json.

Note

Low Risk Change

This PR adds a new vc link add CLI subcommand to append projects to existing repo.json, consisting of command definition, argument parsing, refactored project discovery logic, and comprehensive tests.

  • New add subcommand with command definition and argument parsing
  • Refactored discoverRepoProjects function extracted from ensureRepoLink for shared use
  • Extensive unit tests covering add flow, deduplication, and telemetry

Risk assessment for commit 229593d.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 10, 2026

🦋 Changeset detected

Latest commit: 229593d

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

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

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

@TooTallNate TooTallNate marked this pull request as ready for review February 10, 2026 09:10
@TooTallNate TooTallNate requested a review from a team as a code owner February 10, 2026 09:10
Copilot AI review requested due to automatic review settings February 10, 2026 09:10
Copy link
Copy Markdown
Member Author

TooTallNate commented Feb 10, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 10, 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-n4rqd6nht.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-n4rqd6nht.vercel.sh/tarballs/vercel.tgz"
    }
  }
}

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 10, 2026

🧪 Unit Test Strategy

Comparing: 4df7e3a229593d (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: Handled separately (Version Packages PRs or run-e2e-tests label)
  • Type checks: Only affected packages will run type checks

This comment is automatically generated based on the affected testing strategy

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new vc link add subcommand to extend an existing repository link (.vercel/repo.json) by discovering additional Vercel Projects and merging them into the existing config without overwriting prior entries.

Changes:

  • Introduces vc link add subcommand wiring (help/telemetry/arg parsing) and CLI help updates.
  • Refactors repo-linking logic into a shared project discovery routine and adds addRepoLink() to append projects to existing repo.json.
  • Adds unit tests for the new subcommand behavior and a changeset for release notes.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
packages/cli/src/commands/link/index.ts Adds subcommand detection/dispatch for link add, updates --help exit code handling.
packages/cli/src/commands/link/command.ts Defines add subcommand metadata (options/examples) and attaches it to link.
packages/cli/src/util/link/repo.ts Extracts shared discovery flow and adds addRepoLink() to merge projects into existing repo.json.
packages/cli/src/util/telemetry/commands/link/index.ts Adds telemetry method for link add subcommand usage.
packages/cli/test/unit/commands/link/index.test.ts Updates help exit code expectation and adds tests for link add.
.changeset/olive-waves-worry.md Declares a minor release for the new subcommand.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Member Author

TooTallNate commented Feb 11, 2026

Merge activity

  • Feb 11, 12:28 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 11, 12:30 AM UTC: Graphite rebased this pull request as part of a merge.
  • Feb 11, 12:40 AM UTC: @TooTallNate merged this pull request with Graphite.

@TooTallNate TooTallNate changed the base branch from 02-10-move_orgid_to_per-project_entries_in_repo.json_ to graphite-base/14968 February 11, 2026 00:28
@TooTallNate TooTallNate changed the base branch from graphite-base/14968 to main February 11, 2026 00:29
Allows adding additional Vercel Projects to an already-linked repository without overwriting previously linked projects. Filters out both API projects and locally-detected projects whose directories are already covered by existing entries in `repo.json`.
…ory filtering, error handling, and prompt text
@TooTallNate TooTallNate force-pushed the 02-10-add_vc_link_add_subcommand_to_append_projects_to_existing_repo.json branch from efdf6f9 to 229593d Compare February 11, 2026 00:29
@TooTallNate TooTallNate merged commit 343f765 into main Feb 11, 2026
136 checks passed
@TooTallNate TooTallNate deleted the 02-10-add_vc_link_add_subcommand_to_append_projects_to_existing_repo.json branch February 11, 2026 00:40
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.

4 participants