From 2d4c474c2ca5ea2965b9e53fabb7b67b0100016c Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Tue, 28 Jul 2026 12:02:41 +0100 Subject: [PATCH] Log `!analysisKindSupported` case --- lib/entry-points.js | 8 ++++++-- src/config/file.test.ts | 4 ++++ src/config/file.ts | 12 ++++++------ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/entry-points.js b/lib/entry-points.js index 5904ad07a..46c44a818 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -148503,15 +148503,19 @@ async function getConfigFileInput({ } const propertyValue = repositoryProperties["github-codeql-config-file" /* CONFIG_FILE */]; const analysisKindSupported = analysisKinds === void 0 || analysisKinds.includes("code-scanning" /* CodeScanning */) && analysisKinds.length === 1; - if (analysisKindSupported && propertyValue !== void 0 && propertyValue.trim().length > 0) { + if (propertyValue !== void 0 && propertyValue.trim().length > 0) { const useRepositoryProperty = await features.getValue( "config_file_repository_property" /* ConfigFileRepositoryProperty */ ); - if (useRepositoryProperty) { + if (analysisKindSupported && useRepositoryProperty) { logger.info( `Using configuration file input from repository property: ${propertyValue}` ); return propertyValue; + } else if (!analysisKindSupported) { + logger.info( + "Ignoring configuration file input from repository property, because it is unsupported for the current analysis kind." + ); } else { logger.info( "Ignoring configuration file input from repository property, because the corresponding feature flag is disabled." diff --git a/src/config/file.test.ts b/src/config/file.test.ts index 17ac21d56..0833ad3d0 100644 --- a/src/config/file.test.ts +++ b/src/config/file.test.ts @@ -79,6 +79,10 @@ test("getConfigFileInput ignores repository property for other analysis kinds", // Since the analysis kind is unsupported, we should ignore the repository property. await target .withArgs(repositoryProperties, unsupportedCase) + .logs( + t, + "Ignoring configuration file input from repository property, because it is unsupported for the current analysis kind.", + ) .passes(t.is, undefined); } }); diff --git a/src/config/file.ts b/src/config/file.ts index 9858328e1..be0e415a3 100644 --- a/src/config/file.ts +++ b/src/config/file.ts @@ -55,21 +55,21 @@ export async function getConfigFileInput( (analysisKinds.includes(AnalysisKind.CodeScanning) && analysisKinds.length === 1); - if ( - analysisKindSupported && - propertyValue !== undefined && - propertyValue.trim().length > 0 - ) { + if (propertyValue !== undefined && propertyValue.trim().length > 0) { // Only use the repository property value if the FF is enabled. const useRepositoryProperty = await features.getValue( Feature.ConfigFileRepositoryProperty, ); - if (useRepositoryProperty) { + if (analysisKindSupported && useRepositoryProperty) { logger.info( `Using configuration file input from repository property: ${propertyValue}`, ); return propertyValue; + } else if (!analysisKindSupported) { + logger.info( + "Ignoring configuration file input from repository property, because it is unsupported for the current analysis kind.", + ); } else { logger.info( "Ignoring configuration file input from repository property, because the corresponding feature flag is disabled.",