Skip to content

Conversation

@kaspersv
Copy link
Contributor

@kaspersv kaspersv commented Nov 18, 2025

This PR introduces a fallback from overlay analysis to normal analysis if available runner disk space is low when deciding whether to perform overlay analysis during the init action. The fallback only applies when overlay analysis is enabled by feature flag and is ignored if overlay analysis is enabled by environment variable. The hardcoded limit of 20GB available disk space has been chosen based on telemetry from the codeql-action and will allow most +3m analysis runs to run in overlay mode.

Risk assessment

For internal use only. Please select the risk level of this change:

  • Low risk: Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.

Which use cases does this change impact?

  • Advanced setup - Impacts users who have custom workflows.
  • Default setup - Impacts users who use default setup.
  • Code Scanning - Impacts Code Scanning (i.e. analysis-kinds: code-scanning).
  • Code Quality - Impacts Code Quality (i.e. analysis-kinds: code-quality).

How did/will you validate this change?

  • Test repository - This change will be tested on a test repository before merging.
  • Unit tests - I am depending on unit test coverage (i.e. tests in .test.ts files).

If something goes wrong after this change is released, what are the mitigation and rollback strategies?

  • Feature flags - All new or changed code paths can be fully disabled with corresponding feature flags.
  • Rollback - Change can only be disabled by rolling back the release or releasing a new version with a fix.

How will you know if something goes wrong after this change is released?

  • Telemetry - I rely on existing telemetry or have made changes to the telemetry.
    • Dashboards - I will watch relevant dashboards for issues after the release. Consider whether this requires this change to be released at a particular time rather than as part of a regular release.
    • Alerts - New or existing monitors will trip if something goes wrong with this change.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Consider adding a changelog entry for this change.
  • Confirm the readme and docs have been updated if necessary.

@github-actions github-actions bot added the size/M Should be of average difficulty to review label Nov 18, 2025
@kaspersv kaspersv marked this pull request as ready for review November 18, 2025 08:51
@kaspersv kaspersv requested a review from a team as a code owner November 18, 2025 08:51
Copilot AI review requested due to automatic review settings November 18, 2025 08:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Copilot finished reviewing on behalf of kaspersv November 18, 2025 08:53
@kaspersv kaspersv requested a review from mbg November 18, 2025 09:16
Copy link
Member

@mbg mbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment about the order of checks, otherwise I am happy to accept this as a conservative guard against regressions that might result from the increased space requirements.

@kaspersv kaspersv force-pushed the kaspersv/overlay-disk-available-limit branch from 182eebd to 4eccb37 Compare November 19, 2025 07:41
@kaspersv kaspersv requested a review from mbg November 19, 2025 08:36
Copy link
Member

@mbg mbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the feedback! I think is good to merge now.

One style comment, but not worth addressing here.

Comment on lines +705 to +720
} else {
if (isAnalyzingPullRequest()) {
overlayDatabaseMode = OverlayDatabaseMode.Overlay;
useOverlayDatabaseCaching = true;
logger.info(
`Setting overlay database mode to ${overlayDatabaseMode} ` +
"with caching because we are analyzing a pull request.",
);
} else if (await isAnalyzingDefaultBranch()) {
overlayDatabaseMode = OverlayDatabaseMode.OverlayBase;
useOverlayDatabaseCaching = true;
logger.info(
`Setting overlay database mode to ${overlayDatabaseMode} ` +
"with caching because we are analyzing the default branch.",
);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: This could now just be two else if blocks rather than an if/else inside an else block.

@kaspersv kaspersv merged commit ce07e7d into main Nov 19, 2025
241 checks passed
@kaspersv kaspersv deleted the kaspersv/overlay-disk-available-limit branch November 19, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Should be of average difficulty to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants