From abe948bf0756109ffcbd7e405ecb7cd7adfa8e99 Mon Sep 17 00:00:00 2001 From: Ivan Razumov Date: Mon, 16 Dec 2024 12:25:02 +0100 Subject: [PATCH] Draft PRs should not be fully-signed, add a special label for that --- githublabels.py | 1 + process_pr.py | 23 +++++++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/githublabels.py b/githublabels.py index 0eff75cf32a..a9447a5142e 100644 --- a/githublabels.py +++ b/githublabels.py @@ -63,6 +63,7 @@ def get_dpg_pog(): "hold": LABEL_COLORS["hold"], "compilation-warnings": LABEL_COLORS["hold"], "requires-external": LABEL_COLORS["info"], + "fully-signed-draft": LABEL_COLORS["hold"], } for lab in TYPE_COMMANDS: diff --git a/process_pr.py b/process_pr.py index 524f657c1c5..c8109d27eca 100644 --- a/process_pr.py +++ b/process_pr.py @@ -2189,7 +2189,10 @@ def process_pr(repo_config, gh, repo, issue, dryRun, cmsbuild_user=None, force=F if missingApprovals: labels.append("pending-signatures") elif not "pending-assignment" in labels: - labels.append("fully-signed") + if not is_draft_pr: + labels.append("fully-signed") + else: + labels.append("fully-signed-draft") if need_external: labels.append("requires-external") labels = set(labels) @@ -2360,11 +2363,19 @@ def process_pr(repo_config, gh, repo, issue, dryRun, cmsbuild_user=None, force=F managers=releaseManagersList, ) elif ("orp" in signatures) and (signatures["orp"] != "approved"): - autoMergeMsg = format( - "This pull request will now be reviewed by the release team" - " before it's merged. %(managers)s (and backports should be raised in the release meeting by the corresponding L2)", - managers=releaseManagersList, - ) + if not is_draft_pr: + autoMergeMsg = format( + "This pull request will now be reviewed by the release team" + " before it's merged. %(managers)s (and backports should be raised in the release meeting by the corresponding L2)", + managers=releaseManagersList, + ) + else: + if not "fully-signed-draft" in old_labels: + messageFullySignedDraft = f"@{pr.user.login} if this PR is ready to be reviewed by the release team, please remove the \"Draft\" status." + if not dryRun: + issue.create_comment(messageFullySignedDraft) + else: + print("DRY-RUN: not posting comment", messageFullySignedDraft) devReleaseRelVal = "" if (pr.base.ref in RELEASE_BRANCH_PRODUCTION) and (pr.base.ref != "master"):