Skip to content

Conversation

@opswithranjan
Copy link
Member

Summary

This PR adds tag filtering capability to the cloudsmith download command and updates the README with comprehensive download command documentation.

Changes Made

🚀 New Feature: --tag Option

  • Added --tag option to cloudsmith download command for filtering packages by tags
  • Enhanced resolve_package() function to support tag filtering across multiple metadata fields:
    • Actual package tags (info, version categories)
    • Package format (deb, rpm, python, etc.)
    • Architecture (arm64, amd64, etc.)
    • Distribution name/version (ubuntu, noble, ubuntu/noble)
    • Components (main, contrib, etc.)
  • Added comprehensive unit tests for tag filtering functionality

📚 Documentation Updates

  • Added download command to README features list
  • Created new "Downloading Packages" section with practical examples
  • Documented all filtering options including the new --tag feature
  • Provided examples for common use cases (version, format, arch, tag filtering)

Usage Examples

# Filter by tag
cloudsmith download org/repo package --tag latest

# Combine with other filters  
cloudsmith download org/repo package --tag stable --format deb --arch arm64

# Preview downloads
cloudsmith download org/repo package --tag beta --dry-run

Testing

  • All existing tests pass
  • New unit test test_resolve_package_with_tag_filter validates tag filtering
  • Syntax validation and linting compliance verified
  • Manual testing confirmed tag filtering works with real API responses

Breaking Changes

None - this is a backward-compatible feature addition.

Copilot AI review requested due to automatic review settings December 18, 2025 19:47
@opswithranjan opswithranjan requested a review from a team as a code owner December 18, 2025 19:47
Copy link
Contributor

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 adds tag filtering capability to the cloudsmith download command, enabling users to filter packages by tags alongside existing filters (version, format, architecture, OS). The implementation treats various package metadata fields as "tags" beyond just the explicit tags field.

Key Changes:

  • Added --tag option to the download command with support for filtering by actual tags, format, architecture, distribution, and components
  • Enhanced package resolution logic with the new _matches_tag_filter() helper function
  • Updated documentation with comprehensive download command examples

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
cloudsmith_cli/core/download.py Added _matches_tag_filter() function and integrated tag filtering into resolve_package()
cloudsmith_cli/cli/commands/download.py Added --tag CLI option and updated command documentation with tag filtering example
cloudsmith_cli/core/tests/test_download.py Added unit test covering tag filtering for actual tags, format, architecture, and distro fields
README.md Added download command to features list and created new "Downloading Packages" section with examples

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

Copy link
Contributor

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.


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

Copy link
Contributor

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

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


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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@opswithranjan opswithranjan force-pushed the ceng-624-add-tag-option-for-cli-download-command branch from b5cf8ac to 628c873 Compare December 18, 2025 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants