Log !analysisKindSupported case

This commit is contained in:
Michael B. Gale
2026-07-28 12:02:41 +01:00
parent 8289a49271
commit 2d4c474c2c
3 changed files with 16 additions and 8 deletions

8
lib/entry-points.js generated
View File

@@ -148503,15 +148503,19 @@ async function getConfigFileInput({
} }
const propertyValue = repositoryProperties["github-codeql-config-file" /* CONFIG_FILE */]; const propertyValue = repositoryProperties["github-codeql-config-file" /* CONFIG_FILE */];
const analysisKindSupported = analysisKinds === void 0 || analysisKinds.includes("code-scanning" /* CodeScanning */) && analysisKinds.length === 1; 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( const useRepositoryProperty = await features.getValue(
"config_file_repository_property" /* ConfigFileRepositoryProperty */ "config_file_repository_property" /* ConfigFileRepositoryProperty */
); );
if (useRepositoryProperty) { if (analysisKindSupported && useRepositoryProperty) {
logger.info( logger.info(
`Using configuration file input from repository property: ${propertyValue}` `Using configuration file input from repository property: ${propertyValue}`
); );
return 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 { } else {
logger.info( logger.info(
"Ignoring configuration file input from repository property, because the corresponding feature flag is disabled." "Ignoring configuration file input from repository property, because the corresponding feature flag is disabled."

View File

@@ -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. // Since the analysis kind is unsupported, we should ignore the repository property.
await target await target
.withArgs(repositoryProperties, unsupportedCase) .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); .passes(t.is, undefined);
} }
}); });

View File

@@ -55,21 +55,21 @@ export async function getConfigFileInput(
(analysisKinds.includes(AnalysisKind.CodeScanning) && (analysisKinds.includes(AnalysisKind.CodeScanning) &&
analysisKinds.length === 1); analysisKinds.length === 1);
if ( if (propertyValue !== undefined && propertyValue.trim().length > 0) {
analysisKindSupported &&
propertyValue !== undefined &&
propertyValue.trim().length > 0
) {
// Only use the repository property value if the FF is enabled. // Only use the repository property value if the FF is enabled.
const useRepositoryProperty = await features.getValue( const useRepositoryProperty = await features.getValue(
Feature.ConfigFileRepositoryProperty, Feature.ConfigFileRepositoryProperty,
); );
if (useRepositoryProperty) { if (analysisKindSupported && useRepositoryProperty) {
logger.info( logger.info(
`Using configuration file input from repository property: ${propertyValue}`, `Using configuration file input from repository property: ${propertyValue}`,
); );
return 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 { } else {
logger.info( logger.info(
"Ignoring configuration file input from repository property, because the corresponding feature flag is disabled.", "Ignoring configuration file input from repository property, because the corresponding feature flag is disabled.",