fix(workflows): state the equal-priority tie-break in workflow resolve output - #4542
Open
jawwad-ali wants to merge 1 commit into
Open
fix(workflows): state the equal-priority tie-break in workflow resolve output#4542jawwad-ali wants to merge 1 commit into
workflow resolve output#4542jawwad-ali wants to merge 1 commit into
Conversation
…ve' output
`workflow resolve` prints the layer list under a bare header:
console.print("Layers (highest precedence first):")
`collect_all_layers` sorts by `(priority, source)` ascending, which puts the
winning layer first only while priorities DIFFER. On a tie the sort is
alphabetical by source, while the merge gives the conflict to the LAST id
(docs/reference/workflows.md:126: "Equal-priority overlays are applied
alphabetically by ID, with the last ID winning conflicts").
So for a tie the header stated the opposite of the outcome printed directly
beneath it, in the one command whose job is explaining which overlay won:
DIFFERENT priorities (alpha=5, beta=10)
listed first : project:alpha
actual winner: echo FROM-ALPHA header correct? YES
EQUAL priorities (both 10)
listed first : project:alpha
actual winner: echo FROM-BETA header correct? NO
The ordering itself is deliberate and pinned by
`test_workflow_resolve_equal_priority_layers_sort_by_source`, so this spells
the tie-break out rather than reordering the list. Output is now
self-consistent:
Layers (highest precedence first; on equal priority the last ID wins):
- [project-overlay] project:alpha (priority=10)
- [project-overlay] project:beta (priority=10)
Step attribution:
- build: project:beta
Co-Authored-By: Claude Opus 5 (1M context) <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.
Problem
workflow resolveprints the layer list under a bare header:collect_all_layerssorts by(priority, source)ascending, which puts the winning layer first only while priorities differ. On a tie the sort is alphabetical by source, while the merge gives the conflict to the last id — exactly as documented:So on a tie the header states the opposite of the outcome printed directly beneath it, in the one command whose documented purpose is explaining which overlay contributed or overrode a step.
Reproduction on current
main(c173bf1)The full output contradicted itself two lines apart:
Fix — the label, not the order
The ordering is deliberate:
test_workflow_resolve_equal_priority_layers_sort_by_sourcepins it, and its own comment acknowledges that the alphabetically-last layer is the one that wins. Reordering the list would fight a decision the maintainers made on purpose, so this spells the tie-break out instead:Now self-consistent, and the behaviour is untouched.
Verification
upstream/main→ 26 passed with the fix.git grep "highest precedence first" -- tests/is empty), andtest_workflow_resolve_equal_priority_layers_sort_by_sourcepasses unchanged.uvx ruff@0.15.0 check src tests→ cleanNo behaviour change — output text only.
Note on overlap: this touches
overlays/_commands.py, as does my #4141, but a different function (workflow_resolvevsworkflow_overlay_add). Happy to rebase whichever lands second.Written with assistance from Claude Code. Bug found, reproduced, and verified by me on current
main.🤖 Generated with Claude Code