Skip to content

Commit 560efad

Browse files
committed
workflows: Release Workflow - Avoid selecting random reviewers when no phab review
If you pass a NULL reivew ID to the differential.revision.search API, it returns all revisions and we were just taking the first one and assuming it was associated with the commit in the PR. We need to exit early if we can't find a Phabricator review associated with a commit.
1 parent 577840b commit 560efad

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/utils/git/github-automation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ def phab_get_commit_approvers(phab_token:str, repo:github.Repository.Repository,
9999
# API documentation: https://reviews.llvm.org/conduit/method/differential.parsecommitmessage/
100100
r = phab_api_call(phab_token, "https://reviews.llvm.org/api/differential.parsecommitmessage", args)
101101
review_id = r['result']['revisionIDFieldInfo']['value']
102+
if not review_id:
103+
# No Phabricator revision for this commit
104+
return []
102105

103106
args = {
104107
'constraints[ids][0]' : review_id,

0 commit comments

Comments
 (0)