From f72512bc38291965250cefec326fef7e93d0b9a3 Mon Sep 17 00:00:00 2001 From: ualtinok <94532+ualtinok@users.noreply.github.com> Date: Mon, 26 Oct 2026 21:11:23 +0100 Subject: [PATCH] merge-pr: go ahead without Greptile when it created no review for the head Greptile stopped creating reviews on cortexkit/aft (last one 06:44Z on 2026-10-26), and merge-pr refused every PR after a 20-minute wait, so nothing merged. Ufuk approved merging without Greptile while it is down. A review that exists is still waited for and a failed one still refuses; only a head Greptile never touched goes ahead, after 180 s (AFT_MERGE_PR_GREPTILE_ABSENT_GRACE_SECONDS, 0 restores the old rule). Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com> --- .../land-merge-without-absent-greptile.json | 8 ++++++++ scripts/merge-pr.sh | 12 +++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 benchmarks/aft-search/slice-descriptors/land-merge-without-absent-greptile.json diff --git a/benchmarks/aft-search/slice-descriptors/land-merge-without-absent-greptile.json b/benchmarks/aft-search/slice-descriptors/land-merge-without-absent-greptile.json new file mode 100644 index 0000000000..27e9e44660 --- /dev/null +++ b/benchmarks/aft-search/slice-descriptors/land-merge-without-absent-greptile.json @@ -0,0 +1,8 @@ +{ + "fixtures": [ + "harness-goldens" + ], + "kind": "harness", + "slice_class": "non_ranking", + "targeted_mechanism": "none" +} diff --git a/scripts/merge-pr.sh b/scripts/merge-pr.sh index f810b370b8..6a0bc67f79 100755 --- a/scripts/merge-pr.sh +++ b/scripts/merge-pr.sh @@ -87,9 +87,15 @@ disarm_auto_merge() { } wait_for_greptile_review() { - local head_sha="$1" timeout poll started now review_status review_conclusion review_result + local head_sha="$1" timeout poll absent_grace started now review_status review_conclusion review_result timeout="${AFT_MERGE_PR_GREPTILE_TIMEOUT_SECONDS:-1200}" poll="${AFT_MERGE_PR_GREPTILE_POLL_SECONDS:-15}" + # Greptile creates its check run (queued) within seconds of a push. When it + # has created nothing for a head after this long, it is not reviewing this + # repository (an outage or a spent allowance), and the PR goes ahead without + # it. A review that exists is still waited for, and a failed one still + # refuses. Set it to 0 to require a Greptile review again. + absent_grace="${AFT_MERGE_PR_GREPTILE_ABSENT_GRACE_SECONDS:-180}" started=$(date -u +%s) while :; do review_result=$("$OPERATOR_GH" api "repos/$OWNER_REPO/commits/$head_sha/check-runs?per_page=100" \ @@ -108,6 +114,10 @@ wait_for_greptile_review() { esac fi now=$(date -u +%s) + if [[ -z "$review_status" ]] && (( absent_grace > 0 && now - started >= absent_grace )); then + echo "merge-pr: WARNING: Greptile created no review for head $head_sha within ${absent_grace}s; submitting without it" >&2 + return 0 + fi if (( now - started >= timeout )); then hard_refuse "Greptile Review did not complete for head $head_sha within ${timeout}s; refusing blind submission" fi