Skip to content

fix(cache-strategy-analyzer): recognize run_id+restore-keys as valid "last one wins" pattern#28880

Merged
pelikhan merged 3 commits intomainfrom
copilot/fix-cache-strategy-analyzer
Apr 28, 2026
Merged

fix(cache-strategy-analyzer): recognize run_id+restore-keys as valid "last one wins" pattern#28880
pelikhan merged 3 commits intomainfrom
copilot/fix-cache-strategy-analyzer

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

The analyzer was flagging any cache key containing run_id as 🔴 Critical, incorrectly treating a deliberate "last write wins" pattern as a misconfiguration. The valid pattern — <prefix>-${{ github.run_id }} key with <prefix>- restore-key — intentionally saves state under a unique key per run while always restoring from the most recent prior entry.

Changes

  • Phase 2.3run_id keys are only misconfigured when there are no restore-key fallbacks; added a callout explaining the "last one wins" pattern
  • Phase 4 severity table — Critical criterion tightened to run_id key and no restore-keys configured
  • Issue template recommended fix — Guides toward adding a restore-key fallback rather than removing run_id
  • Best practices item 1 — Updated to "volatile keys without restore-keys"; explicitly notes run_id + restore-key should not be flagged

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv (http block)
  • https://api.github.com/repos/github/gh-aw
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .default_branch (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI and others added 2 commits April 28, 2026 09:26
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/79f548ad-dbfb-4416-89b0-c13cc3225a6a

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…'last one wins' pattern

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/79f548ad-dbfb-4416-89b0-c13cc3225a6a

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix cache strategy analyzer to recognize valid last one wins pattern fix(cache-strategy-analyzer): recognize run_id+restore-keys as valid "last one wins" pattern Apr 28, 2026
Copilot AI requested a review from pelikhan April 28, 2026 09:32
@pelikhan pelikhan marked this pull request as ready for review April 28, 2026 09:33
Copilot AI review requested due to automatic review settings April 28, 2026 09:33
@pelikhan pelikhan merged commit 6f6b32b into main Apr 28, 2026
20 checks passed
@pelikhan pelikhan deleted the copilot/fix-cache-strategy-analyzer branch April 28, 2026 09:33
@github-actions github-actions Bot mentioned this pull request Apr 28, 2026
Copy link
Copy Markdown
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

Updates the Daily Cache Strategy Analyzer’s guidance so ${{ github.run_id }} cache keys are only treated as misconfigurations when no restore-keys are present (documenting the valid “last one wins” pattern), and adjusts several workflow lockfiles’ job permissions.

Changes:

  • Refines misconfiguration detection + severity criteria to require run_id and missing restore-keys before marking as Critical.
  • Updates recommended remediation text to prefer adding restore-keys instead of removing run_id.
  • Adds pull-requests: write job permission to several workflow lockfiles.
Show a summary per file
File Description
.github/workflows/daily-cache-strategy-analyzer.md Updates analyzer instructions, severity rubric, and issue template recommendations around run_id + restore-keys.
.github/workflows/unbloat-docs.lock.yml Adds pull-requests: write to activation job permissions.
.github/workflows/tidy.lock.yml Adds pull-requests: write to activation job permissions.
.github/workflows/plan.lock.yml Adds pull-requests: write to activation job permissions.
.github/workflows/pdf-summary.lock.yml Adds pull-requests: write to activation job permissions.
.github/workflows/mergefest.lock.yml Adds pull-requests: write to activation job permissions.
.github/workflows/brave.lock.yml Adds pull-requests: write to activation job permissions.
.github/workflows/ace-editor.lock.yml Adds pull-requests: write to activation job permissions.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 8/8 changed files
  • Comments generated: 4

contents: read
discussions: write
issues: write
pull-requests: write
actions: read
contents: read
issues: write
pull-requests: write
actions: read
contents: read
issues: write
pull-requests: write
actions: read
contents: read
issues: write
pull-requests: write
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[q] fix(cache-strategy-analyzer): recognize run_id+restore-keys as valid 'last one wins' pattern

3 participants