Skip to content

ci: skip the push run of Mainframe Ground Truth / Smoke Tests when the PR run proved the same tree (Part of #4935) - #4961

Merged
squid-protocol merged 1 commit into
mainfrom
ci/4935-heavy-twice
Oct 12, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
ci/4935-heavy-twice

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #4935 (member 3, "Heavy jobs run twice"); part of #4847. Owner-queued, allow_workflows: true.

What

Mainframe Ground Truth and Smoke Tests ran on the PR and again on the post-merge push. A new tested-tree job (tests/tools/skip_tested_tree.py) skips the push run when this exact tree already passed the same workflow on the PR. decide() is pure; any API error runs the workflow (fail-open).

Skip only when ALL hold: push to main; one parent (squash/rebase, not a merge commit); exactly one merged PR maps to the commit; the commit's tree SHA == the PR head's tree SHA; the commit's parent is an ancestor of the head (a pull_request run checks out the head+base test merge and the API does not say which base, so "the final parent is in the head" is what proves that test merge was the head's own tree); the newest pull_request run of this workflow on the head is success. Red / cancelled / in progress / missing, behind-main PRs, merge commits, direct pushes, schedule and dispatch runs: run in full.

  • mainframe-ground-truth.yml: ground-truth needs tested-tree. The history rows used to come only from the push run, so the nightly run now also writes them (--history + the history PR on schedule).
  • smoke-test.yml: only full-suite-part is skipped. The 9-way OS grid is not run on PRs, so it always runs on the push. The full-suite aggregator accepts skipped only when the gate said skip=true.

Main Watch

Not touched (main-watch.yml, main_watch.py). The gate job always runs, so the workflow still concludes success/failure on main; Main Watch counts only success/failure (latest_verdicts) and ignores skipped/cancelled. A skip is a true green for that tree. docs/ci.md has the section.

Class sweep

Class: workflows with pull_request and a main push trigger. Members and status are in the report below (Sibling gaps).

Tests

tests/tools/test_skip_tested_tree.py (25): equal tree + green; PR run red / cancelled / in progress / skipped / missing / push-only; newer red beats older green; older red then green; tree differs; parent not in head; merge commit; no PR; wrong merge sha; other ref; schedule / dispatch / pull_request never skip; snapshot against a fake gh (behind PR makes no run query; two PRs; non-push makes no call; API error fails open).
pr_gates --fast 5/5, --ratchets 7/7 (no golden masters touched).

Measured (7 days, from gh api)

See the comment on #4847.

Cross-repo: none.

🤖 Generated with Claude Code

…e PR run proved the same tree (Part of #4935)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant