Skip to content

Commit

Permalink
Merge pull request #2292 from cms-sw/process-pr-prioritize-close
Browse files Browse the repository at this point in the history
Allow closing/reopening a PR even if there are too many commits or changed files
  • Loading branch information
smuzaffar authored Jul 11, 2024
2 parents 7aaf274 + 3dae85f commit 6bcbc54
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions process_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,17 @@ def process_pr(repo_config, gh, repo, issue, dryRun, cmsbuild_user=None, force=F
set_comment_emoji_cache(dryRun, bot_cache, comment, repository)

# end of parsing comments section
# Check if it needs to be automatically closed.
if mustClose:
if issue.state == "open":
print("This pull request must be closed.")
if not dryRun:
issue.edit(state="closed")
elif reOpen:
if issue.state == "closed":
print("This pull request must be reopened.")
if not dryRun:
issue.edit(state="open")

if issue.pull_request:
if (
Expand Down Expand Up @@ -2205,18 +2216,6 @@ def process_pr(repo_config, gh, repo, issue, dryRun, cmsbuild_user=None, force=F
if add_labels:
issue.edit(labels=list(labels))

# Check if it needs to be automatically closed.
if mustClose:
if issue.state == "open":
print("This pull request must be closed.")
if not dryRunOrig:
issue.edit(state="closed")
elif reOpen:
if issue.state == "closed":
print("This pull request must be reopened.")
if not dryRunOrig:
issue.edit(state="open")

if not issue.pull_request:
issueMessage = None
if not already_seen:
Expand Down

0 comments on commit 6bcbc54

Please sign in to comment.