[build-tools] Fix Argent artifact upload size#3883
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3883 +/- ##
==========================================
+ Coverage 58.92% 58.93% +0.01%
==========================================
Files 934 934
Lines 40823 40833 +10
Branches 8606 8606
==========================================
+ Hits 24051 24059 +8
- Misses 16676 16678 +2
Partials 96 96 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Subscribed to pull request
Generated by CodeMention |
sswrk
approved these changes
Jun 19, 2026
| toolsAuthToken, | ||
| destinationPath: temporaryArtifactPath, | ||
| }); | ||
| const { size } = await stat(temporaryArtifactPath); |
Contributor
There was a problem hiding this comment.
I think it's worth adding a comment explaining why we do this even though there is non-null size field in Argent artifact Zod schema. Or removing it from the zod schema as it's unused.
17c3b96 to
55ecce8
Compare
|
⏩ The changelog entry check has been skipped since the "no changelog" label is present. |
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.
Since software-mansion/argent#347 Argent exposes a
GET /artifacts/endpoint which returns asizefor every artifact. Thissizeis then being used to create awwwupload session (which validates and includes thesizeasContent-Lengthof the signed upload URL).The
sizeis being calculated in Argent asfs.stat()which works great for single files, but for directories it returns 96 bytes. The actual archiving of a given directory (producing an artifact) is only happening when downloading the artifact withGET /artifacts/:id.This pull request changes the artifacts behavior around Argent from:
sizeGET /artifacts/:iddirectly to signed upload URLto:
GET /artifacts/:idto temporary directorysizeof the actually downloaded fileTest
You can see which traces have been created with the fix and which without it.