Skip to content

Commit 93aaf9b

Browse files
authored
Fix: ignore lack of commit status for issues (#2476)
1 parent 50d9172 commit 93aaf9b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: process_pr.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -2026,7 +2026,7 @@ def process_pr(repo_config, gh, repo, issue, dryRun, cmsbuild_user=None, force=F
20262026
# if not extra_labels[ltype]:
20272027
# del extra_labels[ltype]
20282028

2029-
if bot_status is None and issue.state != "open":
2029+
if bot_status is None and issue.pull_request and issue.state != "open":
20302030
create_status = False
20312031

20322032
# Always set test pending label
@@ -2302,7 +2302,8 @@ def process_pr(repo_config, gh, repo, issue, dryRun, cmsbuild_user=None, force=F
23022302
if need_external:
23032303
labels.append("requires-external")
23042304

2305-
if (not bot_status) and issue.state != "open":
2305+
# Keep old tests state for closed PRs (workaround for missing commit statuses in old PRs)
2306+
if not create_status:
23062307
labels = [l for l in labels if not l.startswith("tests-")]
23072308
labels.extend(l for l in old_labels if l.startswith("tests-"))
23082309

@@ -2357,7 +2358,7 @@ def process_pr(repo_config, gh, repo, issue, dryRun, cmsbuild_user=None, force=F
23572358
add_labels = repo_config.ADD_LABELS
23582359
except:
23592360
pass
2360-
if add_labels and create_status:
2361+
if add_labels:
23612362
issue.edit(labels=list(labels))
23622363

23632364
if not issue.pull_request:

0 commit comments

Comments
 (0)