fix: metadata enum update#298
Open
BartoszBlizniak wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes cloudsmith metadata list filtering against the v2 API by sending enum values as lowercased names (instead of legacy client-side integer mappings), aligning the CLI with the backend’s EnumFieldV2 contract and avoiding HTTP 400s on filtered list calls.
Changes:
- Removed stale enum int-maps/normalizers and updated the metadata API client to lowercase string filter values before sending.
- Updated CLI command help/tests to reflect name-based filters and to stop client-side validation of filter values.
- Added a changelog entry documenting the behavioral fix.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| cloudsmith_cli/core/api/metadata.py | Drops integer normalization and sends lowercased enum names as query params. |
| cloudsmith_cli/core/tests/test_metadata.py | Updates tests for name-based filters and backend-driven validation behavior. |
| cloudsmith_cli/cli/commands/metadata.py | Removes client-side validation and updates CLI help text for filters. |
| cloudsmith_cli/cli/tests/commands/test_metadata.py | Updates CLI tests to pass through name-based filters and unknown names. |
| CHANGELOG.md | Documents the fix to metadata list filtering behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
Fix
cloudsmith metadata listfilters. The CLI converted--source-kind/--classificationto integers, but the v2 API'sEnumFieldV2accepts only the lowercased enum name, so every filtered list returned HTTP 400.This drops the stale client-side enum int-maps and normalisers, sends the lowercased name, and lets the backend validate it.
Type of Change
Additional Notes
IntegerFieldtoEnumFieldV2(name-only); #15489 (2026-05-20) renamed the enums (ECOSYSTEM→UPSTREAM,CUSTOMER→CUSTOM) and reindexed classifications. The CLI's maps matched the backend exactly when written, then drifted — not an original implementation error.