Skip to content

Tags

Tags

v0.1.340-preview

Toggle v0.1.340-preview's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Skip remote content upload when the remote cache is read-only (#178)

* Skip remote content upload when the remote cache is read-only

CasCacheClient holds two sessions: the raw _remoteCacheSession and the
_twoLevelCacheSession built from TwoLevelCacheConfiguration. When adding a
node, content was uploaded directly through _remoteCacheSession without
consulting RemoteCacheIsReadOnly, while the content hash list that would
reference that content is published through _twoLevelCacheSession, which does
honor it.

The result is that a read-only client uploads content that can never be
retrieved: no content hash list ever points at it, so no subsequent build can
hit on it. The upload only costs egress, storage and build time, and leaves
unreferenced blobs behind for lifecycle policies to collect.

Guard the upload block on the read-only flag, which also elides the remote
pin calls that were only made to decide what to upload.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Add regression tests for read-only remote content upload

Adds RecordingCacheSession / RecordingCache, minimal ICacheSession and ICache
implementations that count the calls made against them, and two tests driving
CasCacheClient.AddNodeInternalAsync:

- AddNodeDoesNotUploadContentWhenRemoteCacheIsReadOnly asserts the remote
  session sees no PinAsync, PutStreamAsync or PutFileAsync calls, while the node
  metadata and content hash list are still written to the local cache.
- AddNodeUploadsContentWhenRemoteCacheIsWritable asserts the remote session is
  still pinned and uploaded to when the remote cache is writable, so the guard
  is conditional rather than unconditional.

The first test fails without the accompanying fix:
Expected:<0>. Actual:<1>. 'actual' expression: 'remoteSession.PinCallCount'.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* use HashInfoLookup

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

v0.1.328-preview

Toggle v0.1.328-preview's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Improve efficiency of IsDependentOn (#150)

v0.1.327-preview

Toggle v0.1.327-preview's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Disable test for official build (#147)

v0.1.318-preview

Toggle v0.1.318-preview's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Dump the fingerprint if the targets at least match for read scenarios (…

…#124)

v0.1.314-preview

Toggle v0.1.314-preview's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Touch all output files (#120)

v0.1.312-preview

Toggle v0.1.312-preview's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Blob: Add support for 1ES Build Cache, refactor auth (#110)

v0.1.308-preview

Toggle v0.1.308-preview's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Avoid materializing outputs for unqueried dependencies (#117)

* Avoid materializing outputs for recursively queried nodes

* Fix multitargeting

v0.1.307-preview

Toggle v0.1.307-preview's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Dump the fingerprint in readonly scenarios (#115)

v0.1.306-preview

Toggle v0.1.306-preview's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Avoid logging warnings when cancellation is requested (#114)

v0.1.305-preview

Toggle v0.1.305-preview's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix race condition for writing local cache state (#113)