Skip to content

Support non-image files#313

Merged
gregberge merged 1 commit into
mainfrom
greg/arg-370-allow-to-compare-any-text-based-file-using-cli
May 28, 2026
Merged

Support non-image files#313
gregberge merged 1 commit into
mainfrom
greg/arg-370-allow-to-compare-any-text-based-file-using-cli

Conversation

@gregberge
Copy link
Copy Markdown
Member

@gregberge gregberge commented May 28, 2026

Summary

  • update the core upload flow to use the new secure createBuild contract: screenshots: [{ key, contentType }]
  • upload snapshots and Playwright traces with S3 presigned multipart POST fields, appending the file part last
  • keep the lower-level PUT helper for deployment uploads, while snapshot uploads now require postUrl + fields
  • refresh the API client schema for the new create-build request/response shape
  • unlocks the ability to upload other things than images to be compared

Why

The API now signs uploads with S3 POST policies instead of presigned PUT URLs. This lets S3 enforce upload constraints directly, including content type and size policy. The SDK needs to send content types when creating a build and then perform multipart POST uploads using the returned policy fields.

Validation

  • pnpm --dir packages/core run check-types
  • pnpm --dir packages/core test
  • pnpm --dir packages/api-client run check-types
  • git diff --check

@linear
Copy link
Copy Markdown

linear Bot commented May 28, 2026

ARG-370

@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
argos-js-sdk-reference Ready Ready Preview, Comment May 28, 2026 9:45am

Request Review

@gregberge gregberge force-pushed the greg/arg-370-allow-to-compare-any-text-based-file-using-cli branch from 382f751 to eaa246d Compare May 28, 2026 09:45
@gregberge gregberge marked this pull request as ready for review May 28, 2026 09:47
@gregberge gregberge requested review from Copilot and jsfez May 28, 2026 09:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates @argos-ci/core to use secure S3 presigned POST uploads for snapshots and Playwright traces, while keeping the existing PUT helper for deployment uploads.

Changes:

  • Sends screenshots: [{ key, contentType }] to create builds instead of screenshotKeys.
  • Adds multipart POST upload support with presigned fields and uses it for snapshots/traces.
  • Refreshes API client schema and test mocks for the new create-build upload contract.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/core/src/upload.ts Switches snapshot/trace uploads to secure presigned POST inputs.
packages/core/src/upload.test.ts Adds coverage for secure screenshot upload request and multipart form fields.
packages/core/src/skip.ts Updates skipped-build creation to use screenshots: [].
packages/core/src/s3.ts Adds presigned POST multipart upload helper.
packages/core/src/s3.test.ts Updates S3 helper tests for both PUT and POST upload paths.
packages/core/mocks/handlers/uploadScreenshot.ts Changes upload mock from PUT to POST multipart validation.
packages/core/mocks/handlers/createBuild.ts Updates create-build mock to return POST upload fields.
packages/api-client/src/schema.ts Regenerates schema for secure uploads and related API changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/core/src/upload.ts
Comment thread packages/api-client/src/schema.ts
@gregberge gregberge changed the title feat(core): support secure snapshot uploads Support non-image files May 28, 2026
@gregberge gregberge merged commit 5bb0f3c into main May 28, 2026
76 of 91 checks passed
@gregberge gregberge deleted the greg/arg-370-allow-to-compare-any-text-based-file-using-cli branch May 28, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants