Find reviews associated with the head commit
(self)
| 315 | return self.raw["reviews"]["nodes"] |
| 316 | |
| 317 | def head_commit_reviews(self) -> list[Review]: |
| 318 | """ |
| 319 | Find reviews associated with the head commit |
| 320 | """ |
| 321 | commits_to_review_status: dict[str, list[Review]] = {} |
| 322 | |
| 323 | for review in self.reviews(): |
| 324 | if not review["authorCanPushToRepository"]: |
| 325 | # ignore reviews from non-committers |
| 326 | continue |
| 327 | |
| 328 | oid = review["commit"]["oid"] |
| 329 | if oid in commits_to_review_status: |
| 330 | commits_to_review_status[oid].append(review) |
| 331 | else: |
| 332 | commits_to_review_status[oid] = [review] |
| 333 | |
| 334 | # Only use the data for the head commit of the PR |
| 335 | head_reviews = commits_to_review_status.get(self.head_oid(), []) |
| 336 | return head_reviews |
| 337 | |
| 338 | def fetch_data(self): |
| 339 | """ |
no test coverage detected