Add detected tar version to telemetry

This commit is contained in:
Henry Mercer
2024-08-16 12:18:36 +01:00
parent ffa1b05b27
commit 335044a8db
6 changed files with 71 additions and 12 deletions

View File

@@ -42,6 +42,7 @@ import {
getActionsStatus,
sendStatusReport,
} from "./status-report";
import { isZstdAvailable } from "./tar";
import { ToolsFeature } from "./tools-features";
import { getTotalCacheSize } from "./trap-caching";
import {
@@ -375,6 +376,8 @@ async function run() {
try {
cleanupDatabaseClusterDirectory(config, logger);
await logZstdAvailability(config, logger);
// Log CodeQL download telemetry, if appropriate
if (toolsDownloadStatusReport) {
addDiagnostic(
@@ -670,6 +673,29 @@ function getTrapCachingEnabled(): boolean {
return true;
}
async function logZstdAvailability(config: configUtils.Config, logger: Logger) {
// Log zstd availability
const zstdAvailableResult = await isZstdAvailable(logger);
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],
makeDiagnostic(
"codeql-action/zstd-availability",
"Zstandard availability",
{
attributes: zstdAvailableResult,
visibility: {
cliSummaryTable: false,
statusPage: false,
telemetry: true,
},
},
),
);
}
async function runWrapper() {
try {
await run();