[cache] Use Azure SDK to restore cache always if explicitly set to true #1943
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.
With the new cache service v2, "restoreCacheV2" 1 and "saveCacheV2" 2 now explicitly use the Azure SDK for blob operations.
The cacheHttpClient uses the Azure SDK to save the cache if the
useAzureSdk
option is set to true. 3However, it may not use the Azure SDK to download the cache even if the
useAzureSdk
option is set to true. If the signed URL does not end with "blob.core.windows.net," it will not use the Azure SDK to restore the cache. 4To ensure consistent behavior between saving and restoring the cache, the Azure SDK should be used to restore the cache if the
useAzureSdk
option is explicitly set to true.This PR ensures that the Azure SDK is used to restore the cache whenever the
useAzureSdk
option is set to true.Footnotes
https://github.com/actions/toolkit/blob/1f7c2c79e034fe8a0d28006f52fc5b70f6dbb750/packages/cache/src/cache.ts#L224 ↩
https://github.com/actions/toolkit/blob/1f7c2c79e034fe8a0d28006f52fc5b70f6dbb750/packages/cache/src/cache.ts#L472 ↩
https://github.com/actions/toolkit/blob/1f7c2c79e034fe8a0d28006f52fc5b70f6dbb750/packages/cache/src/internal/cacheHttpClient.ts#L335-L343 ↩
https://github.com/actions/toolkit/blob/1f7c2c79e034fe8a0d28006f52fc5b70f6dbb750/packages/cache/src/internal/cacheHttpClient.ts#L153 ↩