Repository navigation
Conversation
Use the config parser's one-based defaults when deriving the priority of a new workflow or step catalog source. Add regression coverage for omitted, mixed, explicit numeric-string, and negative priorities without rewriting the existing entries. Assisted-by: OpenAI Codex (model: GPT-6, autonomous)
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Both localized fixes match their config readers’ defaults and have focused regression coverage with reported before-and-after evidence.
No open issues 🎉
What changed in this PR
Fixes #5074 by making newly added workflow and step catalog sources follow existing sources when priorities are omitted, preserving Specify CLI’s catalog precedence.
Changes:
- Use the config readers’ one-based defaults when calculating the next source priority.
- Add mirrored regression tests for implicit, mixed, explicit numeric-string, and negative priorities, including checks that existing source records remain unchanged.
Validation relies on the reported before-and-after results; tests were not rerun here.
| File | Description |
|---|---|
tests/specify_cli/workflows/step/catalog/test_domain.py |
Tests step catalog ordering and preservation of existing records. |
tests/specify_cli/workflows/catalog/test_domain.py |
Tests workflow catalog ordering and preservation of existing records. |
src/specify_cli/workflows/step/catalog/_domain.py |
Aligns new step catalog priorities with reader defaults. |
src/specify_cli/workflows/catalog/_domain.py |
Aligns new workflow catalog priorities with reader defaults. |
Review effort: Max
Collaborator
|
Please address test & lint errors |
This branch has not been deployed
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
Fixes #5074.
Adding a workflow or step catalog to three sources with omitted priorities currently changes their effective order from
first, second, thirdtofirst, added, second, third. The config reader assigns omitted priorities from their one-based positions, butadd_catalogtreated them as zero and assigned the new source priority 1. This can change which source supplies a shared workflow or step ID.Both
add_catalogimplementations now use the reader's one-based default when deriving the maximum existing priority. The example produces priority 4 and orderfirst, second, third, added. Explicit priorities, numeric-string coercion, the existing malformed-priority fallback, and the existing source records retain their behavior.Testing
uv sync --extra testand checked this worktree's.venv/Scripts/specify --help.Windows, Python 3.12.7:
.venv/Scripts/python -m pytest tests/specify_cli/workflows/catalog tests/specify_cli/workflows/step/catalog tests/test_workflows.py -k 'Catalog or catalog' -q: 145 passed, 692 deselected.PYTHONUTF8=1,.venv/Scripts/python -m pytest tests/specify_cli/workflows tests/test_workflows.py -n 2 -q: 1474 passed, 68 skipped, 35 failed. All 35 failing nodes also fail in a separate, unmodified67e0f72worktree with its own virtualenv: 34 fail while creating symlinks (WinError 1314), and one requires network access unavailable in the local sandbox.-n 2 --maxfail=10: 1705 passed, 240 skipped, 20 failed before the xdist failure limit stopped the run. All 20 failing nodes also fail on the unmodified baseline: Windows path-length/symlink limitations and unavailable network access. The full suite is not claimed to pass or complete locally.uvx ruff@0.15.0 check src tests: passed.git diff --check: passed.Test selection reasoning
add_catalogspecify workflow catalog add; resulting source precedenceadd/listadd_catalogspecify workflow step catalog add; resulting source precedenceadd/listThe changed methods are called by the catalog-add CLI handlers. Command templates do not invoke these methods; the sample exercises the affected CLI operations directly.
AI Disclosure
AI disclosure: OpenAI Codex (GPT-6), operating autonomously at JRHU0048's request, investigated the existing report, generated the fix and tests, executed automated checks and CLI verification, reviewed the diff, and drafted this PR. A more specific model variant and reasoning-effort setting are not exposed to the agent. This disclosure does not claim personal human line-by-line review or testing.