feat(ctl): add marketplace browsing commands (list, search, show)#1127
Closed
iddocohen wants to merge 12 commits into
Closed
feat(ctl): add marketplace browsing commands (list, search, show)#1127iddocohen wants to merge 12 commits into
iddocohen wants to merge 12 commits into
Conversation
Deploying infrahub-sdk-python with
|
| Latest commit: |
1aa8b4a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9fab9c1b.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://ic-feat-add-marketplace-brow.infrahub-sdk-python.pages.dev |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## develop #1127 +/- ##
===========================================
+ Coverage 82.16% 82.30% +0.14%
===========================================
Files 138 138
Lines 11898 12051 +153
Branches 1784 1810 +26
===========================================
+ Hits 9776 9919 +143
- Misses 1572 1575 +3
- Partials 550 557 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
6 issues found across 7 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
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.
Why
infrahubctl marketplace get <namespace/name>can download a schema or collection, but only if you already know its exact identifier. There is no way to discover what the marketplace offers.Goal: let users browse and inspect marketplace content directly from the CLI.
Non-goals: no changes to
get/download behavior; no new marketplace API endpoints (uses the existing list/detail REST endpoints).What changed
Behavioral — three new commands under
infrahubctl marketplace:list [--collections] [--limit N] [--json]— browse schemas (default) or collectionssearch <term> [--collections] [--limit N] [--json]— filter the catalog via the APIsearch=paramshow <namespace/name> [--collection] [--json]— full details of one item (versions/members, dependencies), with schema/collection auto-detectImplementation notes:
marketplace.pyhelpers (HTTP client, identifier parsing, host/error handling) — raw dicts, no new models and no new dependencies--jsonemits parseable JSON on stdout while status/notes go to stderr (clean for piping)--limit Ncaps output to a single page with aShowing N of <total>footerWhat stayed the same: the existing
get/download command is untouched; no schema changes; the marketplace URL still resolves from--marketplace-url/INFRAHUB_MARKETPLACE_URL/ config.How to review
infrahub_sdk/ctl/marketplace.py— newlist/search/showcommands and their helperstests/unit/ctl/test_marketplace_app.pydev/specs/marketplace-browsing/docs/docs/infrahubctl/infrahubctl-marketplace.mdxHow to test
Impact & rollout
marketplace_urlsetting)Checklist
changelog/+marketplace-browsing.added.md)infrahubctl-marketplace.mdx)dev/specs/marketplace-browsing/)Summary by cubic
Adds
infrahubctl marketplace list,search, andshowto browse and inspect marketplace schemas and collections from the CLI. Improves discovery without changinggetor any configs.New Features
list [--collections] [--limit N] [--json]to browse schemas (default) or collections.search <term> [--collections] [--limit N] [--json]to filter viasearch=.show <namespace/name> [--collection] [--json]with auto-detect and full details (versions/members, dependencies).--limit Nrequests a single page and prints “Showing N of ”.--jsonemits clean JSON to stdout, status/errors to stderr.Bug Fixes
has_next_pageis true but the server omitsend_cursor.showschema/collection collisions, the note goes to stderr so--jsonoutput stays parseable.Written for commit 1aa8b4a. Summary will update on new commits.