Refactor existing telemetry diagnostics to use makeTelemetryDiagnostic

Refactored bundle-download-telemetry and zstd-availability diagnostics
in init-action.ts to use the new makeTelemetryDiagnostic helper function.
Also added guard for empty languages array in logGitVersionTelemetry.

Co-authored-by: henrymercer <14129055+henrymercer@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-16 17:24:57 +00:00
parent c3dc529aef
commit 393c074965
3 changed files with 15 additions and 38 deletions
+3 -1
View File
@@ -88,9 +88,11 @@ export async function logGitVersionTelemetry(
logger: Logger,
): Promise<void> {
const version = await getGitVersion(logger);
if (version !== undefined) {
if (version !== undefined && config.languages.length > 0) {
addDiagnostic(
config,
// Arbitrarily choose the first language. We could also choose all languages, but that
// increases the risk of misinterpreting the data.
config.languages[0],
makeTelemetryDiagnostic(
"codeql-action/git-version-telemetry",