fix: use Azurite-compatible URL format for signed_upload_url#216
Open
carjessu-trm wants to merge 1 commit intofalcondev-oss:devfrom
Open
fix: use Azurite-compatible URL format for signed_upload_url#216carjessu-trm wants to merge 1 commit intofalcondev-oss:devfrom
carjessu-trm wants to merge 1 commit intofalcondev-oss:devfrom
Conversation
`actions/cache@v4.2.0+` hardcodes `useAzureSdk: true` in `saveCacheV2()`,
which passes the `signed_upload_url` from `CreateCacheEntry` to the Azure
`BlobClient` constructor. The constructor expects URLs in Azure Blob format
(or Azurite format for non-Azure hosts) and fails to parse the current
`/upload/{id}` path with:
"Unable to extract blobName and containerName with provided information."
This changes the upload URL from:
`{API_BASE_URL}/upload/{id}`
to:
`{API_BASE_URL}/devstoreaccount1/upload/{id}`
The Azurite-style path (`/devstoreaccount1/<container>/<blob>`) is recognized
by the Azure SDK as a valid storage emulator URL, allowing it to extract:
- accountName: "devstoreaccount1"
- containerName: "upload"
- blobName: "{id}"
The upload handler at the new path is identical to the existing one. The
original `/upload/{id}` route is preserved for backward compatibility.
Fixes falcondev-oss#203
Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
actions/cache@v4.2.0+(and any action using@actions/cachev4+) hardcodesuseAzureSdk: trueinsaveCacheV2(). This passes thesigned_upload_urlreturned byCreateCacheEntryto the AzureBlobClientconstructor, which expects URLs in Azure Blob Storage format.The current URL format:
…causes the Azure SDK to fail with:
The upload handler already correctly handles Azure SDK requests (
comp=blocklist,blockidquery params), but the URL format prevents theBlobClientconstructor from parsing it.Solution
Change the upload URL to use Azurite-compatible format:
The Azure SDK recognizes
devstoreaccount1as the Azurite storage emulator account name, and correctly extracts:accountName:devstoreaccount1containerName:uploadblobName:{id}The original
/upload/{id}route is preserved for backward compatibility (e.g.,tonistiigi/go-actions-cacheused by Docker buildx).Changes
CreateCacheEntry.post.ts: Updatedsigned_upload_urlto include/devstoreaccount1prefixroutes/devstoreaccount1/upload/[uploadId].put.ts: Added route handler at the Azurite-compatible path (identical to the existing upload handler)Testing
Tested with:
actions/cache@v4(v4.3.0) — cache save succeedsactions/setup-node@v4withcache: npm— cache save succeedsenableDirectDownloads: trueFixes #203
Made with Cursor