Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d1bdc0e
Create separate directory for overlay source code
henrymercer Feb 17, 2026
d28d996
Compute cache key for overlay language status
henrymercer Feb 17, 2026
69c2819
Add save and restore methods
henrymercer Feb 17, 2026
e275d63
Generalise status to multiple languages
henrymercer Feb 17, 2026
ebad062
Skip overlay analysis based on cached status
henrymercer Feb 17, 2026
96961e0
Save overlay status to Actions cache
henrymercer Feb 17, 2026
827bba6
Introduce feature flags for saving and checking status
henrymercer Feb 17, 2026
6c405c2
Be more explicit about attempt to build overlay DB
henrymercer Feb 17, 2026
0c47ae1
Sort doc URLs
henrymercer Feb 17, 2026
7b7a951
Add status page diagnostic when overlay skipped
henrymercer Feb 17, 2026
ef58c00
Only store overlay status if analysis failed
henrymercer Feb 17, 2026
cc0dce0
Improve diagnostic message wording
henrymercer Feb 17, 2026
d24014a
Tweak diagnostic message
henrymercer Feb 17, 2026
3dd1275
Improve error messages
henrymercer Feb 17, 2026
554b931
More error message improvements
henrymercer Feb 17, 2026
5c583bb
Include diagnostics in bundle
henrymercer Feb 17, 2026
05d4e25
Avoid mutating languages array in overlay status functions
henrymercer Feb 17, 2026
657f337
Add tests for shouldSkipOverlayAnalysis
henrymercer Feb 17, 2026
fa56ea8
Extract status file path helper
henrymercer Feb 17, 2026
898ae16
Improve log message
henrymercer Feb 17, 2026
4191f52
Address review comments
henrymercer Feb 19, 2026
4e71011
Add feature flag for more lenient overlay resource checks
henrymercer Feb 20, 2026
1847416
Merge pull request #3498 from github/henrymercer/overlay-resource-che…
henrymercer Feb 23, 2026
dc00a6f
Improve error message
henrymercer Feb 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Be more explicit about attempt to build overlay DB
  • Loading branch information
henrymercer committed Feb 17, 2026
commit 6c405c2562eb8d106668749d4264b45306a0da18
5 changes: 3 additions & 2 deletions lib/init-action-post.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/init-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 20 additions & 8 deletions src/init-action-post-helper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,11 @@ test("saves overlay status when overlay-base analysis did not complete successfu
);
t.deepEqual(
saveOverlayStatusStub.firstCall.args[3],
{ builtOverlayBaseDatabase: false },
"fourth arg should be the overlay status with builtOverlayBaseDatabase: false",
{
attemptedToBuildOverlayBaseDatabase: true,
builtOverlayBaseDatabase: false,
},
"fourth arg should be the overlay status recording an unsuccessful build attempt",
);
});
});
Expand Down Expand Up @@ -408,17 +411,18 @@ test("does not save overlay status when OverlayAnalysisStatusSave feature flag i
});
});

test("does not save overlay status when analysis completed successfully", async (t) => {
test("saves overlay status recording successful build when analysis completed successfully", async (t) => {
return await util.withTmpDir(async (tmpDir) => {
process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository";
process.env["RUNNER_TEMP"] = tmpDir;
// Mark analyze as having completed successfully.
process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY] = "true";

sinon.stub(util, "checkDiskUsage").resolves({
const diskUsage: util.DiskUsage = {
numAvailableBytes: 100 * 1024 * 1024 * 1024,
numTotalBytes: 200 * 1024 * 1024 * 1024,
});
};
sinon.stub(util, "checkDiskUsage").resolves(diskUsage);

const saveOverlayStatusStub = sinon
.stub(overlayStatus, "saveOverlayStatus")
Expand All @@ -434,13 +438,21 @@ test("does not save overlay status when analysis completed successfully", async
overlayDatabaseMode: OverlayDatabaseMode.OverlayBase,
}),
parseRepositoryNwo("github/codeql-action"),
createFeatures([]),
createFeatures([Feature.OverlayAnalysisStatusSave]),
getRunnerLogger(true),
);

t.true(
saveOverlayStatusStub.notCalled,
"saveOverlayStatus should not be called when analysis completed successfully",
saveOverlayStatusStub.calledOnce,
"saveOverlayStatus should be called exactly once",
);
t.deepEqual(
saveOverlayStatusStub.firstCall.args[3],
{
attemptedToBuildOverlayBaseDatabase: true,
builtOverlayBaseDatabase: true,
},
"fourth arg should be the overlay status recording a successful build attempt",
);
});
});
Expand Down
5 changes: 3 additions & 2 deletions src/init-action-post-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,12 @@ async function recordOverlayStatus(
) {
if (
config.overlayDatabaseMode === OverlayDatabaseMode.OverlayBase &&
process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY] !== "true" &&
(await features.getValue(Feature.OverlayAnalysisStatusSave))
) {
Comment thread
mbg marked this conversation as resolved.
const overlayStatus = {
builtOverlayBaseDatabase: false,
attemptedToBuildOverlayBaseDatabase: true,
builtOverlayBaseDatabase:
process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY] === "true",
} satisfies OverlayStatus;
Comment thread
mbg marked this conversation as resolved.
Outdated

const diskUsage = await checkDiskUsage(logger);
Expand Down
7 changes: 6 additions & 1 deletion src/overlay/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ const STATUS_FILE_NAME = "overlay-status.json";

/** Status of an overlay analysis for a set of languages. */
Comment thread
mbg marked this conversation as resolved.
Outdated
export interface OverlayStatus {
/** Whether the job attempted to build an overlay base database. */
attemptedToBuildOverlayBaseDatabase: boolean;
/** Whether the job successfully built an overlay base database. */
builtOverlayBaseDatabase: boolean;
}
Expand All @@ -48,7 +50,10 @@ export async function shouldSkipOverlayAnalysis(
logger.debug("No cached overlay status found.");
Comment thread
mbg marked this conversation as resolved.
Outdated
return false;
}
if (!status.builtOverlayBaseDatabase) {
if (
status.attemptedToBuildOverlayBaseDatabase &&
!status.builtOverlayBaseDatabase
) {
Comment thread
mbg marked this conversation as resolved.
logger.info(
"Cached overlay status indicates that building an overlay base database was unsuccessful, so will skip overlay analysis.",
);
Expand Down