Skip to content

Commit e259d26

Browse files
committed
refactor: rename overlay-disabled reason and add changelog entry
1 parent 8ab64a2 commit e259d26

5 files changed

Lines changed: 19 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
44

55
## [UNRELEASED]
66

7-
No user facing changes.
7+
- For performance and accuracy reasons, [improved incremental analysis](https://github.com/github/roadmap/issues/1158) will now only be enabled on a pull request when diff-informed analysis is also enabled for that run. If diff-informed analysis is unavailable (for example, because the PR diff ranges could not be computed), the action will fall back to a full analysis. [#3791](https://github.com/github/codeql-action/pull/3791)
88

99
## 4.35.3 - 01 May 2026
1010

lib/init-action.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config-utils.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { GitVersionInfo } from "./git-utils";
2121
import { BuiltInLanguage, Language } from "./languages";
2222
import { getRunnerLogger } from "./logging";
2323
import { CODEQL_OVERLAY_MINIMUM_VERSION } from "./overlay";
24+
import * as overlayDiagnostics from "./overlay/diagnostics";
2425
import { OverlayDisabledReason } from "./overlay/diagnostics";
2526
import { OverlayDatabaseMode } from "./overlay/overlay-database-mode";
2627
import * as overlayStatus from "./overlay/status";
@@ -2245,6 +2246,9 @@ test("applyIncrementalAnalysisSettings: disables overlay analysis when diff rang
22452246
config.useOverlayDatabaseCaching = true;
22462247
const codeql = createStubCodeQL({});
22472248
const logger = getRunnerLogger(true);
2249+
const addDiagnosticsStub = sinon
2250+
.stub(overlayDiagnostics, "addOverlayDisablementDiagnostics")
2251+
.resolves();
22482252

22492253
await configUtils.applyIncrementalAnalysisSettings(
22502254
config,
@@ -2256,6 +2260,11 @@ test("applyIncrementalAnalysisSettings: disables overlay analysis when diff rang
22562260
t.is(config.overlayDatabaseMode, OverlayDatabaseMode.None);
22572261
t.is(config.useOverlayDatabaseCaching, false);
22582262
t.deepEqual(config.extraQueryExclusions, []);
2263+
t.true(addDiagnosticsStub.calledOnce);
2264+
t.is(
2265+
addDiagnosticsStub.firstCall.args[2],
2266+
OverlayDisabledReason.DiffInformedAnalysisNotEnabled,
2267+
);
22592268
});
22602269

22612270
test("applyIncrementalAnalysisSettings: adds exclusions for diff-informed-only runs", async (t) => {

src/config-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ export async function applyIncrementalAnalysisSettings(
11071107
await addOverlayDisablementDiagnostics(
11081108
config,
11091109
codeql,
1110-
OverlayDisabledReason.PrDiffRangesNotComputed,
1110+
OverlayDisabledReason.DiffInformedAnalysisNotEnabled,
11111111
);
11121112
}
11131113

src/overlay/diagnostics.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ export enum OverlayDisabledReason {
4040
/** The top-level overlay analysis feature flag is not enabled. */
4141
OverallFeatureNotEnabled = "overall-feature-not-enabled",
4242
/**
43-
* Overlay analysis was selected for a pull request, but the PR diff ranges
44-
* needed for diff-informed analysis could not be computed. Overlay analysis
45-
* has only been validated in combination with diff-informed analysis, so we
46-
* fall back to a non-overlay analysis in this case.
43+
* Overlay analysis was selected for a pull request, but diff-informed
44+
* analysis was not enabled for the run (for example, because the
45+
* `DiffInformedQueries` feature flag is off, the GHES version is too old,
46+
* or the PR diff ranges could not be computed). Overlay analysis has only
47+
* been validated in combination with diff-informed analysis, so we fall
48+
* back to a non-overlay analysis in this case.
4749
*/
48-
PrDiffRangesNotComputed = "pr-diff-ranges-not-computed",
50+
DiffInformedAnalysisNotEnabled = "diff-informed-analysis-not-enabled",
4951
/** Overlay analysis was skipped because it previously failed with similar hardware resources. */
5052
SkippedDueToCachedStatus = "skipped-due-to-cached-status",
5153
/** Disk usage could not be determined during the overlay status check. */

0 commit comments

Comments
 (0)