-
Notifications
You must be signed in to change notification settings - Fork 104
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
Correctly handle dismissed GitHub reviews #38
Conversation
Note that #37 needs to merge first, then I'll update this to reference |
5adda2d
to
64ffc33
Compare
When a review is dismissed, remove it from the review list as though it never happened. This should be equivalent to a user deleting an approval comment, although unlike in that case, we don't audit for this event. Because GitHub provides the ability to restrict review dismissal, this seems safe.
64ffc33
to
4fb5123
Compare
After further testing, this may not be the best solution. GitHub does change the state of the review in the timeline to If the timeline already includes the dismissed event at the time of the webhook, this should solve it, although it would be better to change the state of the old review rather than remove it. |
ReviewChangesRequested ReviewState = "changes_requested" | ||
ReviewCommented ReviewState = "commented" | ||
ReviewDismissed ReviewState = "dismissed" | ||
ReviewPending ReviewState = "pending" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asvoboda sorry I asked you to change code like this in another project; I was wrong and the type declaration only carries in the specific case of using iota
, i.e. you have to omit everything after the name for the type information of the first line to carry to the other lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries!
When a review is dismissed, remove it from the review list as though it
never happened. This should be equivalent to a user deleting an approval
comment, although unlike in that case, we don't audit for this event.
Because GitHub provides the ability to restrict review dismissal, this
seems safe.
Fixes #28.