Add feature flag for more lenient overlay resource checks#3498
Add feature flag for more lenient overlay resource checks#3498henrymercer wants to merge 1 commit intohenrymercer/overlay-statusfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new feature flag OverlayAnalysisResourceChecksV2 to lower the minimum disk space requirement for overlay analysis from 20 GB to 14 GB, enabling it to run on standard GitHub Actions runners. The change is fully gated behind a feature flag for safe rollout.
Changes:
- Added
OverlayAnalysisResourceChecksV2feature flag with environment variableCODEQL_ACTION_OVERLAY_ANALYSIS_RESOURCE_CHECKS_V2 - Introduced v2 disk space constants (14 GB threshold vs 20 GB for v1)
- Updated
runnerSupportsOverlayAnalysisto conditionally use v2 threshold when flag is enabled - Enhanced logging to show both available and required disk space in error messages
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/feature-flags.ts | Added new OverlayAnalysisResourceChecksV2 feature flag definition and configuration |
| src/config-utils.ts | Added v2 disk space constants, updated resource check logic to use v2 threshold when flag enabled, improved logging |
| src/config-utils.test.ts | Added three comprehensive test cases covering v2 resource check scenarios |
| lib/*.js | Generated JavaScript files reflecting TypeScript changes (auto-generated, not reviewed) |
c9bbb7b to
4e71011
Compare
| /** | ||
| * The v2 minimum available disk space (in MB) required to perform overlay | ||
| * analysis. This is a lower threshold than the v1 limit, allowing overlay | ||
| * analysis to run on runners with less available disk space. | ||
| */ | ||
| const OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB = 14000; | ||
| const OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = | ||
| OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1_000_000; | ||
|
|
There was a problem hiding this comment.
This is a lower threshold than the v1 limit, allowing overlay
- analysis to run on runners with less available disk space
I'm wondering if the naming should reflect that instead. Or do we envision this to be the new default in a moment?
There was a problem hiding this comment.
Also, I do dislike the fact that we are adding significant jsdoc to a variable that is used on the line below, which in turn then does not have any jsdoc. But I do see the precedent just above.
We would like to start rolling out overlay to standard Actions runners. This PR adds a feature flag to lower the disk space requirement to 14 GB, which is small enough to include the set of standard Actions runners.
Based on #3487 to avoid conflicts. We don't plan to roll this out before #3487 is merged.
Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Workflow types:
dynamicworkflows (Default Setup, CCR, ...).Products:
analysis-kinds: code-scanning.Environments:
github.comand/or GitHub Enterprise Cloud with Data Residency.How did/will you validate this change?
.test.tsfiles).If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist