fix(explore): Ensure variadic field and environment flags are arrays#1294
Draft
sentry[bot] wants to merge 1 commit into
Draft
fix(explore): Ensure variadic field and environment flags are arrays#1294sentry[bot] wants to merge 1 commit into
sentry[bot] wants to merge 1 commit into
Conversation
Contributor
|
Contributor
Codecov Results 📊✅ Patch coverage is 100.00%. Project has 5494 uncovered lines. 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 +2Generated by Codecov Action |
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.
This PR addresses CLI-2B4, a
TypeError: e.find is not a functionoccurring in thesentry explorecommand.The root cause was that Stricli's
variadic: trueflags (specifically--fieldand--environmentin theexplorecommand) return a plain string when only a single value is provided, instead of a single-element array. This led to aTypeErrorwhen array methods like.find()were called on these flags.The fix normalizes
flags.fieldandflags.environmentto 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.