fix(issue): accept 1 positional + --into as valid merge (CLI-1AE)#920
Merged
fix(issue): accept 1 positional + --into as valid merge (CLI-1AE)#920
Conversation
Contributor
|
Contributor
Codecov Results 📊✅ 6686 passed | Total: 6686 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
All tests are passing successfully. ❌ Patch coverage is 64.29%. Project has 13518 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 76.67% 76.68% +0.01%
==========================================
Files 303 303 —
Lines 57977 57979 +2
Branches 0 0 —
==========================================
+ Hits 44454 44461 +7
- Misses 13523 13518 -5
- Partials 0 0 —Generated by Codecov Action |
01de1a9 to
df2b0ab
Compare
Users running `sentry issue merge A --into B` got a spurious ValidationError because the arity check only counted positional args. The --into flag clearly designates a second issue to merge, so 1 positional + --into should be accepted as a valid 2-issue merge. When args.length === 1 and --into is set, append the --into value to effectiveArgs before validation. resolveAllIssues resolves both in parallel, orderForMerge still handles sorting the --into target to front, and the existing dedupe check guards against merge A --into A. Also improves the 1-positional-no-into error hint to show the --into form as an alternative example.
df2b0ab to
92550f5
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f5092f1. Configure here.
655f2ef to
92550f5
Compare
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.

Summary
sentry issue merge A --into Braised a spuriousValidationError: needs at least 2 issue IDs (got 1)even though two distinct issues were provided--into, the--intovalue is now treated as the second issue in the merge set--intoerror hint to show the--intoform as an alternativeRoot Cause
The arity check in
func()counted only positional args (args.length < 2). When a user ran:args = ["THEARTHIQDAILY-PROD-D"]andflags.into = "THEARTHIQDAILY-PROD-C", soargs.length === 1triggered the error despite two distinct issues being specified.Fix
Before validation, build
effectiveArgs: ifargs.length === 1and--intois set, append the--intovalue. The rest of the pipeline is unchanged —resolveAllIssuesresolves all entries in parallel,orderForMergestill places the--intotarget at the front, and the existing dedupe check handlesmerge A --into A.Tests
7 new test cases added to
test/commands/issue/merge.func.test.ts:--into→ arity error (existing test split/clarified)--into→ arity error with--intohint--into→ still arity error (effectiveArgs.length = 1)--into→ valid merge,--intotarget becomes preferred parent (the fix)--intosame issue → dedupe guard ("at least 2 distinct issues")