Commit Graph
89 Commits
Author SHA1 Message Date
ffdc20ef92 feat(cache): add cache-mode client behavior (read-denied warning + ACTIONS_CACHE_MODE skip) (#2447)
* feat(cache): surface cache read-denied as a distinct restore warning

Mirror the existing cache write-denied handling on the restore path. When
the receiver refuses a download URL because the run's token has no readable
cache scopes, it returns a twirp PermissionDenied (HTTP 403). The twirp
client wraps that 403 in a generic Error, so the stable 'cache read denied:'
prefix is embedded in the message rather than at the start.

- Add CACHE_READ_DENIED_PREFIX and CacheReadDeniedError
- Dispatch on the prefix in the restoreCacheV2 catch block (V2 only), log a
  policy-specific warning, and report a cache miss so the run continues
- Add a test mirroring the write-denied coverage

* chore(cache): trim comments, bump to 6.2.0, add RELEASES entry

* refactor(cache): dispatch read-denied by error name to mirror write path

Re-throw CacheReadDeniedError from an inner try/catch around
GetCacheEntryDownloadURL and dispatch on typedError.name in the outer catch,
matching how saveCacheV2 handles CacheWriteDeniedError.

* feat(cache): handle read-denied on the v1 restore path

Extend the read-denied handling to Cache Service v1 so GHES (which forces v1
via _apis/artifactcache) is covered when read-scope enforcement ships there.

- Surface the receiver's error body message from getCacheEntry instead of a
  generic status-code error, so the cache read denied: prefix reaches callers
- Re-throw CacheReadDeniedError from restoreCacheV1 and dispatch on it in the
  outer catch, mirroring restoreCacheV2 and the write-denied v1 handling
- Add a v1 read-denied test

* refactor(cache): only surface receiver body for read-denied on v1

* test(cache): assert getCacheEntry only surfaces body for read-denied

* test(cache): cover non-read-denied getCacheEntry passthrough on v1

* refactor(cache): share read-denied prefix via constants to avoid drift

* feat(cache): skip restore/save per ACTIONS_CACHE_MODE

* test(cache): expand ACTIONS_CACHE_MODE skip coverage across v1/v2 and unknown modes

* fix copilot pr feedback

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* docs(cache): remove internal reference from cache-mode comment

* test(cache): merge redundant cache-mode skip tests and simplify read-denied handling

Address PR review feedback:
- Merge the duplicate restore/save skip test.each blocks into single blocks parametrized over ACTIONS_CACHE_SERVICE_V2.
- Drop the redundant CacheReadDeniedError catch arms; the typed error is not an HttpClientError so it already falls through to a non-fatal warning.
- Clarify why read-denied classification happens both in getCacheEntry and cache.ts (dependency-free internal module cannot import the typed error).

* refactor(cache): drop redundant CacheWriteDeniedError catch arms

Mirror the read-denied simplification on the save path. CacheWriteDeniedError
is not an HttpClientError and its name does not match the ReserveCacheError
arm, so it falls through to the same non-fatal warning. Logging behavior is
unchanged (warns, never fails the run) and the exported type is still thrown
internally for consumers and tests. Also refresh stale doc wording.

* test(cache): collapse redundant restore getCacheEntry-failure tests

The two restoreCache tests exercised the identical warning + cache-miss path
now that read-denied is no longer reclassified in the catch, so merge them into
one. The read-denied prefix detection that actually branches on the message is
covered by getCacheEntry tests in cacheHttpClient.test.ts.

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
2026-07-13 10:03:16 -05:00
Jason GinchereauandGitHub 0786132e6a Bump cache package to v6.1.0, update RELEASES.md (#2436) 2026-06-17 11:25:12 -10:00
Joshua Brooks ad7d6fb853 Bump toolkit version, add release notes 2026-05-01 17:38:16 +00:00
Daniel KennedyandGitHub ae29a2751b @actions/cache: convert to an ESM module (#2275)
* `@actions/cache`: convert to an ESM module

* Update the fixture to ESM syntax

* Update the cache workflows

* Bump `@actions/glob` to `0.6.1`

* Fix awaiting in the cache unit tests

* Fix a type issues in contracts

* Export the `DownloadOptions`/`UploadOptions` like before

* More cache test fixes

* Make the cache units tests better

* Add some more logging

* Add retries to restore-cache.mjs
2026-01-29 14:23:32 -05:00
Daniel Kennedy e827417593 Bump @actions/glob to 0.5.1 in @actions/cache 2026-01-27 15:43:44 -05:00
Daniel Kennedy 76339b5f68 Bump @actions/http-client and @actions/github on all packages 2026-01-27 13:31:31 -05:00
9dd77993e7 Update packages/cache/RELEASES.md
Co-authored-by: Bassem Dghaidi <[email protected]>
2026-01-16 10:25:44 +00:00
Ryan Ghadimi dd1bb93c72 New error type for cache RL 2026-01-16 10:00:15 +00:00
Ryan Ghadimi 7292b3508f update release doc 2026-01-16 09:51:21 +00:00
Ryan Ghadimi 4a47af6481 bump pkg 2026-01-16 09:46:28 +00:00
Ryan Ghadimi a68693e20a tests & releases 2026-01-16 09:44:57 +00:00
Salman Muin Kayser Chishti c655f38a0f docs(cache): add PR reference to v5.0.1 release notes 2025-12-12 14:53:26 +00:00
Salman Muin Kayser Chishti 6fc2f678c8 docs(cache): bump to v5.0.1 and add release notes 2025-12-12 13:42:58 +00:00
Salman Muin Kayser Chishti cc6abe3c3a chore(releases): update release notes for v5.0.0 to remove punycode deprecation warning 2025-12-11 14:43:23 +00:00
Salman Muin Kayser Chishti c6502bc679 PR number update in releases 2025-12-11 14:33:30 +00:00
Salman Muin Kayser Chishti bdd6eb4293 update releases 2025-12-11 14:32:58 +00:00
Salman Muin Kayser Chishti 45ec4a2087 chore: update dependencies and remove deprecated package
- Removed `@azure/ms-rest-js` dependency to fix Node.js 24+ punycode deprecation warning.
  - The `TransferProgressEvent` type is now imported from `@azure/core-rest-pipeline`.
- Updated `package.json` to reflect the new dependency.
- Updated tests to import `TransferProgressEvent` from the new package.
- Updated `package-lock.json` to remove `@azure/ms-rest-js` and include `@azure/core-rest-pipeline`.
- Bumped versions of several dependencies including `@azure/storage-blob` and `@azure/storage-common`.
2025-12-10 11:04:34 +00:00
Salman Muin Kayser Chishti b0464628c0 Prepare cache v5 release 2025-12-09 16:11:32 +00:00
Bassem DghaidiandGitHub 9a41b33065 Prepapre cache v4.1.0 release 2025-09-24 05:23:58 -07:00
Bassem DghaidiandGitHub 447ee85f36 Prepare release 4.0.5 2025-08-07 04:00:47 -07:00
Bassem DghaidiandGitHub c6723084aa Prepare release 4.0.4 2025-08-06 11:37:53 -07:00
Salman ChishtiandGitHub a410c4a9cf remove extra brace 2025-03-17 17:14:25 +00:00
Salman ChishtiandGitHub 10277d48ca Add update to release doc, as will include it in this release 2025-03-17 17:12:32 +00:00
Salman ChishtiandGitHub c40bccc9c3 Use patch instead of minor 2025-03-17 14:08:42 +00:00
Salman ChishtiandGitHub ff4d4afef8 shared instead of secure 2025-03-17 12:48:56 +00:00
Salman ChishtiandGitHub 261fcae498 change it to minor version instead of patch 2025-03-17 12:44:51 +00:00
Salman ChishtiandGitHub 4059d2af66 update versions for cache and artifact 2025-03-17 12:09:16 +00:00
Rob Herley 4fedf471b1 cache: prep v4.0.2 release 2025-02-25 15:03:37 -05:00
Rob Herley 8fcec1fb58 update manifests & release notes for cache v4.0.1 2025-02-14 11:02:13 -05:00
Bassem DghaidiandGitHub cd9197e9bd Add announcement link 2024-12-04 08:23:10 -08:00
Bassem DghaidiandGitHub 72447df44c Update deprecation notice 2024-12-04 05:33:47 -08:00
Bassem DghaidiandGitHub cb001af8a3 Update README to include deprecation notice 2024-12-03 02:52:39 -08:00
Bassem DghaidiandGitHub 4498687c5e Prepare @actions/cache 4.0.0 release 2024-12-03 02:40:00 -08:00
Josh GrossandGitHub 77f247b2f3 Prepare @actions/cache 3.3.0 release (#1871) 2024-11-01 13:32:42 -04:00
Josh GrossandGitHub 7f5921cddd Document unreleased changes in cache and tool-cache (#1856) 2024-10-22 12:01:31 -04:00
BethanyandGitHub eea6b7f517 Update RELEASES.md 2024-02-29 10:40:22 -05:00
eggyhead c500de6dea updating cache version and release to include ghes check change
Revert "updating cache version and release to include ghes check change"

This reverts commit 7185d8964514361b7b8dcdba1f9dd54ef24b8bdd.

updating cache version and release to include ghes check change
2024-01-31 21:23:20 +00:00
Rob HerleyandGitHub 7c27528ab4 Update RELEASES.md
Updates release notes for @actions/cache v3.2.3
2024-01-10 17:32:52 -05:00
Chad KimesandGitHub f74ff155bd Add option for concurrent cache downloads with timeout (#1484)
* Add option for concurrent cache downloads with timeout

* Add release notes

* Fix lint
2023-08-07 13:25:56 -04:00
Sankalp KotewarandGitHub fe92749762 Merge branch 'main' into kotewar/updating-blobstorage-client-to-12.13.0 2023-03-09 00:33:52 +05:30
Sankalp KotewarandGitHub ce1bf116fc formatted and updated releases file 2023-03-06 11:56:51 +00:00
Marc Mueller e45a26f771 Update package version and changelog 2023-02-21 13:56:25 +01:00
Lovepreet Singh bc713ab90d Add release info 2023-02-20 18:38:47 +00:00
Sampark SharmaandGitHub e3c2a88bbf Release patch version update for cache (#1338) 2023-02-09 17:21:19 +05:30
Sampark SharmaandGitHub b2d865f180 Cache package release for compression change in windows with symlink fix (#1291)
* Cache package release for compression change in windows

This reverts commit 86fe4abd8e.

* Add env variable to enable windows symlinks

* Add cross os opt-in functionality for cache on windows

* Fix test

* Address review comments

* Fix test

* Fix tests

* Fix tests

* Fix tests

* Address review comments

* Address review comments

* Fix tests

* Fix tests

* Add npm version

* Add release details
2023-01-04 12:16:25 +05:30
Sampark SharmaandGitHub 86fe4abd8e Revert "Cache package release for compression change in windows" (#1289)
* Revert "Cache package release for compression change in windows (#1281)"

This reverts commit b228732644.

* Update release version to patch
2022-12-27 16:00:28 +05:30
b228732644 Cache package release for compression change in windows (#1281)
* bsd + zstd fallback implementation

* bsd + zstd fallback implementation

* Fix tar operations

* Add -v option for testing

* Fix order of args for tar

* Add GNUtar as default on windows

* Fix test

* Fix tar tests

* Fix lint issues

* Fix windows gnutar test case

* Temporarily remove thhe condition that prevents zstd usage on windows unless with GNUtar

* Address some comments and correct compression commands

* Add windows bsdtar test

* Fix windows test

* Fix test

* Separate args

* Fix old tests

* Add new tests

* Fix tests

* Fix lint test

* Refactor code

* Address review comments

* Fix test

* Fix tar test

* Add await to async function calls

* Fix test

* Update for beta release

* Fix audit issues

* Add fallback to gzip compression if cache not found

* Fix test

* Add test

* Address review comments

* Revert Address review comments

* Release 3.1.0-beta.2 cache package

* Fix issues

* Reconfigure catch block

* Add debug logging for gzip fall back

* Fix test

* Add end to end test for cache using bsd on windows
and address review comments

* Fix test

* Fix test

* Fix tests

* Add better comments

* Update packages/cache/src/internal/cacheHttpClient.ts

Co-authored-by: Bishal Prasad <[email protected]>

* Address review comments

* Update for new beta cache package release

* Address bugbash issues

* Fix tests

* Release new actions/cache minor version

Co-authored-by: Lovepreet Singh <[email protected]>
Co-authored-by: Bishal Prasad <[email protected]>
2022-12-22 20:47:35 +05:30
Sankalp KotewarandGitHub 8423354d7d Update RELEASES.md 2022-10-18 23:14:31 +05:30
Sankalp KotewarandGitHub 8e8a93deae Fixed environment variable in the docs. (#1216) 2022-10-18 12:31:00 +05:30
Lovepreet Singh 3e257b0745 Update RELEASES.md 2022-10-13 09:36:33 +00:00