Skip to content

Graduate overlay TRAP caching defaults - #4245

Open
henrymercer wants to merge 2 commits into
mainfrom
henrymercer/graduate-overlay-trap-caching
Open

henrymercer wants to merge 2 commits into
mainfrom
henrymercer/graduate-overlay-trap-caching

Conversation

@henrymercer

Copy link
Copy Markdown
Contributor

This removes the fully shipped OverlayAnalysisDisableTrapCaching feature flag and its environment variable. When overlay analysis is active, the Action now disables TRAP caching by default because overlay analysis supersedes it.

An explicit trap-caching: true or trap-caching: false input remains the highest-priority override. The default now also applies to manually enabled overlay analysis on GitHub Enterprise Server.

This does not add a changelog entry because the v4.34.0 changelog already announced the rollout.

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, Code Quality, ...).

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 and/or GitHub Enterprise Cloud with Data Residency.
  • GHES - Impacts CodeQL workflows on GitHub Enterprise Server.

How did/will you validate this change?

  • Unit tests - I am depending on unit test coverage (i.e. tests in .test.ts files).
  • End-to-end tests - I am depending on PR checks (i.e. tests in pr-checks).

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

  • Rollback - Change can only be disabled by rolling back the release or releasing a new version with a fix.
  • Other - Affected workflows can explicitly set trap-caching: true to restore TRAP caching while a fix is prepared.

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.

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

  • No special considerations - This change can be merged at any time.

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.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI max review requested due to automatic review settings October 16, 2026 13:15
@github-actions github-actions Bot added the size/S Should be easy to review label Oct 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

  • Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.

🟢 Approval recommended

The focused changes preserve override precedence, cover the changed defaults with tests, and have no identified blocking issues.

0 open findings

What changed in this PR

Makes disabling TRAP caching the default when CodeQL overlay analysis is active, while preserving explicit workflow overrides.

Changes:

  • Removes the graduated feature flag and simplifies default selection.
  • Updates tests for overlay defaults and input precedence.
  • Clarifies the trap-caching input description.
File Description
src/​feature-flags.ts Removes the flag and its environment-variable configuration.
src/​config-utils.ts Makes default selection synchronous and updates its caller.
src/​config-utils.test.ts Covers both overlay modes, explicit overrides, and runner defaults.
init/​action.yml Clarifies the input documentation.
Files excluded by content exclusion policy (1)
  • lib/entry-points.js

🧠 Review effort: Max


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@henrymercer
henrymercer marked this pull request as ready for review October 16, 2026 13:22
@henrymercer
henrymercer requested a review from a team as a code owner October 16, 2026 13:22
mbg
mbg previously approved these changes Oct 16, 2026

@mbg mbg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The changes look good. I just have one question about the effects on overlay analysis if TRAP caching is explicitly enabled. Maybe I knew the answer previously, but forgot.

Comment thread src/config-utils.ts
Comment on lines 955 to 957
// If the workflow specified something, always respect that.
const trapCaching = getOptionalInput("trap-caching");
if (trapCaching !== undefined) return trapCaching === "true";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

OOC: What happens if TRAP caching is explicitly enabled via the input, we restore the TRAP caches, but overlay analysis is also enabled? Would it be worth to document that here or in init/action.yml if that combination has effects on overlay analysis?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

With overlay analysis enabled, the extractor only writes TRAP files for changed files, so the TRAP cache is only really ever useful for files with identical content that have just been moved. This means that the overhead of downloading the cache (and the space it takes up in the Actions cache) is rarely worth it.

It's a good idea to document that in the input, I'll push a commit to do that.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added size/M Should be of average difficulty to review and removed size/S Should be easy to review labels Oct 16, 2026

This branch has not been deployed

No deployments
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