Repository navigation
fix(#73): resolve a traversed ancestor's call in its shared workflow - #139
Merged
Merged
Conversation
success() and failure() read every ancestor, and _ancestors counts a called job reached through another job as its caller. The caller was looked up only with the prefix of the job being decided, so for A -> middle -> B (A and B reusable calls) B / leaf looked up A / optional with the prefix "B / ", did not count it as A, and saw the job skipped by its own if: as an unsuccessful ancestor. B / leaf on if: success() was skipped; on GitHub it runs. Each ancestor is now resolved in the innermost workflow it shares with the decided job: the longest of the job's enclosing prefixes (new helper _scopes) that the ancestor key starts with. Jobs in the decided job's own called workflow and nested calls inside it resolve as before. Adds a test for A -> middle -> B with an optional skipped job in A and a success() job in B, and records the case in the bug ledger. Note: pre-commit could not fetch hook repositories in the sandbox (HTTP 403). ruff 0.17.3 check, whitespace/end-of-file checks and the secret scan were run directly and passed. In tests/actions, test_runner_shutdown.py fails on main too and is unrelated. Closes #73 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 Finished Review · ✅ Success · Started 10:48 PM UTC · Completed 10:54 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.96 |
|
Risk Assessment: moderate (2/5) DetailsSmall 3-file bug fix aligning directly with issue #73 and backed by new tests, but scored moderate due to moderate churn in the workflow scheduler and unflagged behavioral modification. |
|
Looks good to me Labels: PR is a bug fix in the workflow scheduler. |
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.
Summary
success()andfailure()check every ancestor of a job. When one of those ancestors is a job from a reusable-workflow call,_ancestorsinsrc/app/services/workflow_scheduler.pycounts the call itself (with the call's result) instead of the individual called job. It finds the call by looking up the job key with a prefix. That prefix was always the decided job's own (B /forB / leaf). So when the dependency path went into a different call (A -> middle -> B),A / optionalwasn't counted asA.B / leafsaw a job that was skipped by its ownif:, treated it as unsuccessful, and was skipped. On GitHub it runs.Changes
src/app/services/workflow_scheduler.py: the new helper_scopeslists the workflow prefixes that enclose a job key, innermost first._ancestorsnow looks up each ancestor's call using the longest of those prefixes that the ancestor's key starts with, which is the innermost workflow the ancestor shares with the decided job. Lookups that stay inside the decided job's own called workflow, or go into calls nested in it, give the same result as before.tests/actions/test_reusable_caller_needs.py: new test forA -> middle -> B.Ahas one successful job and one skipped by its ownif:, andB / leafusesif: success(). It failed before the fix (B / leafwas skipped) and passes after.docs/bugs/fixed/job-needing-a-reusable-workflow-caller-waits-forever.md: added this case to the ledger entry.Testing
uv run pytest tests/actions/test_reusable_caller_needs.py tests/actions/test_skipped_reusable_caller.py tests/actions/test_workflow_call_fidelity.py: 55 passed.uv run pytest tests/actions: 733 passed, 1 failed. The failure istest_runner_shutdown.py::test_a_shutdown_signal_fails_the_running_step_and_stops_its_processes, which also fails on unmodifiedmainand has nothing to do with this change.pre-commitcouldn't fetch its hook repositories in the sandbox (HTTP 403). I ranruff check(0.17.3), the trailing-whitespace and end-of-file checks, and the secret scan directly, and they passed.🤖 Generated with Claude Code
Closes #73
Post-script verification
agent/73-cross-call-status-ancestors)fdad287855ddb6f1e85a045e407b1f09948ade1c..HEAD)