Skip to content

fix(explore): Ensure variadic field and environment flags are arrays#1294

Draft
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/explore-variadic-flags-GnFjXC
Draft

fix(explore): Ensure variadic field and environment flags are arrays#1294
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/explore-variadic-flags-GnFjXC

Conversation

@sentry

@sentry sentry Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

This PR addresses CLI-2B4, a TypeError: e.find is not a function occurring in the sentry explore command.

The root cause was that Stricli's variadic: true flags (specifically --field and --environment in the explore command) return a plain string when only a single value is provided, instead of a single-element array. This led to a TypeError when array methods like .find() were called on these flags.

The fix normalizes flags.field and flags.environment to arrays using ([] as string[]).concat(flag_value) immediately after they are parsed. This ensures that subsequent code always operates on an array, regardless of whether one or multiple values were provided by the user.

Fixes CLI-2B4

Comment @sentry <feedback> on this PR to have Autofix iterate on the changes.

@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-1294/

Built to branch gh-pages at 2026-07-24 23:43 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 5494 uncovered lines.
✅ Project coverage is 81.75%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    81.75%    81.75%        —%
==========================================
  Files          428       428         —
  Lines        30106     30108        +2
  Branches     19593     19597        +4
==========================================
+ Hits         24611     24614        +3
- Misses        5495      5494        -1
- Partials      2054      2056        +2

Generated by Codecov Action

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.

1 participant