Skip to content

[build-tools] Fix Argent artifact upload size#3883

Merged
sjchmiela merged 2 commits into
mainfrom
stanley/argent-artifact-size-pr
Jun 19, 2026
Merged

[build-tools] Fix Argent artifact upload size#3883
sjchmiela merged 2 commits into
mainfrom
stanley/argent-artifact-size-pr

Conversation

@sjchmiela

@sjchmiela sjchmiela commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Since software-mansion/argent#347 Argent exposes a GET /artifacts/ endpoint which returns a size for every artifact. This size is then being used to create a www upload session (which validates and includes the size as Content-Length of the signed upload URL).

The size is being calculated in Argent as fs.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 with GET /artifacts/:id.

This pull request changes the artifacts behavior around Argent from:

  • list artifacts
  • trust size
  • pipe GET /artifacts/:id directly to signed upload URL

to:

  • list artifacts
  • download from GET /artifacts/:id to temporary directory
  • check the size of the actually downloaded file
  • pipe it to signed upload URL.

Test

You can see which traces have been created with the fix and which without it.

Zrzut ekranu 2026-06-19 o 13 03 01

@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.93%. Comparing base (b2388fd) to head (55ecce8).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sjchmiela sjchmiela added the no changelog PR that doesn't require a changelog entry label Jun 19, 2026
@sjchmiela sjchmiela marked this pull request as ready for review June 19, 2026 11:07
@sjchmiela sjchmiela requested a review from sswrk June 19, 2026 11:07
@github-actions

Copy link
Copy Markdown

Subscribed to pull request

File Patterns Mentions
**/* @douglowder

Generated by CodeMention

toolsAuthToken,
destinationPath: temporaryArtifactPath,
});
const { size } = await stat(temporaryArtifactPath);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sjchmiela sjchmiela force-pushed the stanley/argent-artifact-size-pr branch from 17c3b96 to 55ecce8 Compare June 19, 2026 11:59
@github-actions

Copy link
Copy Markdown

⏩ The changelog entry check has been skipped since the "no changelog" label is present.

@sjchmiela sjchmiela enabled auto-merge (squash) June 19, 2026 12:01
@sjchmiela sjchmiela merged commit cb2dadd into main Jun 19, 2026
6 checks passed
@sjchmiela sjchmiela deleted the stanley/argent-artifact-size-pr branch June 19, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog PR that doesn't require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants