feat: add catalog discovery CLI commands#2360
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class integration catalog discovery and project-level catalog source management to the Specify CLI, aligning integrations with the existing catalog UX used by workflows/extensions while keeping integration install/switch behavior unchanged.
Changes:
- Introduces
specify integration searchandspecify integration infofor catalog-based discovery. - Adds
specify integration catalog list/add/removefor project-scoped catalog source management. - Adds integration catalog source management APIs (
get_catalog_configs,add_catalog,remove_catalog) with new unit + CLI tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/specify_cli/__init__.py |
Registers new integration search/info and integration catalog ... Typer commands and project guard. |
src/specify_cli/integrations/catalog.py |
Adds catalog source management API and a validation error type; handles deleting config on final-entry removal. |
tests/integrations/test_cli.py |
Adds end-to-end CLI coverage for search/info/catalog list/add/remove flows and project guard behavior. |
tests/integrations/test_integration_catalog.py |
Adds unit coverage for catalog source stack, add/remove behavior, and final-entry deletion fallback. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
049ab8e to
522acb8
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ab52d2d to
6d86483
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
da57bb2 to
9a3bf32
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I rebased this branch onto the latest from main to keep it current and easier to review and merge @mnriem. I also fixed the latest Copilot comments that came about catalog source display and fallback names, and the newest. For validation, I ran the integration catalog tests, CLI tests, focused catalog and CLI combined tests, the full integration suite, tests/test_agent_config_consistency.py -q, and the full pytest suite. I also manually tested and looked for any additional edge cases. Everything passed, let me know if you want me to update anything else. I'll be on the lookout if copilot makes more comments on your run |
|
Thank you! So cool :) |
Upstream changes (22 commits): - fix: include --from git+... in upgrade hint to avoid PyPI squat package (github#2411) - fix: dispatch opencode commands via run (github#2410) - feat: add catalog discovery CLI commands (github#2360) - fix(extensions): use explicit UTF-8 encoding when reading manifest YAML (github#2370) - feat: Speckit preset fiction book v1.7 - Support for RAG (Chroma DB) (github#2367) - chore: release 0.8.2, begin 0.8.3.dev0 development (github#2397) - Catalog updates: security review v1.3.0, v-model v0.6.0, threatmodel, isaqb-architecture-governance, m365, MarkItDown Fork customizations preserved: - Fork package name and version (agentic-sdlc-specify-cli) - skill_app integration from cli_customization - Bundled extensions and presets
* feat: add catalog discovery CLI commands * fix: address second Copilot review * fix: address third Copilot review * fix: align catalog remove with displayed order * fix: route local catalog config errors to local guidance * fix: address integration catalog review feedback * fix: accept numeric string catalog priorities * fix: align catalog remove with visible entries * fix: preserve invalid catalog root validation * fix: include invalid catalog priority value * fix: preserve falsy catalog root validation * fix: clarify integration catalog guidance * fix: align integration catalog list and remove * fix: align integration catalog edge cases * fix: clarify catalog error guidance tests * fix: clarify integration catalog edge cases * fix: harden integration catalog removal * fix: validate integration state before catalog search * fix: reject empty integration catalog URL * fix: allow catalog remove to clean non-string URLs * fix: address catalog env and priority review * fix: align catalog source display names * fix: align catalog fallback names
This PR Closes #2344.
Summary
This PR adds integration catalog discovery and catalog-source management commands for the Specify CLI.
It introduces:
specify integration search [query] [--tag T] [--author A]specify integration info <id>specify integration catalog listspecify integration catalog add <url> [--name N]specify integration catalog remove <index>The implementation follows the existing workflow catalog CLI shape while keeping integration behavior separate from workflows/extensions/presets. Integrations remain single-active through the existing
install,uninstall,switch, andupgradecommands.What changed
IntegrationCatalog.get_catalog_configs(),add_catalog(), andremove_catalog().Final-entry removal behavior
A review pass caught that removing the final project catalog entry could leave this file behind:
That would cause later integration commands to fail, because
_load_catalog_config()rejects an existing config file with no catalog entries.This PR now handles that case by deleting:
If catalog entries remain after removal, the file is written normally. If no entries remain, the file is removed and the project falls back to the built-in default catalogs.
What did not change
specify integration add,remove,enable,disable, orset-prioritycommands were added.specify integration list,install,uninstall,switch, andupgradebehavior was not refactored._load_catalog_config()validation was not relaxed.catalog remove <index>remains 0-based, matching the issue request and the existing workflow catalog command shape.catalog addwrites project-level config only. It does not add user/global catalog management.Test selection reasoning
src/specify_cli/__init__.pyintegration search,info, andcatalog list/add/removesrc/specify_cli/integrations/catalog.pytests/integrations/test_cli.pytests/integrations/test_integration_catalog.pyRequired tests
Testing
I ran the focused catalog/CLI regression tests, the full integration suite, agent config consistency, the full pytest suite, and a whitespace diff check from native PowerShell on Windows.
Command-level validation covered by tests
The automated CLI tests cover:
Final-entry regression validation
The focused tests include both library-level and CLI-level coverage for the final-entry removal bug:
remove_catalog(0)deletes.specify/integration-catalogs.ymlwhen removing the only catalog entry.get_active_catalogs()returns the built-indefaultandcommunitycatalogs.catalog addfollowed bycatalog remove 0deletes the config file.integration catalog listsucceeds and shows the built-in defaults.AI disclosure
I used ChatGPT/Cursor as a coding and review assistant while working on this PR. I implemented and reviewed the final changes myself, and used the tools to help investigate the issue, draft parts of the tests, and polish the PR description. I also ran the validation commands and verified the final diff and test results before submitting this PR.