summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks
diff options
context:
space:
mode:
authorJerop Kipruto <[email protected]>2025-06-25 18:50:24 -0400
committerGitHub <[email protected]>2025-06-25 22:50:24 +0000
commitb6b9923dc3b80a73fdee3a3ccd6070c8cfb551cd (patch)
tree038b29fd5ca424217a4fcc620540dc0a6acc23bf /packages/cli/src/ui/hooks
parent79c647d486a5ef3cf9eb68f23000525e8d2c4a91 (diff)
Streamline issue submission with YAML forms (#1608)
Diffstat (limited to 'packages/cli/src/ui/hooks')
-rw-r--r--packages/cli/src/ui/hooks/slashCommandProcessor.test.ts26
-rw-r--r--packages/cli/src/ui/hooks/slashCommandProcessor.ts13
2 files changed, 9 insertions, 30 deletions
diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.test.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.test.ts
index dd3e7c4f..919c412c 100644
--- a/packages/cli/src/ui/hooks/slashCommandProcessor.test.ts
+++ b/packages/cli/src/ui/hooks/slashCommandProcessor.test.ts
@@ -417,14 +417,7 @@ describe('useSlashCommandProcessor', () => {
// Use the mocked memoryUsage value
const memoryUsage = '11.8 MB';
- const diagnosticInfo = `
-## Describe the bug
-A clear and concise description of what the bug is.
-
-## Additional context
-Add any other context about the problem here.
-
-## Diagnostic Information
+ const info = `
* **CLI Version:** ${cliVersion}
* **Git Commit:** ${GIT_COMMIT_INFO}
* **Operating System:** ${osVersion}
@@ -433,11 +426,11 @@ Add any other context about the problem here.
* **Memory Usage:** ${memoryUsage}
`;
let url =
- 'https://github.com/google-gemini/gemini-cli/issues/new?template=bug_report.md';
+ 'https://github.com/google-gemini/gemini-cli/issues/new?template=bug_report.yml';
if (description) {
url += `&title=${encodeURIComponent(description)}`;
}
- url += `&body=${encodeURIComponent(diagnosticInfo)}`;
+ url += `&info=${encodeURIComponent(info)}`;
return url;
};
@@ -469,7 +462,7 @@ Add any other context about the problem here.
process.env.SEATBELT_PROFILE = 'permissive-open';
const bugCommand = {
urlTemplate:
- 'https://custom-bug-tracker.com/new?title={title}&body={body}',
+ 'https://custom-bug-tracker.com/new?title={title}&info={info}',
};
mockConfig = {
...mockConfig,
@@ -479,14 +472,7 @@ Add any other context about the problem here.
const { handleSlashCommand } = getProcessor();
const bugDescription = 'This is a custom bug';
- const diagnosticInfo = `
-## Describe the bug
-A clear and concise description of what the bug is.
-
-## Additional context
-Add any other context about the problem here.
-
-## Diagnostic Information
+ const info = `
* **CLI Version:** 0.1.0
* **Git Commit:** ${GIT_COMMIT_INFO}
* **Operating System:** test-platform test-node-version
@@ -496,7 +482,7 @@ Add any other context about the problem here.
`;
const expectedUrl = bugCommand.urlTemplate
.replace('{title}', encodeURIComponent(bugDescription))
- .replace('{body}', encodeURIComponent(diagnosticInfo));
+ .replace('{info}', encodeURIComponent(info));
let commandResult: SlashCommandActionReturn | boolean = false;
await act(async () => {
diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.ts
index 8a34ddfe..b3b515e0 100644
--- a/packages/cli/src/ui/hooks/slashCommandProcessor.ts
+++ b/packages/cli/src/ui/hooks/slashCommandProcessor.ts
@@ -621,14 +621,7 @@ export const useSlashCommandProcessor = (
const cliVersion = await getCliVersion();
const memoryUsage = formatMemoryUsage(process.memoryUsage().rss);
- const diagnosticInfo = `
-## Describe the bug
-A clear and concise description of what the bug is.
-
-## Additional context
-Add any other context about the problem here.
-
-## Diagnostic Information
+ const info = `
* **CLI Version:** ${cliVersion}
* **Git Commit:** ${GIT_COMMIT_INFO}
* **Operating System:** ${osVersion}
@@ -638,14 +631,14 @@ Add any other context about the problem here.
`;
let bugReportUrl =
- 'https://github.com/google-gemini/gemini-cli/issues/new?template=bug_report.md&title={title}&body={body}';
+ 'https://github.com/google-gemini/gemini-cli/issues/new?template=bug_report.yml&title={title}&info={info}';
const bugCommand = config?.getBugCommand();
if (bugCommand?.urlTemplate) {
bugReportUrl = bugCommand.urlTemplate;
}
bugReportUrl = bugReportUrl
.replace('{title}', encodeURIComponent(bugDescription))
- .replace('{body}', encodeURIComponent(diagnosticInfo));
+ .replace('{info}', encodeURIComponent(info));
addMessage({
type: MessageType.INFO,