Skip to content

build: Update rust toolchain version - #5807

Merged
max-sixty merged 2 commits into
mainfrom
update_rust_toolchain_action
Apr 17, 2026
Merged

max-sixty merged 2 commits into
mainfrom
update_rust_toolchain_action

Conversation

@prql-bot

Copy link
Copy Markdown
Collaborator

Automatic change by the update-rust-toolchain Github Action.

Github Actions will not run workflows on pull requests which are opened by a GitHub Action.

For examples on how to run workflows on this pr, please go to the readme.

@max-sixty

Copy link
Copy Markdown
Member

@prql-bot why didn't this fire a reviewers which fixed the issues? it is under your user, not a github-actions agent, so it should be able to trigger a workflow

Rust 1.94's clippy rejects `checked_sub(1).unwrap_or_default()` as manual
saturating arithmetic. Replace with `saturating_sub(1)`.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@prql-bot

Copy link
Copy Markdown
Collaborator Author

Workflows did fire on this PR — the tests and review checks both ran (the review completed cleanly in 3m). The issue is separate: there's no auto-fix workflow wired up for PR-branch CI failures.

tend-ci-fix.yaml is scoped to branches: ["main"], so it only triggers on main-branch failures. tend-review ran but is review-only — it doesn't push fixes. That's why the manual_saturating_arithmetic clippy error introduced by Rust 1.94 sat unfixed.

I've pushed 5c3b4ba to apply saturating_sub(1), which should unblock CI.

If you'd like auto-fix on PR branches too, the knob would be broadening tend-ci-fix.yaml's workflow_run trigger or adding a companion workflow — happy to draft that in a separate PR.

@max-sixty

Copy link
Copy Markdown
Member

but why didn't the review spot the test failures?

@prql-bot

Copy link
Copy Markdown
Collaborator Author

Timing — the review ran before any tests failed.

  • tend-review ran 11:12:32Z → 11:17:10Z (triggered by pull_request_target: opened, runs in parallel with tests)
  • First test-rust failure: 11:18:59Z (~2 min after review finished)
  • Later test-rust-main failures: 11:22Z, 11:25Z, 11:38Z

By the time the clippy error surfaced, the review job had already completed and wouldn't re-run. tend-review.yaml triggers on opened/synchronize/ready_for_review/reopened — not on CI completion — and has no step that waits for tests to finish.

To make reviews catch CI failures, the workflow would need a workflow_run trigger on tests (completed), or an explicit wait step in tend-review. Happy to draft either in a separate PR.

@max-sixty

Copy link
Copy Markdown
Member

but isn't the review supposed to hang around until the tests are finished?

@max-sixty
max-sixty merged commit 17b1891 into main Apr 17, 2026
77 checks passed
@max-sixty
max-sixty deleted the update_rust_toolchain_action branch April 17, 2026 22:51
@prql-bot

Copy link
Copy Markdown
Collaborator Author

It is — the review's step 6 runs a gh pr checks --required polling loop after submitting. The gap is what counts as "required": in this repo that's only check-ok-to-merge and pre-commit.ci - pr. The test-rust / test-rust-main checks that caught the clippy failure aren't required, so the loop saw pre-commit.ci pass and exited at ~11:17Z, before the first test-rust failure at 11:18:59Z.

The session log for the review run confirms this — the loop backgrounded, returned once pre-commit.ci - pr showed pass, and the job completed. It didn't time out; it considered CI green by its own criterion.

Two ways to close this: either mark test-rust / test-rust-main as required branch-protection checks (so --required picks them up), or change the review skill to poll all checks, not just required ones. The first is a one-time repo setting; the second is an upstream change to the tend-ci-runner review skill. Happy to open either as a follow-up.

@max-sixty

Copy link
Copy Markdown
Member

look again at the required checks: I think there's an omnibus check?

@prql-bot

Copy link
Copy Markdown
Collaborator Author

You're right — I was wrong about that. check-ok-to-merge is an alls-green omnibus with test-rust and test-rust-main in its needs, and GraphQL confirms both check-ok-to-merge and pre-commit.ci - pr come back as required for this PR. So test-rust failures would have flunked check-ok-to-merge.

The actual reason the review loop missed it: the check-run wasn't published yet. On the broken commit (8ff52aff), check-ok-to-merge only started at 11:40:35Z — 23 minutes after the review finished at 11:17:10Z — because if: always() + needs: means the job doesn't register a check-run until all its dependencies complete. In the session log from run 24562181409, gh pr checks 5807 --required returned only pre-commit.ci - pr (3 mentions, 0 for check-ok-to-merge) — the omnibus literally wasn't in the API response at polling time.

