mirror of
https://github.com/github/codeql-action.git
synced 2026-04-26 16:58:47 +00:00
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:
Generated
+7
-19
@@ -85790,9 +85790,11 @@ async function getGitVersion(logger) {
|
||||
}
|
||||
async function logGitVersionTelemetry(config, logger) {
|
||||
const version = await getGitVersion(logger);
|
||||
if (version !== void 0) {
|
||||
if (version !== void 0 && 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",
|
||||
@@ -90192,17 +90194,10 @@ async function run() {
|
||||
// Arbitrarily choose the first language. We could also choose all languages, but that
|
||||
// increases the risk of misinterpreting the data.
|
||||
config.languages[0],
|
||||
makeDiagnostic(
|
||||
makeTelemetryDiagnostic(
|
||||
"codeql-action/bundle-download-telemetry",
|
||||
"CodeQL bundle download telemetry",
|
||||
{
|
||||
attributes: toolsDownloadStatusReport,
|
||||
visibility: {
|
||||
cliSummaryTable: false,
|
||||
statusPage: false,
|
||||
telemetry: true
|
||||
}
|
||||
}
|
||||
toolsDownloadStatusReport
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -90449,17 +90444,10 @@ async function recordZstdAvailability(config, zstdAvailability) {
|
||||
// Arbitrarily choose the first language. We could also choose all languages, but that
|
||||
// increases the risk of misinterpreting the data.
|
||||
config.languages[0],
|
||||
makeDiagnostic(
|
||||
makeTelemetryDiagnostic(
|
||||
"codeql-action/zstd-availability",
|
||||
"Zstandard availability",
|
||||
{
|
||||
attributes: zstdAvailability,
|
||||
visibility: {
|
||||
cliSummaryTable: false,
|
||||
statusPage: false,
|
||||
telemetry: true
|
||||
}
|
||||
}
|
||||
zstdAvailability
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user