Skip to content

fix: check-and-restart job was silently skipping every time (implicit success()) - #83

Merged
tamara-builds merged 2 commits into
mainfrom
fix/check-and-restart-implicit-success
Jul 21, 2026
Merged

fix: check-and-restart job was silently skipping every time (implicit success())#83
tamara-builds merged 2 commits into
mainfrom
fix/check-and-restart-implicit-success

Conversation

@tamara-builds

Copy link
Copy Markdown
Collaborator

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:

  • 3 `failure` conclusions on `ky-legislation`
  • 1 `cancelled` conclusion on `la-legislation` that ran the full 5h55m before GitHub killed it -- exactly the scenario this job exists for

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

  • Confirmed via jobs API that all 4 historical failure/cancellation cases showed check-and-restart as skipped
  • Snapshots regenerated for the corrected `if:` condition
  • Next real timeout/failure on any PDF-only state will confirm the job actually runs now (will still likely fail at the "Trigger workflow restart" step until PAT_WORKFLOW_TRIGGER is provisioned)

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

tamara-builds and others added 2 commits July 20, 2026 23:42
… 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>
@tamara-builds
tamara-builds merged commit 2f5a3f0 into main Jul 21, 2026
5 checks passed
@tamara-builds
tamara-builds deleted the fix/check-and-restart-implicit-success branch July 21, 2026 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant