Skip to content

Add missing REST API filters to content list commands#1331

Merged
mdellweg merged 1 commit intopulp:mainfrom
gerrod3:content-list-filters
Mar 5, 2026
Merged

Add missing REST API filters to content list commands#1331
mdellweg merged 1 commit intopulp:mainfrom
gerrod3:content-list-filters

Conversation

@gerrod3
Copy link
Contributor

@gerrod3 gerrod3 commented Mar 3, 2026

Summary

  • Introduced content_filter_options group in generic.py for shared content filters (repository_version, repository_version_added, repository_version_removed), following the pattern of remote_filter_options
  • Added missing REST API filters to content list commands across all plugins:
    • File: relative_path
    • Python: name, name__in, name__contains, author, author__contains, packagetype, packagetype__in, filename, filename__contains, version, version__gte, version__lte
    • Container: digest, digest__in, is_bootable, is_flatpak (manifest); scoped media_type to manifests/tags only
    • Ansible: pubkey_fingerprint__in (signatures)
    • RPM: checksum_type, checksum_type__in, checksum_type__ne, filename, context, context__in (modulemd); expanded arch/version filters to modulemds
  • Added needs_plugins version constraints for newer Python filters (name__contains, author__contains require python>=3.25.0)
  • Removed duplicate field_option/exclude_field_option in RPM content that caused Click warnings
  • Added content filter tests to each plugin's test_content.sh

Test plan

  • pulp file content list --repository-version, --repository-version-added, --repository-version-removed, --relative-path
  • pulp python content list --name, --name-in, --version, --version-gte, --packagetype, --filename, --filename-contains, --author
  • pulp container content -t tag list --name, -t manifest list --digest, -t blob list --digest
  • pulp ansible content list --name, --namespace
  • pulp rpm content -t package list --name, --checksum-type; -t modulemd list --name --version, --context, --arch; -t advisory list --id

Generated by: claude-4.6-opus

- Introduce `content_filter_options` group in generic.py for common filters
  (repository_version, repository_version_added, repository_version_removed)
- Add plugin-specific filters: Python (name, author, version, packagetype,
  filename), Container (digest, media-type), Ansible (pubkey-fingerprint-in),
  RPM (checksum-type, context, filename, expanded modulemd filters)
- Add version constraints for newer Python filters (name/author contains)
- Remove duplicate field/exclude-field options in RPM content
- Add content filter tests to each plugin's test_content.sh

Generated by: claude-4.6-opus

Made-with: Cursor
@gerrod3 gerrod3 force-pushed the content-list-filters branch from 91b41ae to b8b904e Compare March 4, 2026 04:56
Copy link
Member

@mdellweg mdellweg left a comment

Choose a reason for hiding this comment

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

This reminds me that click is emitting a warning about how we "reuse" the options all over the place. But that sure is a different story.

Comment on lines -114 to -115
field_option,
exclude_field_option,
Copy link
Member

Choose a reason for hiding this comment

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

Why do we remove these?
I guess you wanted to add them to the generic list.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are already specified on the list_command() generic. They are decorated on the callback.

Copy link
Member

Choose a reason for hiding this comment

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

So they were superfluous already.
👍

Comment on lines -114 to -115
field_option,
exclude_field_option,
Copy link
Member

Choose a reason for hiding this comment

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

So they were superfluous already.
👍

@mdellweg mdellweg merged commit 2a684a6 into pulp:main Mar 5, 2026
18 checks passed
@gerrod3 gerrod3 deleted the content-list-filters branch March 5, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants