Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Create support ticket on Zendesk #5678

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 42 additions & 16 deletions vscode/src/services/utils/issue-reporter.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,57 @@
import * as vscode from 'vscode'

import packageJson from '../../../package.json'
import { version } from '../../version'
import { getConfiguration } from '../../configuration'
import { isDotComAuthed } from '@sourcegraph/cody-shared'

function getOSName(): string {
if (process.platform === 'win32') {
return 'Windows'
}
if (process.platform === 'darwin') {
return 'macOS'
}
return 'Linux'
}

export function openCodyIssueReporter() {
void vscode.commands.executeCommand('workbench.action.openIssueReporter', {
extensionId: `${packageJson.publisher}.${packageJson.name}`,
issueBody,
issueTitle: 'bug: ',
})
const config = getConfiguration()
const baseUrl = "https://help.sourcegraph.com/hc/en-us/requests/new";
const subject = "Cody Issue Report";

const params = new URLSearchParams({
ticket_form_id: "7300762080909",
tf_subject: encodeURIComponent(subject),
tf_description: encodeURIComponent(generateIssueBody(config)),
tf_360041500552: "defect_report"
});

const url = `${baseUrl}?${params.toString()}`;
vscode.env.openExternal(vscode.Uri.parse(url));
}

const issueBody = `## Extension Information
<!-- Do not remove the pre-filled information below -->
- Cody Version: ${version}
function generateIssueBody(config: ReturnType<typeof getConfiguration>): string {
return `- Cody Version: ${version}
- VS Code Version: ${vscode.version}
- Extension Host: ${vscode.env.appHost}
- Operating System: ${getOSName()}
- Cody Free/Pro: ${isDotComAuthed()}

Cody Configuration
- Server Endpoint: ${config.serverEndpoint}
- Use Context: ${config.useContext}
- Autocomplete Enabled: ${config.autocomplete}
- Code Actions Enabled: ${config.codeActions}
- Command Hints Enabled: ${config.commandHints}
- Debug Verbose: ${config.debugVerbose}
- Telemetry Level: ${config.telemetryLevel}

## Steps to Reproduce
<!-- A detailed description of the issue -->
Steps to Reproduce
1.
2.
3.

## Expected Behaviour
<!-- A detailed description of what you expected to happen -->
Summary of Issue:

## Logs
<!-- Attach logs from the 'Cody Debug: Export Logs' command -->
BEFORE SUBMITTING PLEASE USE THE "EXPORT LOGS" COMMAND TO INCLUDE ANY LOGS THAT MAY BE RELEVANT TO THIS ISSUE.
`
}
Loading