From 7cccfed672cbc2a5bd7001f836d5e411bc70cd61 Mon Sep 17 00:00:00 2001 From: seonghobae <8172694+seonghobae@users.noreply.github.com> Date: Sun, 9 Aug 2026 10:35:46 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=A7=B9=20[=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EA=B1=B4=EA=B0=95=EB=8F=84=20=EA=B0=9C=EC=84=A0]=20perform=5Fr?= =?UTF-8?q?ebase=20=ED=95=A8=EC=88=98=20=EB=A6=AC=ED=8C=A9=ED=86=A0?= =?UTF-8?q?=EB=A7=81=20=EB=B0=8F=20stale=20=EB=9D=BC=EB=B2=A8=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0=20=EB=A1=9C=EC=A7=81=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/ci/pr_auto_rebase.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/scripts/ci/pr_auto_rebase.py b/scripts/ci/pr_auto_rebase.py index c0f04c3aa..e4fa9f35d 100755 --- a/scripts/ci/pr_auto_rebase.py +++ b/scripts/ci/pr_auto_rebase.py @@ -504,6 +504,18 @@ def label_conflicted_pr(repo: str, pr: dict[str, Any], base_ref: str, *, dry_run return tuple(notes) +def clear_stale_manual_rebase_label(repo: str, pr: dict[str, Any], *, dry_run: bool) -> tuple[str, ...]: + """Clear a stale manual-rebase label if present, returning audit notes.""" + # A candidate reaching this point that still carries the manual-rebase label + # is no longer dirty (labeled-and-dirty PRs are skipped upstream): its + # conflict was resolved by a later base change, so clear the stale label and + # let the rebase proceed instead of leaving it permanently blocked. + if has_manual_rebase_label(pr): + remove_manual_rebase_label(repo, int(pr["number"]), dry_run=dry_run) + return (f"removed stale {MANUAL_REBASE_LABEL} label (no longer dirty)",) + return () + + def perform_rebase(repo: str, pr: dict[str, Any], *, dry_run: bool) -> Decision: """Rebase one candidate PR, force-pushing on success or labeling on conflict.""" number = int(pr["number"]) @@ -511,14 +523,9 @@ def perform_rebase(repo: str, pr: dict[str, Any], *, dry_run: bool) -> Decision: base_ref = validate_git_ref(pr["baseRefName"]) expected_head_sha = validate_git_sha(pr["headRefOid"]) token = scheduler_token() - # A candidate reaching this point that still carries the manual-rebase label - # is no longer dirty (labeled-and-dirty PRs are skipped upstream): its - # conflict was resolved by a later base change, so clear the stale label and - # let the rebase proceed instead of leaving it permanently blocked. - stale_label_notes: tuple[str, ...] = () - if has_manual_rebase_label(pr): - remove_manual_rebase_label(repo, number, dry_run=dry_run) - stale_label_notes = (f"removed stale {MANUAL_REBASE_LABEL} label (no longer dirty)",) + + stale_label_notes = clear_stale_manual_rebase_label(repo, pr, dry_run=dry_run) + with tempfile.TemporaryDirectory(prefix="pr-auto-rebase-") as workdir: fetch_pr_refs(workdir, repo, head_ref, base_ref, token=token) if not try_rebase(workdir, base_ref): @@ -530,6 +537,7 @@ def perform_rebase(repo: str, pr: dict[str, Any], *, dry_run: bool) -> Decision: stale_label_notes + notes, ) push_force_with_lease(workdir, repo, head_ref, expected_head_sha, token=token) + return Decision( number, "rebased", From 6c673c9bde9ad48d5411c35fca984d08c8f0b809 Mon Sep 17 00:00:00 2001 From: seonghobae <8172694+seonghobae@users.noreply.github.com> Date: Sun, 9 Aug 2026 12:52:48 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=A7=B9=20[=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EA=B1=B4=EA=B0=95=EB=8F=84=20=EA=B0=9C=EC=84=A0]=20perform=5Fr?= =?UTF-8?q?ebase=20=ED=95=A8=EC=88=98=20=EB=A6=AC=ED=8C=A9=ED=86=A0?= =?UTF-8?q?=EB=A7=81=20=EB=B0=8F=20stale=20=EB=9D=BC=EB=B2=A8=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0=20=EB=A1=9C=EC=A7=81=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From 3af07ff185ad4708fe7964d7caaaacd810c53440 Mon Sep 17 00:00:00 2001 From: seonghobae <8172694+seonghobae@users.noreply.github.com> Date: Sun, 9 Aug 2026 15:16:07 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=A7=B9=20[=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EA=B1=B4=EA=B0=95=EB=8F=84=20=EA=B0=9C=EC=84=A0]=20perform=5Fr?= =?UTF-8?q?ebase=20=ED=95=A8=EC=88=98=20=EB=A6=AC=ED=8C=A9=ED=86=A0?= =?UTF-8?q?=EB=A7=81=20=EB=B0=8F=20stale=20=EB=9D=BC=EB=B2=A8=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0=20=EB=A1=9C=EC=A7=81=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit