Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle the "review approved" GitHub trigger even without a previous "needs-review" #27

Open
danuker opened this issue Dec 20, 2021 · 3 comments
Assignees

Comments

@danuker
Copy link
Contributor

danuker commented Dec 20, 2021

When all reviewers have given a PR a positive review, trigger the "needs-merge" command and add the "needs-merge" label, even if no review was requested (was never in "needs-review").

Originally posted by @adiroiban in #18 (comment)

@danuker danuker changed the title Handle the "review approved" GitHub trigger Handle the "review approved" GitHub trigger even without a previous "needs-review" Dec 20, 2021
@danuker
Copy link
Contributor Author

danuker commented Dec 20, 2021

In _setApproveChanges, the source of the current_reviewers should be the ticket body; the bug resulted from using the assignees as "people from which a review is still awaited".

Thus, we should query the review-comments of a PR and see who is pending, out of the required reviewers (in the PR text with "reviewers: ").

Details here.

We could still use assignees to track the pending reviewers, but only if we make sure that the needs-review hook is triggered at least once.

Another idea is to use the "Reviewers" feature of a PR to track reviewers, but then we'd have no independent list for them.

@danuker danuker self-assigned this Dec 20, 2021
@danuker
Copy link
Contributor Author

danuker commented Feb 17, 2022

Another time this bug bit us: after Adi set a ticket to "needs-changes", Cristina got assigned.

Then Adi said "changes-approved", but _setApproveChanges thought Cristina still had to review it, because she was assigned.

Again, the source of the current_reviewers should be the ticket body @reviewers statement, not the assignees.

@danuker danuker pinned this issue Feb 17, 2022
@danuker
Copy link
Contributor Author

danuker commented Apr 4, 2022

Another time this bit us:

  • I asked for a change
  • then the change was no longer needed
  • I gave an approval review, but Adi was assigned, so the system thought Adi is still supposed to review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant