abcxyz / github-metrics-aggregator

Apache License 2.0
11 stars 3 forks source link

Improve handling of null reviewDecision #224

Closed lock14 closed 5 months ago

lock14 commented 5 months ago

After more research into when a null reviewDecision can occur, I determined we can be a bit smarter about how we assign the review status.

Whenever the reviewDecision is null it means the repository has not enabled the Require pull request reviews before merging branch protection feature. Soure: https://github.com/orgs/community/discussions/24375

In this scenario any 'approving' review is sufficient to determine if the code was approved. Therefore, whenever the reviewDecision field is null, we check if any reviews have the APPROVED state, and set the reviewDecision to APPROVED if so, otherwise we set it to the default status of UNKNOWN.