Add telemetry diagnostic to track whether repo property is used

This commit is contained in:
Henry Mercer
2026-03-09 17:12:02 +00:00
parent 9e8c05933f
commit a3fdd0e0b5
2 changed files with 29 additions and 0 deletions
+10
View File
@@ -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);
+19
View File
@@ -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);