GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Handle cache write error due to read-only token by jasongin · Pull Request #2429 · actions/toolkit

Conversation

@jasongin

@jasongin jasongin commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Adds handling for cache write denials due to read-only cache permissions. When the cache backend signals a policy-driven write denial, the toolkit now detects the stable cache write denied: message prefix and re-classifies the failure from a generic "contention" log to a clear core.warning that is visible in the run log.

Changes:

  • Added CACHE_WRITE_DENIED_PREFIX constant to detect policy-driven denials.
  • Added CacheWriteDeniedError extending ReserveCacheError for backward compatibility while enabling specific handling.
  • Updated both V1 (REST) and V2 (gRPC) cache paths:
    • Detect the stable prefix in error messages from the receiver.
    • Throw CacheWriteDeniedError instead of generic ReserveCacheError.
    • Log at core.warning() level (not core.info()) so users see it in workflow logs.
    • Skip redundant inner warnings when a policy denial is detected.
  • Added comprehensive tests covering both V1 and V2 paths to validate prefix detection and log-level behavior.

Key behaviors:

  • Cache saves still do not fail the job (non-fatal).
  • The cache write denied: prefix is a contract between the receiver and toolkit to distinguish policy denials from contention cases.
  • Message format: Failed to save: Unable to reserve cache with key {key}. More details: cache write denied: ...

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jasongin
Handle cache write error due to read-only token
78e3d71
Copilot AI review requested due to automatic review settings June 12, 2026 00:07
@jasongin
jasongin requested a review from a team as a code owner June 12, 2026 00:07
Copilot started reviewing on behalf of jasongin June 12, 2026 00:08
View session
Copilot AI reviewed Jun 12, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this 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 cache save logic to detect policy-driven cache write denials (read-only token) via a stable receiver error-message prefix and surface the failure as a user-visible warning instead of a generic contention/info message, across both cache service v1 (REST) and v2 (gRPC/Twirp) flows.

Changes:

  • Introduced a stable CACHE_WRITE_DENIED_PREFIX and a CacheWriteDeniedError subclass to represent policy-driven write denials.
  • Updated save paths for cache service v1 and v2 to detect the prefix, reclassify the error, and log a single core.warning instead of core.info/duplicate warnings.
  • Added tests for both v1 and v2 to validate prefix detection and warning-level behavior.
Show a summary per file
File Description
packages/cache/src/cache.ts Adds write-denial prefix + error type, updates v1/v2 reserve flows to reclassify and warn for policy denials.
packages/cache/tests/saveCacheV2.test.ts Adds v2 test ensuring policy-denial path emits the intended outer warning and avoids inner warning.
packages/cache/tests/saveCache.test.ts Adds v1 test ensuring policy-denial path logs warning (not info) with the expected message.

Copilot's findings

Tip

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

  • Files reviewed: 3/3 changed files
  • Comments generated: 3

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/cache/src/cache.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/cache/__tests__/saveCacheV2.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/cache/__tests__/saveCache.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jasongin
Adit fix, address copilot comments
26e77e9
@jasongin
jasongin requested a review from a team as a code owner June 12, 2026 00:18
@jasongin
Audit fix packages
4d255d0
@jasongin
jasongin requested a review from a team as a code owner June 12, 2026 00:22
@jasongin
Audit fix packages/cache
5fb375f
yaananth
yaananth approved these changes Jun 12, 2026
View reviewed changes
philip-gai
philip-gai approved these changes Jun 16, 2026
View reviewed changes
@jasongin
jasongin merged commit 1746c55 into main Jun 16, 2026
21 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@jasongin
jasongin deleted the jasongin/readonly-cache branch June 16, 2026 18:03
This was referenced Jun 17, 2026
Backport: Handle cache write error due to RO token #2435
Merged
Bump cache package to v6.1.0, update RELEASES.md #2436
Merged
Bump @actions/cache to v6.1.0 - handle read-only cache access actions/cache#1768
Merged
@jasongin jasongin mentioned this pull request Jun 26, 2026
Bump @actions/cache to v5.1.0 - handle read-only cache access actions/cache#1775
Merged
8 of 10 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Jul 2, 2026
ci: hand built depends to source jobs via artifacts dashpay/dash#7403
Merged
6 tasks
This was referenced Jul 20, 2026
ci: warm windows dependency cache on main nuxt/nuxt#35730
Merged
fix(ci): silence English translation noise and harden related-issue matches lidge-jun/opencodex#458
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Aug 3, 2026
stack 1/5: add contribution intake firewall lidge-jun/opencodex#900
Closed
@coderabbitai coderabbitai Bot mentioned this pull request Aug 16, 2026
chore(github): organize issue triage reactive-resume/reactive-resume#3325
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@yaananth yaananth yaananth approved these changes
@philip-gai philip-gai philip-gai approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@jasongin @yaananth @philip-gai
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.