Skip to content

Commit

Permalink
Draft PRs should not be fully-signed, add a special label for that
Browse files Browse the repository at this point in the history
  • Loading branch information
iarspider committed Dec 16, 2024
1 parent 809bdfb commit abe948b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions githublabels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
23 changes: 17 additions & 6 deletions process_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"):
Expand Down

0 comments on commit abe948b

Please sign in to comment.