feat: Support upload of extra files#190
Merged
nicholasmccrea merged 4 commits intoMar 31, 2025
Merged
Conversation
b3841fb to
b79da31
Compare
nicholasmccrea
commented
Mar 27, 2025
Comment on lines
+567
to
+571
| elif k == "extra_files": | ||
| # Handle mutliple files for extra_files parameter. | ||
| option_kwargs["type"] = str | ||
| option_kwargs["multiple"] = True | ||
| option_kwargs["callback"] = validators.validate_extra_files_parameter |
Contributor
Author
There was a problem hiding this comment.
The implementation allows any format to leverage the extra_files parameter. It's up to the format-specific upload serializer to process and handle the list of files appropriately.
6d0e41d to
8d1f316
Compare
nicholasmccrea
commented
Mar 28, 2025
Comment on lines
+572
to
+574
| info["help"] = ( | ||
| info["help"] + " Accepts a comma-separated list of values." | ||
| ) |
Contributor
Author
There was a problem hiding this comment.
The API serializer text isn’t specific to the CLI, so I’ve added this to clarify how the input is expected to be formatted.
...
--artifact-id TEXT The ID of the artifact.
--extra-files TEXT Extra files to include in the package. This
can be a single file or multiple files.
Accepts a comma-separated list of values.
--group-id TEXT Artifact's group ID.
...
jackgibson1
approved these changes
Mar 28, 2025
8d1f316 to
291ccc4
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces support for uploading extra files when pushing Maven packages via the CLI. Key changes include:
- Bumping the cloudsmith-api dependency version in setup.py.
- Adding a new validator to process and resolve extra file paths.
- Updating the push command to handle multiple extra files and adding corresponding tests and changelog entries.
Reviewed Changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Updated dependency version for cloudsmith-api |
| cloudsmith_cli/cli/validators.py | Added a new function to validate and convert extra file paths |
| cloudsmith_cli/cli/tests/test_push.py | Added tests for the extra_files parameter in the package upload workflow |
| cloudsmith_cli/cli/commands/push.py | Extended upload functions and push handler to support multiple extra files |
| CHANGELOG.md | Documented new --extra-files parameter addition |
Files not reviewed (2)
- .bumpversion.cfg: Language not supported
- cloudsmith_cli/data/VERSION: Language not supported
| dir_okay=False, exists=True, writable=False, resolve_path=True | ||
| ) | ||
| elif k == "extra_files": | ||
| # Handle mutliple files for extra_files parameter. |
There was a problem hiding this comment.
Typo in the comment: 'mutliple' should be corrected to 'multiple'.
Suggested change
| # Handle mutliple files for extra_files parameter. | |
| # Handle multiple files for extra_files parameter. |
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.
What Changed?
Update the CLI to enable support for uploading arbitrary files when pushing Maven packages. These files may include anything beyond standard Maven files (pom, jar, sources, javadoc)
Arbitrary files can be specified using the --extra-files option, allowing multiple files to be attached. Whilst this work is directly linked to the Maven format, the implementation can be easily extended to other formats. They would need to add the
extra_filesattribute to their*UploadSerializerand then handle the incoming list of files accordingly on upload.Testing
List of extra files
Multiple parameters
No extra files
Invalid extra filepath