From a3fdd0e0b5ce795f906edcd17cb6453d14e531f4 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Mon, 9 Mar 2026 17:12:02 +0000 Subject: [PATCH] Add telemetry diagnostic to track whether repo property is used --- lib/init-action.js | 10 ++++++++++ src/init-action.ts | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/lib/init-action.js b/lib/init-action.js index 8b279f437..bcf110f6a 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -109761,6 +109761,16 @@ async function run(startedAt) { ) ); } + if (config.enableFileCoverageInformation && isAnalyzingPullRequest() && repositoryPropertiesResult.orElse({})["github-codeql-file-coverage-on-prs" /* FILE_COVERAGE_ON_PRS */] === true) { + addNoLanguageDiagnostic( + config, + makeTelemetryDiagnostic( + "codeql-action/file-coverage-on-prs-enabled-by-repository-property", + "File coverage on PRs enabled by repository property", + {} + ) + ); + } await checkInstallPython311(config.languages, codeql); } catch (unwrappedError) { const error3 = wrapError(unwrappedError); diff --git a/src/init-action.ts b/src/init-action.ts index 4806141a5..3b673723a 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -14,6 +14,7 @@ import { getOptionalInput, getRequiredInput, getTemporaryDirectory, + isAnalyzingPullRequest, persistInputs, } from "./actions-util"; import { AnalysisKind, getAnalysisKinds } from "./analyses"; @@ -42,6 +43,7 @@ import { Feature, FeatureEnablement, initFeatures } from "./feature-flags"; import { loadPropertiesFromApi, RepositoryProperties, + RepositoryPropertyName, } from "./feature-flags/properties"; import { checkInstallPython311, @@ -398,6 +400,23 @@ async function run(startedAt: Date) { ); } + if ( + config.enableFileCoverageInformation && + isAnalyzingPullRequest() && + repositoryPropertiesResult.orElse({})[ + RepositoryPropertyName.FILE_COVERAGE_ON_PRS + ] === true + ) { + addNoLanguageDiagnostic( + config, + makeTelemetryDiagnostic( + "codeql-action/file-coverage-on-prs-enabled-by-repository-property", + "File coverage on PRs enabled by repository property", + {}, + ), + ); + } + await checkInstallPython311(config.languages, codeql); } catch (unwrappedError) { const error = wrapError(unwrappedError);