fix(maint): reuse recent same-PR hosted gates#104355
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ffdb503c6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| (run) => | ||
| run?.event === "pull_request" && | ||
| run?.head_sha !== sha && | ||
| run?.pull_requests?.some((pullRequest) => pullRequest?.number === pr) && | ||
| isRecentRun(run, nowMs), |
There was a problem hiding this comment.
Require patch-equivalent proof before reusing older PR heads
When OPENCLAW_TESTBOX=1 and the current head only has pending hosted gates, this new fallback accepts any recent pull_request run for the same PR number, without proving that the older head has the same tree or patch as the current head. The existing safe path only validates patch equivalence for PREP_SYNC_EVIDENCE_SHA in scripts/pr-lib/gates.sh:399-421, so an arbitrary follow-up push can borrow green gates from different code and be landed before current-head CI/Testbox finishes. Keep branch-history reuse behind the same patch/tree proof, or require exact-head success for non-equivalent heads.
Useful? React with 👍 / 👎.
|
Codex review: stale review; fresh review needed. Summary Next step |
|
Land-ready at Proof:
Current-head terminal failures still block fallback. Reused evidence must be recent, complete, coherent on one SHA, and associated with this PR. |
|
Merged via squash.
|
* origin/main: fix(cron): abort superseded reconciliation hooks (#104368) ci(release): expose Telegram runtime preflight stage (#104387) fix(status): avoid false shell-wrapper audit warnings (#81778) fix: retry live Gateway readiness proof (#104374) fix(exec-approval): stop misattributing Allow Always unavailability to policy (#97740) fix: preserve Mac bundle during live builds (#104376) chore(docs): translate with GPT-5.6 xhigh test: wire Control UI suite into CI, fix its broken tests, drop dead harness surface (#104361) fix(ui): hide group submenu separator when New group is the only entry (#104370) fix(discord): reset progress drafts across queued turns (#102341) docs(cli): clarify that exec-policy show and approvals get exclude per-session /exec overrides (#94999) fix(discord): single-source thread-binding default placement and guard artifact parity (#104342) fix(agents): add tool-activity heartbeat to keep subagent alive during tool calls (#95536) fix(maint): reuse recent same-PR hosted gates (#104355)
* fix(maint): reuse recent same-PR hosted gates * style(maint): format hosted gate verifier
* origin/main: fix(cron): abort superseded reconciliation hooks (openclaw#104368) ci(release): expose Telegram runtime preflight stage (openclaw#104387) fix(status): avoid false shell-wrapper audit warnings (openclaw#81778) fix: retry live Gateway readiness proof (openclaw#104374) fix(exec-approval): stop misattributing Allow Always unavailability to policy (openclaw#97740) fix: preserve Mac bundle during live builds (openclaw#104376) chore(docs): translate with GPT-5.6 xhigh test: wire Control UI suite into CI, fix its broken tests, drop dead harness surface (openclaw#104361) fix(ui): hide group submenu separator when New group is the only entry (openclaw#104370) fix(discord): reset progress drafts across queued turns (openclaw#102341) docs(cli): clarify that exec-policy show and approvals get exclude per-session /exec overrides (openclaw#94999) fix(discord): single-source thread-binding default placement and guard artifact parity (openclaw#104342) fix(agents): add tool-activity heartbeat to keep subagent alive during tool calls (openclaw#95536) fix(maint): reuse recent same-PR hosted gates (openclaw#104355)
What Problem This Solves
The landing wrapper only reused recent hosted-gate evidence after its own controlled rebase. Ordinary follow-up pushes therefore waited for an entirely new gate cohort even when the same PR had just completed one.
Why This Change Was Made
Allow a coherent successful gate cohort from an earlier head of the same PR to satisfy hosted-gate verification for up to 12 hours. Exact-head evidence remains preferred, evidence never crosses PRs or mixes heads, and any terminal failure on the current head still blocks landing.
This generalizes the rebase-only exception introduced in #100663 while shortening its window from 24 hours to 12.
User Impact
Maintainers can land small follow-up pushes without routinely waiting for duplicate hosted gates. A currently failing head cannot borrow an older green result.
Evidence
corepack pnpm test test/scripts/verify-pr-hosted-gates.test.ts— 33 passed on Blacksmith Testbox leasetbx_01kx87w86s0pcv5d0697975m6qnode_modules/.bin/oxfmt --check scripts/verify-pr-hosted-gates.mjs test/scripts/verify-pr-hosted-gates.test.tsgit diff --check