Skip to content

ref: Separate LegacyUploadContext for legacy uploads #2494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2025

Conversation

szokeasaurusrex
Copy link
Member

Legacy (i.e. non-chunked) are distinct from chunked uploads, so it makes sense to have a separate struct to enforce these differences via the type system.

Specifically, legacy uploads must be associated with a release, whereas this is not required for many chunk uploads. Legacy uploads must also be associated with at most one project, whereas chunked uploads can have multiple projects (support for which we will add in the CLI with #2408)

@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/legacy-upload-context branch from 156f7af to e7dfc50 Compare May 7, 2025 14:50
@szokeasaurusrex szokeasaurusrex marked this pull request as ready for review May 7, 2025 16:46
Copy link

@Copilot 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 refactors upload handling by extracting a new LegacyUploadContext to distinguish legacy (non‑chunked) uploads from chunked uploads.

  • Introduces LegacyUploadContext and its error enumeration to enforce a required release and single project for legacy uploads.
  • Updates conversion and display logic to use LegacyUploadContext instead of UploadContext in various modules.
  • Adjusts API and command calls to accommodate the new type.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/utils/file_upload.rs Added LegacyUploadContext and its Display, Error, and TryFrom implementations.
src/commands/files/upload.rs Updated upload function to convert UploadContext to LegacyUploadContext.
src/api/mod.rs Replaced usage of UploadContext with LegacyUploadContext in API calls.

@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/legacy-upload-context branch 2 times, most recently from 2669216 to 813fa81 Compare May 8, 2025 11:15
Legacy (i.e. non-chunked) are distinct from chunked uploads, so it makes sense to have a separate struct to enforce these differences via the type system.

Specifically, legacy uploads must be associated with a release, whereas this is not required for many chunk uploads. Legacy uploads must also be associated with at most one project, whereas chunked uploads can have multiple projects (support for which we will add in the CLI with #2408)
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/legacy-upload-context branch from 813fa81 to 8a63fec Compare May 8, 2025 11:45
@szokeasaurusrex szokeasaurusrex merged commit 8a63fec into master May 8, 2025
17 checks passed
@szokeasaurusrex szokeasaurusrex deleted the szokeasaurusrex/legacy-upload-context branch May 8, 2025 11:51
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