Repository navigation
Vercel: -y inside a short group asks on a protected environment; teams change and team are exempt (#148) - #151
Merged
Merged
Conversation
…e given (#147) Failing on its own: cloudpin reads .vercel/project.json only from --cwd or the folder the command runs in, so `vercel deploy sub` with sub linked to another team passes a pin it should fail. Covers deploy (explicit, bare word, flags before the path, deploy init), --cwd, pull and dev, with controls for known command words, a path Vercel refuses, and the scope staying with the folder the command runs in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pure move, so the #147 fix fits under the file-size cap: the global flag tables, HELP_COMMANDS, mainParse and splitShortGroups, with their comments, move verbatim to src/providers/vercel-args.ts. vercel.ts imports the three names it uses. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… does (#147) mainParse becomes argParse(args, spec, permissive) with the global options and permissive mode, as before. Commands parse their own options merged with the globals and not permissively, where an unknown flag is an error; the deploy-path fix needs that. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…147) vercel deploy <dir>, a bare vercel <dir>, deploy init <dir>, pull <dir> and dev <dir> link and act on the project in <dir>, but cloudpin read the link only from --cwd or the folder the command runs in, so a folder linked to another team passed a pin it should fail. linkDirs reads each command the way vercel 50.35 does: the path positional after the command's own options, resolved against the folder after --cwd. Deploy falls back to that folder when Vercel would refuse the path (missing, a file, a symlink), since nothing deploys. A first word that is no Vercel command may run an extension vercel-<word> in the folder instead of a deploy, so both folders' links count there. The scope still comes only from the local config in the folder the command runs in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An unknown flag after the deploy path, deploy init's own options, and a folder named dev beside `vercel dev dev`: each case fails if the command's strict parse turns permissive, deploy init parses with the wrong options, or the second "dev" is read as a folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fails until the fix: `project inspect -dy` counts as read-only on a protected environment, and `teams change` and `team ls|switch` are checked instead of exempt. The --api, -dv and -dh cases already pass (#146); they are pinned here at guard and resolve level. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ent (#148) `vercel project inspect -dy` counted as read-only, though inspect with no name goes through ensureLink, which with --yes can create a project, link the folder and connect Git. The project command parses permissively, keeping an unknown -y of a group as a word and dropping a first "--", and inspect parses those words again with --yes/-y (vercel 50.35, src/commands/project/index.ts and inspect.ts). So the check splits every short group, those after "--" included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…148) `vercel teams change` is teams switch, and `vercel team ls|switch` is teams (vercel 50.35: src/commands/teams/index.ts COMMAND_CONFIG maps switch to switch|change and list to ls|list; teamsCommand's aliases are switch and team). Both were checked instead of exempt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps main's linkDirs and the dynamic-folder check, with this branch's passesYes and team aliases. CHANGELOG and ROADMAP lines for #148. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #148. Target: 1.3.0.
What changes
-yinside a short group now asks on a protected environment.vercel project inspect -dy(also-ydand-dyQ x) counted as read-only, yet with no project name it can runensureLink, which may create and link a project. The newpassesYesinvercel-args.tsreads--yesthe wayproject inspectdoes (vercel 50.35src/commands/project/index.ts, theninspect.ts):--is dropped by project's permissive parse, so-yafter it still counts;--yes=falsesets yes too.No other command on the read-only list calls
ensureLink.vercel teams changeand theteamalias are exempt liketeams switch|ls(src/commands/teams/index.ts: list = ls|list, switch = switch|change; teamsCommand's aliases are switch and team).Coverage only:
--api URL <cmd>,-dvand-dhwere already fixed by Vercel: -v anywhere, or a deploy flag before an exempt word, skips the check #146. This PR adds the guard-level and resolve-level tests that were missing for them.Tests
The tests are in the new file
test/vercel-yes-group.test.ts, 39 of them. They were committed failing first (17 of 39 failed), and include guard-levelconfirmchecks on a protected environment and wrong-pin exemptions. Typecheck passes. Full suite: 54 files, 1483 passed, 8 skipped.The builder broke five pieces of the fix on purpose, and each one made tests fail. I broke two more myself:
passesYesback to the old word-only check (8 tests failed), and theteamalias dropped (6 failed). The files were restored afterwards.Left open
read_onlyrule forproject inspectstill skips the--yescheck. That was left unchanged on purpose: the rules are the user's explicit list, applied the same way for every provider.domain ls,cert ls,aliases ls) still ask on a protected environment. That's over-cautious, but it errs on the safe side.🤖 Generated with Claude Code