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

Multiple reviews from same user collide #38

Closed
Bullrich opened this issue Aug 3, 2023 · 0 comments · Fixed by #39
Closed

Multiple reviews from same user collide #38

Bullrich opened this issue Aug 3, 2023 · 0 comments · Fixed by #39
Assignees
Labels
bug Something isn't working

Comments

@Bullrich
Copy link
Contributor

Bullrich commented Aug 3, 2023

If a user approves a PR, and then they request changes, both reviews stay in the PR:

[
  {
    "user": {
      "login": "mutantcornholio"
    },
    "body": "testing testing",
    "state": "APPROVED",
    "submitted_at": "2023-08-03T11:14:31Z",
    "commit_id": "5a32a0dd76a7527b383b47161a26524017429f1c"
  },
  {
    "user": {
      "login": "mutantcornholio"
    },
    "body": "testing again",
    "state": "CHANGES_REQUESTED",
    "submitted_at": "2023-08-03T11:16:21Z",
    "commit_id": "5a32a0dd76a7527b383b47161a26524017429f1c"
  }
]

We are currently checking if the user approved the PR, and this is not taking into consideration if the user then removed their review.

We can solve this by only using the latest review of the user.

@Bullrich Bullrich added the bug Something isn't working label Aug 3, 2023
@Bullrich Bullrich added this to the Project launch milestone Aug 3, 2023
@Bullrich Bullrich self-assigned this Aug 3, 2023
Bullrich added a commit that referenced this issue Aug 3, 2023
The system currently searches for approved reviews, but if a user
approves a review, and then they reject the review, only the approval
review takes this change into consideration.

This solves that problem and fixes #38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant