Skip to content

fix(explore): Correctly parse variadic field and environment flags#1293

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

fix(explore): Correctly parse variadic field and environment flags#1293
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/explore-variadic-flags

Conversation

@sentry

@sentry sentry Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

This PR addresses CLI-2B4 by correcting the parsing logic for the field and environment flags in the explore command.

Previously, these variadic flags were defined with parse: String. When multiple values were provided (e.g., --field foo --field bar), the stricli parser would call String() on the collected array of strings. This resulted in the array being coerced into a single comma-separated string (e.g., "foo,bar"), rather than remaining a string[].

Downstream code, such as fieldList.find(), then attempted to call array methods on this string, leading to a TypeError: e.find is not a function.

The fix changes the parse function for both field and environment flags from String to (v: string[]) => v. This ensures that when multiple values are provided, the parser correctly returns the array of strings, preserving the expected type for subsequent operations.

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-1293/

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

@github-actions

Copy link
Copy Markdown
Contributor

Codecov Results 📊

❌ Patch coverage is 0.00%. Project has 5496 uncovered lines.
✅ Project coverage is 81.75%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
src/commands/explore.ts 0.00% ⚠️ 2 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    81.75%    81.75%        —%
==========================================
  Files          428       428         —
  Lines        30106     30108        +2
  Branches     19593     19593         —
==========================================
+ Hits         24611     24612        +1
- Misses        5495      5496        +1
- Partials      2054      2056        +2

Generated by Codecov Action

@sentry
sentry Bot marked this pull request as ready for review July 24, 2026 22:53
@github-actions github-actions Bot added the risk: high PR risk score: high label Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants