feat(eng-12000): add metadata API client and client test#287
Merged
BartoszBlizniak merged 3 commits intomasterfrom Apr 30, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a lightweight v2 API client for package metadata endpoints (not yet present in cloudsmith_api) plus a dedicated pytest suite to validate request/response handling and enum/filter normalization.
Changes:
- Introduces
cloudsmith_cli/core/api/metadata.pyimplementing list/create/update/delete calls against/v2/packages/{package_slug_perm}/metadata/. - Adds normalization helpers for
source_kindandclassificationfilter arguments (string/int → int). - Adds
cloudsmith_cli/core/tests/test_metadata.pycovering happy paths, error translation, pagination header parsing, and auth precedence.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
cloudsmith_cli/core/api/metadata.py |
New v2 metadata client with request building, auth header construction, enum normalization, and pagination parsing. |
cloudsmith_cli/core/tests/test_metadata.py |
New tests for normalization, CRUD calls, error handling, and header behavior using httpretty. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cloudsmith-iduffy
approved these changes
Apr 30, 2026
cloudsmith-iduffy
approved these changes
Apr 30, 2026
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
Adds a v2 API client for package-metadata endpoints.
Endpoints added
All under
https://api.cloudsmith.io/v2/:GET/packages/{package_slug_perm}/metadata/list_metadataGET/packages/{package_slug_perm}/metadata/{metadata_slug_perm}/get_metadataPOST/packages/{package_slug_perm}/metadata/create_metadataPATCH/packages/{package_slug_perm}/metadata/{metadata_slug_perm}/update_metadataDELETE/packages/{package_slug_perm}/metadata/{metadata_slug_perm}/delete_metadatasource_kindandclassificationfilter args accept either the integer (matchingcloudsmith/package/enums.py) or the enum name (case-insensitive, hyphen/underscore tolerant); both are normalised to ints before the request.Type of Change
Additional Notes
N/A