Skip to content

Conversation

@kaspersv
Copy link
Contributor

@kaspersv kaspersv commented Nov 27, 2025

This PR introduces a new feature flag that will cause the action to skip resource checks (disk and memory) for overlay analysis when enabled. The motivation is to ensure that we can continue to evaluate overlay analysis with runners that don't satisfy the minimum resource requirements, such as standard GitHub-hosted runners that do not satisfy the current minimum for available disk space.

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?

Workflow types:

  • Advanced setup - Impacts users who have custom CodeQL workflows.
  • Managed - Impacts users with dynamic workflows (Default Setup, CCR, ...).

Products:

  • Code Scanning - The changes impact analyses when analysis-kinds: code-scanning.
  • Code Quality - The changes impact analyses when analysis-kinds: code-quality.

Environments:

  • Dotcom - Impacts CodeQL workflows on github.com.

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.

Are there any special considerations for merging or releasing this change?

  • No special considerations - This change can be merged at any time.
  • Special considerations - This change should only be merged once certain preconditions are met. Please provide details of those or link to this PR from an internal issue.

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 27, 2025
@kaspersv kaspersv force-pushed the kaspersv/overlay-no-resource-checks-option branch 2 times, most recently from 47b5fac to 3aa1074 Compare November 27, 2025 11:27
@kaspersv kaspersv force-pushed the kaspersv/overlay-no-resource-checks-option branch from 3aa1074 to 1ffb7dd Compare November 27, 2025 11:30
@kaspersv kaspersv marked this pull request as ready for review November 27, 2025 12:00
@kaspersv kaspersv requested a review from a team as a code owner November 27, 2025 12:00
Copilot AI review requested due to automatic review settings November 27, 2025 12:00
Copilot finished reviewing on behalf of kaspersv November 27, 2025 12:02
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.

Pull request overview

This PR adds a new feature flag OverlayAnalysisSkipResourceChecks that allows the CodeQL Action to bypass disk space and memory requirements for overlay analysis. This enables testing and evaluation of overlay analysis on runners that don't meet the standard minimum requirements (20GB disk space and 5GB memory), such as standard GitHub-hosted runners.

Key Changes

  • Introduced new feature flag Feature.OverlayAnalysisSkipResourceChecks with default value false
  • Refactored resource checking logic into a dedicated runnerSupportsOverlayAnalysis() function
  • Modified getOverlayDatabaseMode() to conditionally skip resource checks when the flag is enabled

Reviewed changes

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

File Description
src/feature-flags.ts Adds the new OverlayAnalysisSkipResourceChecks feature flag definition with environment variable support
src/config-utils.ts Extracts resource checking logic into runnerSupportsOverlayAnalysis() and conditionally applies checks based on the feature flag
src/config-utils.test.ts Adds comprehensive test coverage for the new flag in both PR and default branch scenarios with insufficient disk/memory
lib/*.js Auto-generated JavaScript compiled from TypeScript sources (not reviewed per guidelines)

mbg
mbg previously approved these changes Nov 27, 2025
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.

This also looks good. Just a minor comment about the order of the FF definitions.

Comment on lines 78 to +79
OverlayAnalysisSwift = "overlay_analysis_swift",
OverlayAnalysisSkipResourceChecks = "overlay_analysis_skip_resource_checks",
Copy link
Member

Choose a reason for hiding this comment

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

Minor: We try to keep the FFs in alphabetical order, so I think this should come earlier on in the list.

envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT",
minimumVersion: undefined,
},
[Feature.OverlayAnalysisSkipResourceChecks]: {
Copy link
Member

Choose a reason for hiding this comment

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

Minor: Same point about alphabetical order.

return true;
}

async function runnerSupportsOverlayAnalysis(
Copy link
Member

Choose a reason for hiding this comment

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

Minor: A docs comment for this function would be nice.

Base automatically changed from kaspersv/overlay-memory-limit to main November 27, 2025 14:26
@kaspersv kaspersv dismissed mbg’s stale review November 27, 2025 14:26

The base branch was changed.

@kaspersv kaspersv requested a review from mbg November 27, 2025 14:26
@kaspersv kaspersv merged commit 75b2f49 into main Nov 28, 2025
241 checks passed
@kaspersv kaspersv deleted the kaspersv/overlay-no-resource-checks-option branch November 28, 2025 09:01
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