Skip to content

Commit 90b7a8d

Browse files
committed
fix: address Cursor Bugbot review comments
1. test/lib/complete.test.ts: Fix duplicate useTestConfigDir — consolidate import to top of file, remove redundant second call added by subagent. The existing test-complete- config dir covers all tests including handleComplete. 2. src/commands/issue/merge.ts: Improve hint when user passes --into with zero positionals. Previously showed the generic example; now shows a targeted message: 'you passed --into X but no positional issue ID. Add an issue: sentry issue merge CLI-K9 --into X'
1 parent 93446b7 commit 90b7a8d

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

src/commands/issue/merge.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,10 +293,15 @@ export const mergeCommand = buildCommand({
293293
args.length === 1 && flags.into ? [...args, flags.into] : args;
294294

295295
if (effectiveArgs.length < 2) {
296-
const hint =
297-
args.length === 1
298-
? "Tip: you can also write: sentry issue merge CLI-K9 --into CLI-15H"
299-
: "Example: sentry issue merge CLI-K9 CLI-15H CLI-15N";
296+
let hint: string;
297+
if (args.length === 1) {
298+
hint =
299+
"Tip: you can also write: sentry issue merge CLI-K9 --into CLI-15H";
300+
} else if (args.length === 0 && flags.into) {
301+
hint = `Tip: you passed --into ${flags.into} but no positional issue ID. Add an issue to merge:\n sentry issue merge CLI-K9 --into ${flags.into}`;
302+
} else {
303+
hint = "Example: sentry issue merge CLI-K9 CLI-15H CLI-15N";
304+
}
300305
throw new ValidationError(
301306
`'sentry ${COMMAND_PATH}' needs at least 2 issue IDs (got ${args.length}).\n\n` +
302307
hint

test/lib/complete.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
type OrgRegionEntry,
2121
setOrgRegions,
2222
} from "../../src/lib/db/regions.js";
23+
import { useTestConfigDir } from "../helpers.js";
2324

2425
useTestConfigDir("test-complete-");
2526

@@ -295,9 +296,8 @@ describe("completeAliases", () => {
295296

296297
import { afterEach, beforeEach, mock } from "bun:test";
297298
import { handleComplete } from "../../src/lib/complete.js";
298-
import { useTestConfigDir } from "../helpers.js";
299299

300-
useTestConfigDir("complete-handle-");
300+
// Note: useTestConfigDir is already called above at line 24 for the whole file
301301

302302
describe("handleComplete", () => {
303303
let originalWrite: typeof process.stdout.write;

0 commit comments

Comments
 (0)