Skip to content

Commit bede04e

Browse files
kartbenfabiobaltieri
authored andcommitted
update GraphQL query to include statusCheckRollup
No need to get the statusCheckRollup from the latest commit, just get it from the PR itself. Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
1 parent 1f8b615 commit bede04e

2 files changed

Lines changed: 7 additions & 14 deletions

File tree

crunch_data.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,10 @@ def main(argv):
9797
pr.needs_rebase = pr_data["mergeable"] == "CONFLICTING"
9898
pr.unknown_mergeable_status = pr_data["mergeable"] == "UNKNOWN"
9999

100-
commits_nodes = pr_data["commits"]["nodes"]
101-
if commits_nodes:
102-
status_check = commits_nodes[0]["commit"]["statusCheckRollup"]
103-
pr.ci_passes = status_check and status_check.get("state") == "SUCCESS"
104-
pr.ci_pending = status_check and status_check.get("state") == "PENDING"
100+
status_check = pr_data.get("statusCheckRollup")
101+
if status_check:
102+
pr.ci_passes = status_check.get("state") == "SUCCESS"
103+
pr.ci_pending = status_check.get("state") == "PENDING"
105104

106105
# Check for "Trivial" label
107106
labels = pr_data.get("labels", {}).get("nodes", [])

update_pr.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ def parse_args(argv):
9393
createdAt
9494
updatedAt
9595
mergeable
96+
statusCheckRollup {
97+
state
98+
}
9699
author {
97100
login
98101
}
@@ -162,15 +165,6 @@ def parse_args(argv):
162165
endCursor
163166
}
164167
}
165-
commits(last: 1) {
166-
nodes {
167-
commit {
168-
statusCheckRollup {
169-
state
170-
}
171-
}
172-
}
173-
}
174168
labels(first: 20) {
175169
nodes {
176170
name

0 commit comments

Comments
 (0)