fix(workflows): expose workflow/step catalog add metadata options#3388
Open
WOLIKIMCHENG wants to merge 2 commits into
Open
fix(workflows): expose workflow/step catalog add metadata options#3388WOLIKIMCHENG wants to merge 2 commits into
WOLIKIMCHENG wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns the workflow and step catalog “add” commands with the capabilities already supported by the underlying catalog config by exposing metadata fields (priority, install_allowed, description) through both the CLI and the Python catalog APIs.
Changes:
- Added
--priority,--install-allowed/--no-install-allowed, and--descriptionoptions toworkflow catalog addandworkflow step catalog add. - Extended
WorkflowCatalog.add_catalog()andStepCatalog.add_catalog()to accept optional metadata overrides while preserving existing defaults when omitted. - Expanded workflow/step catalog tests to cover defaults, Python API overrides, and CLI option wiring.
Show a summary per file
| File | Description |
|---|---|
tests/test_workflows.py |
Adds assertions and new tests covering default metadata, override behavior, and CLI option handling for both workflow and step catalogs. |
src/specify_cli/workflows/catalog.py |
Extends both catalog add_catalog() methods to accept optional priority, install_allowed, and description overrides. |
src/specify_cli/workflows/_commands.py |
Adds new Typer options to the two CLI “catalog add” commands and passes them through to the catalog layer. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Low
Comment on lines
1019
to
1027
| ): | ||
| """Add a workflow catalog source.""" | ||
| from .catalog import WorkflowCatalog, WorkflowValidationError | ||
|
|
||
| project_root = _require_specify_project() | ||
| catalog = WorkflowCatalog(project_root) | ||
| try: | ||
| catalog.add_catalog(url, name) | ||
| catalog.add_catalog(url, name, priority, install_allowed, description) | ||
| except WorkflowValidationError as exc: |
Contributor
Author
There was a problem hiding this comment.
Updated this call to pass priority, install_allowed, and description by keyword.
Comment on lines
1678
to
1687
| @@ -1669,7 +1683,7 @@ def workflow_step_catalog_add( | |||
|
|
|||
| catalog = StepCatalog(project_root) | |||
| try: | |||
| catalog.add_catalog(url, name) | |||
| catalog.add_catalog(url, name, priority, install_allowed, description) | |||
| except StepValidationError as exc: | |||
Contributor
Author
There was a problem hiding this comment.
Updated this call to pass priority, install_allowed, and description by keyword.
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
workflow catalog addandworkflow step catalog addonly exposedurland optional--name, even though the underlying workflow/step catalog config already supportspriority,install_allowed, anddescription, and the sibling preset/extension catalog commands already expose those knobs.This change keeps the fix narrow:
--priority,--install-allowed/--no-install-allowed, and--descriptionto both workflow catalog add commandsWorkflowCatalog.add_catalog()andStepCatalog.add_catalog()with backward-compatible optional overridesmax + 1install_allowedstill defaults totruedescriptionstill defaults to an empty stringTesting
uv run specify --help.venv/bin/python -m pytest tests/test_workflows.py -k "WorkflowCatalog or StepCatalog" -v— 37 passed.venv/bin/specify workflow catalog add --help.venv/bin/specify workflow step catalog add --help