Skip to content

fix(cli): Scope DELETE confirmation prompt to vercel api command only#14787

Merged
tknickman merged 2 commits intomainfrom
tknickman/scope-api-flag
Jan 29, 2026
Merged

fix(cli): Scope DELETE confirmation prompt to vercel api command only#14787
tknickman merged 2 commits intomainfrom
tknickman/scope-api-flag

Conversation

@tknickman
Copy link
Copy Markdown
Member

Summary

Fixes a regression from #14769 where the DELETE confirmation prompt was incorrectly applied to all DELETE operations instead of only the vercel api command.

This was breaking CI/CD pipelines that use commands like:

  • vercel env rm <name> --yes
  • vercel alias rm <alias> --yes
  • vercel remove <deployment> --yes

These commands have their own --yes flags for confirmation and should not be affected by the new --dangerously-skip-permissions flag which was designed specifically for the vercel api command.

Changes

  • packages/cli/src/util/client.ts: Made confirmMutatingOperation() public and removed the call from fetch() method
  • packages/cli/src/commands/api/index.ts: Added confirmMutatingOperation() calls in executeSingleRequest() and executePaginatedRequest() - scoping confirmation to only the vercel api command
  • packages/cli/test/mocks/client.ts: Removed workaround that set dangerouslySkipPermissions = true by default
  • packages/cli/test/unit/util/client-confirmation.test.ts: Updated tests to call confirmMutatingOperation() directly

Test plan

  • All 15 unit tests pass
  • TypeScript compiles without errors
  • vercel env rm --yes works in non-TTY mode (no longer blocked)
  • vercel api -X DELETE still prompts for confirmation as intended

Related

🤖 Generated with Claude Code

@tknickman tknickman requested a review from a team as a code owner January 29, 2026 16:10
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 29, 2026

🦋 Changeset detected

Latest commit: a35543f

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 Jan 29, 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-4j27sb0ao.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-4j27sb0ao.vercel.sh/tarballs/vercel.tgz"
    }
  }
}

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 29, 2026

🧪 Unit Test Strategy

Comparing: 9d1e38ea35543f (view diff)

Strategy: Affected packages only

✅ Only testing packages that have been modified or depend on modified packages.

Affected packages - 1 (2%)
  1. vercel
Unaffected packages - 40 (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/introspection
  24. @vercel/koa
  25. @vercel/nestjs
  26. @vercel/next
  27. @vercel/node
  28. @vercel/oidc
  29. @vercel/oidc-aws-credentials-provider
  30. @vercel/python
  31. @vercel/python-analysis
  32. @vercel/redwood
  33. @vercel/related-projects
  34. @vercel/remix-builder
  35. @vercel/routing-utils
  36. @vercel/ruby
  37. @vercel/rust
  38. @vercel/static-build
  39. @vercel/static-config
  40. 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

@vercel vercel bot left a comment

Choose a reason for hiding this comment

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

Additional Suggestion:

DELETE test hangs indefinitely because it doesn't skip the confirmation prompt

Fix on Vercel

The test is testing the request functionality, not the confirmation behavior.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@tknickman tknickman merged commit dbb7d6c into main Jan 29, 2026
120 checks passed
@tknickman tknickman deleted the tknickman/scope-api-flag branch January 29, 2026 16:47
tknickman pushed a commit that referenced this pull request Jan 29, 2026
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@50.9.2

### Patch Changes

- fix(cli): Scope DELETE confirmation prompt to `vercel api` command
only ([#14787](#14787))

This fixes a regression from #14769 where the DELETE confirmation prompt
was incorrectly applied to all DELETE operations (e.g., `vercel env rm`,
`vercel alias rm`) instead of only the `vercel api` command. Commands
like `env rm` and `alias rm` have their own `--yes` flags for
confirmation and should not be affected.

- experimental rust runtime framework preset
([#14765](#14765))

- Add redirects command to top level help message.
([#14772](#14772))

-   Updated dependencies \[]:
    -   @vercel/static-build@2.8.28

## @vercel/frameworks@3.16.1

### Patch Changes

- Generic node framework preset
([#14779](#14779))

- experimental rust runtime framework preset
([#14765](#14765))

## @vercel/fs-detectors@5.7.19

### Patch Changes

- experimental rust runtime framework preset
([#14765](#14765))

- Updated dependencies
\[[`9d1e38e9ff6f0431dce8e421497e1ec4fc823291`](9d1e38e),
[`e800617a334377e11953df22ef40d03716daf692`](e800617)]:
    -   @vercel/frameworks@3.16.1

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
adriancooney pushed a commit that referenced this pull request Jan 30, 2026
…ly (#14787)

## Summary

Fixes a regression from #14769 where the DELETE confirmation prompt was
incorrectly applied to **all** DELETE operations instead of only the
`vercel api` command.

This was breaking CI/CD pipelines that use commands like:
- `vercel env rm <name> --yes`
- `vercel alias rm <alias> --yes`
- `vercel remove <deployment> --yes`

These commands have their own `--yes` flags for confirmation and should
not be affected by the new `--dangerously-skip-permissions` flag which
was designed specifically for the `vercel api` command.

## Changes

- **`packages/cli/src/util/client.ts`**: Made
`confirmMutatingOperation()` public and removed the call from `fetch()`
method
- **`packages/cli/src/commands/api/index.ts`**: Added
`confirmMutatingOperation()` calls in `executeSingleRequest()` and
`executePaginatedRequest()` - scoping confirmation to only the `vercel
api` command
- **`packages/cli/test/mocks/client.ts`**: Removed workaround that set
`dangerouslySkipPermissions = true` by default
- **`packages/cli/test/unit/util/client-confirmation.test.ts`**: Updated
tests to call `confirmMutatingOperation()` directly

## Test plan

- [x] All 15 unit tests pass
- [x] TypeScript compiles without errors
- [x] `vercel env rm --yes` works in non-TTY mode (no longer blocked)
- [x] `vercel api -X DELETE` still prompts for confirmation as intended

## Related

- Fixes regression introduced in #14769
- Supersedes #14784

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
adriancooney pushed a commit that referenced this pull request Jan 30, 2026
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@50.9.2

### Patch Changes

- fix(cli): Scope DELETE confirmation prompt to `vercel api` command
only ([#14787](#14787))

This fixes a regression from #14769 where the DELETE confirmation prompt
was incorrectly applied to all DELETE operations (e.g., `vercel env rm`,
`vercel alias rm`) instead of only the `vercel api` command. Commands
like `env rm` and `alias rm` have their own `--yes` flags for
confirmation and should not be affected.

- experimental rust runtime framework preset
([#14765](#14765))

- Add redirects command to top level help message.
([#14772](#14772))

-   Updated dependencies \[]:
    -   @vercel/static-build@2.8.28

## @vercel/frameworks@3.16.1

### Patch Changes

- Generic node framework preset
([#14779](#14779))

- experimental rust runtime framework preset
([#14765](#14765))

## @vercel/fs-detectors@5.7.19

### Patch Changes

- experimental rust runtime framework preset
([#14765](#14765))

- Updated dependencies
\[[`9d1e38e9ff6f0431dce8e421497e1ec4fc823291`](9d1e38e),
[`e800617a334377e11953df22ef40d03716daf692`](e800617)]:
    -   @vercel/frameworks@3.16.1

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants