From 867f2b0e0a8fba2c73522b6a5554a960b098cac1 Mon Sep 17 00:00:00 2001 From: Sam Robson Date: Thu, 5 Mar 2026 18:28:34 +0000 Subject: [PATCH] test: verify overlay analysis is disabled for languages without per-language feature flags --- lib/analyze-action-post.js | 1 - lib/analyze-action.js | 1 - lib/autobuild-action.js | 1 - lib/init-action-post.js | 1 - lib/init-action.js | 1 - lib/resolve-environment-action.js | 1 - lib/setup-codeql-action.js | 1 - lib/start-proxy-action-post.js | 1 - lib/start-proxy-action.js | 1 - lib/upload-lib.js | 1 - lib/upload-sarif-action-post.js | 1 - lib/upload-sarif-action.js | 1 - src/config-utils.test.ts | 17 +++++++++++++++++ src/config-utils.ts | 8 +++++--- 14 files changed, 22 insertions(+), 15 deletions(-) diff --git a/lib/analyze-action-post.js b/lib/analyze-action-post.js index a1d3a9476..2b0944fa3 100644 --- a/lib/analyze-action-post.js +++ b/lib/analyze-action-post.js @@ -162095,7 +162095,6 @@ var featureConfig = { // Per-language overlay feature flags. Each has minimumVersion set to the // minimum CLI version that supports overlay analysis for that language. // Only languages that are GA or in staff-ship should have feature flags here. - // See https://github.com/github/codeql-core/issues/5120. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 37f9cf758..7635bcf11 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -107844,7 +107844,6 @@ var featureConfig = { // Per-language overlay feature flags. Each has minimumVersion set to the // minimum CLI version that supports overlay analysis for that language. // Only languages that are GA or in staff-ship should have feature flags here. - // See https://github.com/github/codeql-core/issues/5120. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index 27483c3c6..cd786f540 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -104144,7 +104144,6 @@ var featureConfig = { // Per-language overlay feature flags. Each has minimumVersion set to the // minimum CLI version that supports overlay analysis for that language. // Only languages that are GA or in staff-ship should have feature flags here. - // See https://github.com/github/codeql-core/issues/5120. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", diff --git a/lib/init-action-post.js b/lib/init-action-post.js index 5bf3fa045..ede950e52 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -165581,7 +165581,6 @@ var featureConfig = { // Per-language overlay feature flags. Each has minimumVersion set to the // minimum CLI version that supports overlay analysis for that language. // Only languages that are GA or in staff-ship should have feature flags here. - // See https://github.com/github/codeql-core/issues/5120. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", diff --git a/lib/init-action.js b/lib/init-action.js index 1984ba004..ee7de2d1d 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -105404,7 +105404,6 @@ var featureConfig = { // Per-language overlay feature flags. Each has minimumVersion set to the // minimum CLI version that supports overlay analysis for that language. // Only languages that are GA or in staff-ship should have feature flags here. - // See https://github.com/github/codeql-core/issues/5120. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", diff --git a/lib/resolve-environment-action.js b/lib/resolve-environment-action.js index c8fc414a8..f4da0c6a3 100644 --- a/lib/resolve-environment-action.js +++ b/lib/resolve-environment-action.js @@ -104135,7 +104135,6 @@ var featureConfig = { // Per-language overlay feature flags. Each has minimumVersion set to the // minimum CLI version that supports overlay analysis for that language. // Only languages that are GA or in staff-ship should have feature flags here. - // See https://github.com/github/codeql-core/issues/5120. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", diff --git a/lib/setup-codeql-action.js b/lib/setup-codeql-action.js index 6fd852209..239af7bcb 100644 --- a/lib/setup-codeql-action.js +++ b/lib/setup-codeql-action.js @@ -104032,7 +104032,6 @@ var featureConfig = { // Per-language overlay feature flags. Each has minimumVersion set to the // minimum CLI version that supports overlay analysis for that language. // Only languages that are GA or in staff-ship should have feature flags here. - // See https://github.com/github/codeql-core/issues/5120. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", diff --git a/lib/start-proxy-action-post.js b/lib/start-proxy-action-post.js index cb16abb2b..3a50dde49 100644 --- a/lib/start-proxy-action-post.js +++ b/lib/start-proxy-action-post.js @@ -161501,7 +161501,6 @@ var featureConfig = { // Per-language overlay feature flags. Each has minimumVersion set to the // minimum CLI version that supports overlay analysis for that language. // Only languages that are GA or in staff-ship should have feature flags here. - // See https://github.com/github/codeql-core/issues/5120. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index f58a672dd..7afdfef4c 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -120824,7 +120824,6 @@ var featureConfig = { // Per-language overlay feature flags. Each has minimumVersion set to the // minimum CLI version that supports overlay analysis for that language. // Only languages that are GA or in staff-ship should have feature flags here. - // See https://github.com/github/codeql-core/issues/5120. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 8b9170299..bf40226c3 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -107291,7 +107291,6 @@ var featureConfig = { // Per-language overlay feature flags. Each has minimumVersion set to the // minimum CLI version that supports overlay analysis for that language. // Only languages that are GA or in staff-ship should have feature flags here. - // See https://github.com/github/codeql-core/issues/5120. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", diff --git a/lib/upload-sarif-action-post.js b/lib/upload-sarif-action-post.js index 02927d2b7..66fd24ec5 100644 --- a/lib/upload-sarif-action-post.js +++ b/lib/upload-sarif-action-post.js @@ -161663,7 +161663,6 @@ var featureConfig = { // Per-language overlay feature flags. Each has minimumVersion set to the // minimum CLI version that supports overlay analysis for that language. // Only languages that are GA or in staff-ship should have feature flags here. - // See https://github.com/github/codeql-core/issues/5120. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index ed5d452e1..ed8cd0f8f 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -107005,7 +107005,6 @@ var featureConfig = { // Per-language overlay feature flags. Each has minimumVersion set to the // minimum CLI version that supports overlay analysis for that language. // Only languages that are GA or in staff-ship should have feature flags here. - // See https://github.com/github/codeql-core/issues/5120. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", diff --git a/src/config-utils.test.ts b/src/config-utils.test.ts index 06994c0ed..1887f1273 100644 --- a/src/config-utils.test.ts +++ b/src/config-utils.test.ts @@ -2011,6 +2011,23 @@ for (const language in KnownLanguage) { ); } +// Verify that a language without a per-language overlay feature flag cannot have +// overlay analysis enabled, even when the base overlay feature flag is on. +// Using cpp here as it doesn't currently have overlay support — update this if +// cpp gains overlay support. +test.serial( + checkOverlayEnablementMacro, + "No overlay analysis for language without per-language overlay feature flag", + { + languages: [KnownLanguage.cpp], + features: [Feature.OverlayAnalysis], + isPullRequest: true, + }, + { + disabledReason: OverlayDisabledReason.LanguageNotEnabled, + }, +); + test.serial( "hasActionsWorkflows doesn't throw if workflows folder doesn't exist", async (t) => { diff --git a/src/config-utils.ts b/src/config-utils.ts index b02ac139e..79ffdd30e 100644 --- a/src/config-utils.ts +++ b/src/config-utils.ts @@ -630,9 +630,11 @@ async function loadUserConfig( } } -// Maps languages to their overlay analysis feature flags. Only languages that -// are GA or in staff-ship for overlay analysis are included here. Languages -// without an entry will have overlay analysis disabled. +/** + * Maps languages to their overlay analysis feature flags. Only languages that + * are GA or in staff-ship for overlay analysis are included here. Languages + * without an entry will have overlay analysis disabled. + */ const OVERLAY_ANALYSIS_FEATURES: Partial> = { csharp: Feature.OverlayAnalysisCsharp, go: Feature.OverlayAnalysisGo,