fix(cli): read orgId from project entry in repo.json, not root#1263
Conversation
🦋 Changeset detectedLatest commit: 870c6b5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
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 |
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (49 failed)mongodb (1 failed):
turso (48 failed):
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
|
📊 Benchmark Results
workflow with no steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 1 step💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 25 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 50 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Promise.all with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro Promise.all with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express Promise.all with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Promise.race with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes Vercel-backed CLI auth failures in monorepos by reading orgId from the matched project entry in .vercel/repo.json (Vercel’s monorepo schema), instead of assuming orgId exists at the repo root.
Changes:
- Update
RepoProjectConfigto includeorgIdand removeorgIdfrom the rootRepoProjectsConfigtype. - Use
project.orgId(matched project entry) when constructing theProjectLinkfromrepo.json.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
e25a00e to
7f4fb6d
Compare
The Vercel CLI's repo.json format puts orgId on each project entry, not at the root level. The CLI was reading repoConfig.orgId (undefined) instead of project.orgId, which meant teamId was never set. Without teamId, the world-vercel URL selector used the direct vercel-workflow.com URL instead of the api.vercel.com proxy, causing 401 errors because vercel-workflow.com only accepts OIDC tokens (not CLI auth tokens). Also fix the RepoProjectConfig/RepoProjectsConfig type definitions to match the actual repo.json structure.
7f4fb6d to
870c6b5
Compare
Summary
Fixes CLI 401 errors when using
--backend=vercelwith projects linked viavc linkin a monorepo.Problem
The Vercel CLI recently moved
orgIdfrom the root level of.vercel/repo.jsonto each project entry (see vercel/vercel#14967):The workflow CLI was only reading
repoConfig.orgId(root level), which is nowundefinedwith the new format. WithoutteamId,world-verceluses the directvercel-workflow.comURL instead of theapi.vercel.comproxy, causing 401 becausevercel-workflow.comonly accepts OIDC tokens.Fix
project.orgId(new per-project format), fall back torepoConfig.orgId(legacy root format) for backwards compatibilityRepoProjectConfigtype to include optionalorgIdRepoProjectsConfig.orgIdas optional for legacy supportnullif neither location hasorgId