So the review loop's exit condition (no pending/queued/in_progress in --required output) was satisfied because the only required check it could see had passed. Fixing this means either polling all checks instead of only required ones, or waiting explicitly for the tests workflow run to complete. That's an upstream change to the tend-ci-runner review skill — happy to raise it there.

tend-agent added a commit to max-sixty/tend that referenced this pull request Apr 18, 2026
…hecks --required`

`gh pr checks --required` only sees already-registered check-runs, so a
late-starting `if: always()` omnibus (e.g. `check-ok-to-merge` that
waits on a big `needs:` matrix) can race the polling loop: the early
polls see only the fast required contexts green and exit while the real
matrix is still running or has already failed. Incident trace in #305
(downstream: PRQL/prql#5807, PRQL/prql#5809).

Switch the loop to `gh pr view --json mergeStateStatus,reviewDecision,statusCheckRollup`:

- `statusCheckRollup` surfaces every check-run and status context on
  the commit, not just the required ones — filter own-run by URL and
  count IN_PROGRESS / QUEUED / PENDING / WAITING to decide whether to
  keep waiting.
- `mergeStateStatus` accounts for required-but-unreported contexts
  that `gh pr checks` cannot see. If the PR is `BLOCKED` and
  `reviewDecision` is not `REVIEW_REQUIRED`/`CHANGES_REQUESTED`, a
  required context is still outstanding — keep polling.
- Bump budget 10 → 15 minutes since the loop now waits on every
  check-run on the commit (not just required).

Mirror the update in the `review` skill's Step 6 so the duplicate
snippet does not drift.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
max-sixty pushed a commit to max-sixty/tend that referenced this pull request Apr 18, 2026
…hecks --required` (#308)

Fixes #305.

## Summary

- Replace the `gh pr checks <n> --required` polling loop with a `gh pr
view --json mergeStateStatus,reviewDecision,statusCheckRollup` loop so
late-registering `if: always()` omnibus checks (e.g.
`check-ok-to-merge`) can't race the polling and make the bot report a
broken PR green.
- Mirror the change in `review` Step 6 — the snippet was duplicated,
flagged in my first comment on #305.
- Bump the polling budget 10 → 15 minutes now that the loop waits on
every check-run on the commit, not just required ones.

## Why this shape

From [issue #305](#305) +
[discussion with
@max-sixty](#305 (comment)):
`gh pr checks --required` only reports check-runs that are **already
registered** on the commit. An omnibus with `if: always()` and a long
`needs:` list doesn't register its check-run until the needs start
resolving — so early polls see only the fast required contexts (e.g.
`pre-commit.ci - pr`), the loop exits green, and the real matrix is
still running or has already failed.

The new loop pairs two signals that between them don't have that blind
spot:

1. **`statusCheckRollup`** — every check-run and status context on the
commit, not just required ones. Filter out the current run by URL and
count `IN_PROGRESS`/`QUEUED`/`PENDING`/`WAITING` items. This alone
catches the PRQL incident because the test matrix jobs are in the rollup
even though they're not directly required by branch protection.
2. **`mergeStateStatus` + `reviewDecision`** — backstop for the narrow
window where matrix jobs are already terminal but the omnibus check-run
hasn't yet registered. `mergeStateStatus = BLOCKED` with
`reviewDecision` not in `{REVIEW_REQUIRED, CHANGES_REQUESTED}` means a
required context is outstanding and we should keep polling; `BLOCKED`
with review-required means approval is the blocker (CI-wise we're done,
exit).

`UNKNOWN` (`mergeStateStatus` hasn't been computed yet) also keeps us
polling — GitHub computes it asynchronously after a push.

## Known limitation

`BLOCKED` + `REVIEW_REQUIRED` can mean either (a) approval-only block
with all checks done or (b) approval-needed **and** a required context
not yet registered. These are indistinguishable from a single snapshot
without reading branch protection, which most bot PATs can't do. In
practice the registration window for an omnibus is seconds (between last
`needs:` job completing and the job starting), so a 60-second poll
cadence nearly always catches the next registered state. Documented
in-comment.

## Test plan

- [ ] Sanity-checked the `jq` filter against a real PR
(`PRQL/prql#5807`) — returns `PENDING=0` on a merged PR as expected.
- [ ] `uvx pre-commit run` passes on both files.
- [ ] Change is skill-file-only (no generator/workflow changes).
- [ ] Downstream verification happens when consumers next regenerate
nightly; the PRQL scenario from #305 is the canonical case to watch.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: tend-agent <[email protected]>
Co-authored-by: Claude Opus 4.7 <[email protected]>
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.

2 participants