diff --git a/cli/release-core/launcher.js b/cli/release-core/launcher.js index 867c1d5d6e..52d7f0921a 100644 --- a/cli/release-core/launcher.js +++ b/cli/release-core/launcher.js @@ -1141,7 +1141,7 @@ function createLauncher(productConfig) { } console.error('') console.error('Please report this issue at:') - console.error(' https://github.com/CodebuffAI/codebuff/issues') + console.error(` https://github.com/CodebuffAI/${packageName}/issues`) console.error('') } diff --git a/cli/src/__tests__/release/wrapper-safety.test.ts b/cli/src/__tests__/release/wrapper-safety.test.ts index aeb0d60c04..93e9e7e31e 100644 --- a/cli/src/__tests__/release/wrapper-safety.test.ts +++ b/cli/src/__tests__/release/wrapper-safety.test.ts @@ -399,4 +399,50 @@ describe('shared release launcher safety', () => { ) expect(runningProcess.listenerCount('exit')).toBe(0) }) + + test('directs crash reports to the product repository issues tracker', () => { + const freebuffLauncher = createLauncher({ + packageName: 'freebuff', + displayName: 'Freebuff', + }) + const codebuffLauncher = createLauncher({ + packageName: 'codebuff', + displayName: 'Codebuff', + }) + + const freebuffErrors: string[] = [] + const codebuffErrors: string[] = [] + + const originalConsoleError = console.error + try { + console.error = (...args: unknown[]) => { + freebuffErrors.push(args.join(' ')) + } + freebuffLauncher.__testing.printCrashDiagnostics(null, 'SIGSEGV') + + console.error = (...args: unknown[]) => { + codebuffErrors.push(args.join(' ')) + } + codebuffLauncher.__testing.printCrashDiagnostics(null, 'SIGSEGV') + } finally { + console.error = originalConsoleError + } + + expect( + freebuffErrors.some((line) => + line.includes('https://github.com/CodebuffAI/freebuff/issues'), + ), + ).toBe(true) + expect( + freebuffErrors.some((line) => + line.includes('https://github.com/CodebuffAI/codebuff/issues'), + ), + ).toBe(false) + + expect( + codebuffErrors.some((line) => + line.includes('https://github.com/CodebuffAI/codebuff/issues'), + ), + ).toBe(true) + }) })