Skip to content

CLI --fields silently ignored by custom jsonTransforms #1808

Closed

Description

@sentry-junior

A command's output.jsonTransform replaces the default JSON path in renderCommandOutput (packages/cli/src/lib/formatters/output.ts), including --fields filtering. Transforms that never read their fields argument print the full object, with no error or warning, when you pass --fields.

Commands that did this on main:

  • alert issues create|edit|delete|view
  • alert metrics create|edit|delete
  • auth list
  • dashboard widget delete
  • issue merge, issue resolve
  • project delete

For example, sentry project delete my-org/my-app --json --fields project printed {"deleted":true,"org":"my-org","project":"my-app"}.

Nothing caught it: the transform's type, (data: T, fields?: string[]) => unknown, accepts a one-parameter function, and the tests only checked the unfiltered output.

Raised by BYK while reviewing #1783. That PR fixes the commands above and adds a sentry-cli/json-transform-uses-fields lint rule against new cases.

via @BYK.

--

View Session in Sentry

Activity

  1. linear-code commented on Nov 2, 2026

    @linear-code
  2. added a commit that references this issue on Nov 3, 2026
    5f1ada1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions