feat: add catalogs command for the public catalog-pages API - #238
Draft
jeff-schnitter wants to merge 1 commit into
Draft
feat: add catalogs command for the public catalog-pages API#238jeff-schnitter wants to merge 1 commit into
jeff-schnitter wants to merge 1 commit into
Conversation
Add a `catalogs` sub-command that wraps the new public catalog-pages API
(cortexapps/brain-backend CD-345):
- cortex catalogs list GET /api/v1/catalog-pages
- cortex catalogs get -s <slug> GET /api/v1/catalog-pages/{slug}
- cortex catalogs create -f <f> POST /api/v1/catalog-pages (create or replace)
- cortex catalogs delete -s <slug> DELETE /api/v1/catalog-pages/{slug}
Modeled on the scaffolders command. `create` accepts a JSON or YAML
definition and always sends it as JSON. Named `catalogs` (the UI feature
name); it targets `/api/v1/catalog-pages`, distinct from the existing
`catalog` command for catalog entities.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
Deliverable 3 of 3 for [CD-345]. Adds a
catalogssub-command that wraps the new public catalog-pages API in brain-backend (PRs cortexapps/brain-backend#17183 + #17185).cortex catalogs listGET /api/v1/catalog-pages(auto-paginated;--page/--page-size,--table/--csv)cortex catalogs get -s <slug>GET /api/v1/catalog-pages/{slug}cortex catalogs create -f <file>POST /api/v1/catalog-pages— create or replace (upsert)cortex catalogs delete -s <slug>DELETE /api/v1/catalog-pages/{slug}Modeled on
commands/scaffolders.py.createaccepts a JSON or YAML definition and always sends it as JSON (the endpoint is JSON-only). Registered alphabetically aftercatalogincli.py.Naming
Named
catalogs(the UI feature name), and it targets/api/v1/catalog-pages— distinct from the existingcatalogcommand, which manages catalog entities at/api/v1/catalog. Same entity-vs-page split the backend makes.Test plan
tests/test_catalogs.py(list + full CRUD round-trip, including upsert-replace and delete), following thetest_scaffolders.pyreal-API + skip-guard pattern, plusdata/import/catalogs/cli-test-catalog.json.poetry install(and thereforepytest/poetry run cortex) can't run here. New files byte-compile (py_compile) and the fixture is valid JSON. Please let CI (test-pr.yml) exercise the suite against the test tenant, or I can run it once deps are available.🤖 Generated with Claude Code