fix: check-and-restart job was silently skipping every time (implicit success()) - #83
Merged
Merged
Conversation
… success()) Confirmed across every real failure/cancellation govbot-data has hit so far (3 KY failures, 1 LA timeout-cancellation that ran the full 5h55m) -- check-and-restart showed conclusion "skipped" 100% of the time, meaning this safety net has never once actually fired since it was written. Root cause: GitHub Actions implicitly ANDs a job's if: with success() unless the condition explicitly calls a status-check function (always/ success/failure/cancelled). needs.extract-text.result == 'cancelled' || needs.extract-text.result == 'failure' doesn't call one, so GitHub silently required the needed job to have succeeded too -- which by definition it hadn't, in exactly the cases this job exists to handle. Fix: if: always() && (needs.extract-text.result == 'cancelled' || needs.extract-text.result == 'failure'). Note: PAT_WORKFLOW_TRIGGER (needed for the "Trigger workflow restart" step's gh workflow run call) is not currently set as a repo secret on at least govbot-data/sd-legislation (checked directly, total_count: 0) -- org-level couldn't be checked without elevated gh auth scope. Even with this fix, the restart step itself won't work until that secret exists. Flagging for follow-up, not fixed here. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Same root cause and fix as the previous commit, found while checking whether this pattern appeared elsewhere in the repo. Co-Authored-By: Claude Sonnet 5 <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.
Summary
`check-and-restart` (the job meant to auto-retrigger `extract-text.yml` after a timeout/failure, since a run against a large state can hit the ~6h GitHub Actions ceiling) has never once actually run, on any state, since it was written.
Checked every real case govbot-data has hit so far:
In all 4 cases, `check-and-restart`'s own conclusion was `skipped`, confirmed via the jobs API.
Root cause: GitHub Actions implicitly ANDs a job's `if:` condition with `success()` unless the condition explicitly calls a status-check function (`always()`/`success()`/`failure()`/`cancelled()`). The existing condition (`needs.extract-text.result == 'cancelled' || needs.extract-text.result == 'failure'`) doesn't call one, so GitHub silently required the needed job to have also succeeded -- which by definition it hadn't, in exactly the cases this job is supposed to catch.
Fix: `if: always() && (needs.extract-text.result == 'cancelled' || needs.extract-text.result == 'failure')`
One thing this doesn't fix
`PAT_WORKFLOW_TRIGGER` (needed for the "Trigger workflow restart" step's `gh workflow run` call) isn't set as a repo secret on at least `govbot-data/sd-legislation` (checked directly -- `total_count: 0`). Couldn't check org-level secrets without elevated `gh` auth scope. Even with this fix, the restart step itself will fail until that secret exists -- flagging as a separate follow-up, not addressed in this PR.
Test plan
Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com