fix(workflows): load custom steps before add - #4473
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The targeted fix is correct, consistent with existing workflow commands, and covered by a regression test.
Pull request overview
Loads project-installed workflow steps before validating newly added workflows.
Changes:
- Loads custom steps after resolving the project root.
- Adds a regression test for the loading order and root argument.
File summaries
| File | Description |
|---|---|
src/specify_cli/workflows/_commands.py |
Loads custom steps before workflow validation. |
tests/test_workflows.py |
Verifies custom-step loading uses the resolved project root. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
The fix itself is right (review's green, ubuntu passes), but your new regression test |
Assisted-by: GitHub Copilot (model: unknown, supervised)
bfb33d7 to
900042a
Compare
|
@mnriem
The path comparison now resolves both paths before asserting equality. |
There was a problem hiding this comment.
🟡 Changes recommended
The regression test does not verify that a workflow using a custom step validates and installs successfully.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
| assert result.exit_code == 0, result.output | ||
| assert "installed" in result.output | ||
|
|
||
| def test_add_loads_custom_steps_after_resolving_project(self, temp_dir, monkeypatch, sample_workflow_yaml): |
Assisted-by: GitHub Copilot (model: unknown, supervised)
Description
Fix the
workflow addcommand so it loads custom workflow steps beforevalidating a workflow.
Previously,
workflow adddid not callload_custom_steps(project_root).As a result, workflows containing custom steps such as
feedbackcould not bevalidated and added successfully.
A regression test was added to verify that the project root is resolved before
custom steps are loaded.
Testing
uv run specify --help.venv/bin/python -m pytest tests/test_workflows.py -quv sync && uv run pytestFocused test result:
The sample project test verified that:
feedbackstep was installed from a step catalog.feedbackstep was added successfully withspecify workflow add --dev.The full test suite was not marked as passing because running
uv sync && uv run pytestwithout thetestextra removed the test dependencies and resultedin collection errors. The focused workflow test suite passed successfully.
AI Disclosure
The code changes and regression tests were created with GitHub Copilot. The
changes were reviewed and tested by the contributor.