feat(download): add --filename and --download-all options#270
feat(download): add --filename and --download-all options#270opswithranjan wants to merge 4 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds new download disambiguation capabilities so users can select packages by filename (including glob patterns) and optionally download all matching packages when multiple artifacts share the same name/version.
Changes:
- Added
--filenamefiltering (exact match via query; glob via client-sidefnmatch) and aresolve_all_packages()resolver. - Added
--download-allmode to download every resolved match and enhanced multi-match output (table includes a Filename column). - Updated tests and documentation (README + changelog) to cover the new CLI behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
cloudsmith_cli/core/download.py |
Extracts shared search logic into _search_packages(), adds filename filtering, adds resolve_all_packages(), and updates multi-match display. |
cloudsmith_cli/cli/commands/download.py |
Adds --filename and --download-all options and implements multi-package download flow. |
cloudsmith_cli/core/tests/test_download.py |
Adds unit tests for filename filtering, multi-resolution, and updated error/table output. |
cloudsmith_cli/cli/tests/commands/test_download.py |
Adds integration-style tests for --filename and --download-all behavior. |
README.md |
Adds download examples for --filename and --download-all (but also removes the logout entry from the command list). |
CHANGELOG.md |
Records the new options and table update, but converts Unreleased into a versioned 1.14.0 entry. |
Comments suppressed due to low confidence (1)
cloudsmith_cli/cli/commands/download.py:65
- The
--outfilehelp text says it's an output file path, but--download-alltreats it as an output directory (and--all-filesalready uses it as a directory). This is user-facing and can be confusing; please update the option help (and/or validation) to clearly document the different semantics by mode, or introduce a separate--output-dirfor multi-file/multi-package downloads.
@click.option(
"--outfile",
type=click.Path(),
help="Output file path. If not specified, uses the package filename.",
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
estebangarcia
left a comment
There was a problem hiding this comment.
I feel like this could use with a bit of a refactoring.
We have too many branches going on here. Whether one or many, we always want to do 2 things:
- Find the package(s) to download
- Download it/them
I would suggest refactoring this to break it down into those 2 steps, regardless of whether you are downloading one or many packages.
…SKIPPED status, and extract shared helpers
7f5ddf8 to
4c38f2d
Compare
…o-support-filename-or-wider
Support downloading packages when multiple share the same name/version
but differ by filename (e.g., .nupkg vs .snupkg).
Type of Change