Skip to content

Cli duplicate project prompt#15017

Merged
Grappeggia merged 4 commits intomainfrom
cursor/cli-duplicate-project-prompt-0002
Feb 12, 2026
Merged

Cli duplicate project prompt#15017
Grappeggia merged 4 commits intomainfrom
cursor/cli-duplicate-project-prompt-0002

Conversation

@Grappeggia
Copy link
Copy Markdown
Contributor

@Grappeggia Grappeggia commented Feb 11, 2026

Fixes vc link prompting for project selection twice and ensures env pull uses the newly linked project.

The CLI previously prompted twice for project selection during vc link because ensureLink() eagerly called getLinkedProject() even when relinking, which could trigger a repo-level project selection prompt. Additionally, getProjectLink() incorrectly prioritized .vercel/repo.json over a freshly created .vercel/project.json, leading env pull to re-prompt and potentially fetch environment variables for the wrong project. This PR ensures local project links take precedence and avoids the eager lookup during relinking.


Slack Thread

Open in Cursor Open in Web

Note

Low Risk Change

This PR fixes CLI UX issues with duplicate prompts during vc link by changing the order of precedence for project link resolution and skipping eager lookups during relinking; changes are limited to CLI logic, CI workflow improvements, and tests.

  • CLI: changes project link resolution to prefer project.json over repo.json
  • CI: adds fallback logic to resolve Vercel deployment URLs when wait step fails
  • Tests: adds unit tests for new link precedence behavior

Risk assessment for commit 184f2d3.

Prefer .vercel/project.json over repo.json and skip eager linked-project lookup when relinking.

Co-authored-by: Marcos Grappeggia <Grappeggia@users.noreply.github.com>
@cursor
Copy link
Copy Markdown

cursor bot commented Feb 11, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 11, 2026

🦋 Changeset detected

Latest commit: 184f2d3

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 Feb 11, 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-h36qe0puv.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-h36qe0puv.vercel.sh/tarballs/vercel.tgz"
    }
  }
}

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 11, 2026

🧪 Unit Test Strategy

Comparing: a9055ea184f2d3 (view diff)

Strategy: Code changed outside of a package - running all unit tests

⚠️ All unit tests will run because global code changes could impact all packages.

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

Results

  • Unit tests: All affected packages will run unit tests
  • E2E tests: Handled separately (Version Packages PRs or run-e2e-tests label)
  • Type checks: All affected packages will run type checks

This comment is automatically generated based on the affected testing strategy

@Grappeggia Grappeggia requested a review from codywong February 11, 2026 23:56
@Grappeggia Grappeggia marked this pull request as ready for review February 11, 2026 23:57
@Grappeggia Grappeggia requested review from a team as code owners February 11, 2026 23:57
Fallback to latest successful Vercel preview in PR when head commit has no deployment (e.g. changes that don't affect tarballs).
@Grappeggia Grappeggia merged commit b4cce9c into main Feb 12, 2026
138 checks passed
@Grappeggia Grappeggia deleted the cursor/cli-duplicate-project-prompt-0002 branch February 12, 2026 19:13
TooTallNate added a commit that referenced this pull request Mar 12, 2026
…onorepo projects

Reverts the precedence change from #15017 that caused `getProjectLink()`
to check `project.json` before `repo.json`. For repo-linked monorepos,
`writeProjectSettings()` writes a settings-only `project.json` (without
`projectId`/`orgId`), which then failed AJV validation on subsequent
runs with "Project Settings are invalid".

Changes:
- Restore original `repo.json`-first precedence in `getProjectLink()`
- Return `null` from `getLinkFromDir()` on validation failure instead
  of throwing, since a settings-only file is not corrupted
- Ignore orphaned settings-only `project.json` in `vc build` when no
  link is found, so the user is properly prompted to re-link
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.

3 participants