feat(webhook): recover lost auto-plans from check_suite.requested - #1002
Draft
Kiran01bm wants to merge 2 commits into
Draft
feat(webhook): recover lost auto-plans from check_suite.requested#1002Kiran01bm wants to merge 2 commits into
Kiran01bm wants to merge 2 commits into
Conversation
Every push to a PR branch produces two independent deliveries: pull_request (what auto-plan acts on) and check_suite.requested. When the pull_request delivery is lost upstream of the inbox, the PR sits blocked until the reconciler's next scan. Feed the check_suite signal into the durable inbox with a grace-delayed not-before time so the organic delivery wins the race, and synthesize a recovery delivery only for open PRs still at the suite head whose auto-plan coverage is missing. Recovery rows reuse the reconciler's deterministic GUID so the two producers dedupe naturally. Kill switch: WEBHOOK_CHECK_SUITE_RECOVERY=false.
GitHub names a same-repo head's open PRs in the check_suite payload, so a non-fork suite with an empty list has nothing to recover: drop it at ingress and never walk the open-PR listing for it — the walk now serves only fork heads. Replaces the default-branch filter, which wrongly dropped suites for PRs whose head is the default branch. Also documents the Check suite App event subscription, without which the feature receives no deliveries and is silently inert.
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
Feed GitHub's
check_suite.requesteddelivery into the durable inbox as a grace-delayed, redundant convergence signal that recovers lost auto-plan deliveries for open PR heads. Stacked on #999 (needsCreatepersistingretry_after); only the last commit is new here.Why
Every push to a PR branch produces two independent deliveries:
pull_request(what auto-plan acts on) andcheck_suite.requested. When thepull_requestdelivery is lost upstream of the inbox, the check suite sits queued with zero check runs and the PR is blocked with no recourse until the reconciler's next scan. The check_suite delivery is GitHub's purpose-built "populate your check runs for this SHA now" signal — handling it converges a lost auto-plan in minutes instead of waiting for the reconcile interval.What
check_suite.requestedonly (durable-gated, allowlisted, default-branch pushes filtered, fork heads pass through) and enqueues it with a not-before time — the recovery grace — so the organicpull_requestdelivery wins the race.pull_requests[]with mandatory current-head equality; bounded open-PR scan fallback for empty/fork payloads) and synthesizes a recovery delivery only for open PRs still at that head whose auto-plan coverage is missing.WEBHOOK_CHECK_SUITE_RECOVERY=false(default on, fail-safe to disabled on malformed values); honored at ingress and re-validated fail-closed at processing so already-queued rows stop synthesizing too.schemabot.webhook.check_suite_recovery_total(covered / synthesized / resynthesized / already_queued / no_open_pr).