2

We have have programmers on our team that make changes after the Code Reviewers approved.

Is there a way in Github, everytime a new file/edit is committed, Github would Automatically reset and ask Code Reviewers to reapprove?

Currently programmers are adding new changes without approval, and this may affect the QA and Production system later.

enter image description here

6
  • Of course one immediately thinks of the obvious human engineering solution: fire those programmers. :)
    – matt
    Sep 17, 2021 at 18:48
  • haha @matt yeah, I know Microsoft Azure Devops with Git allows the option "reset code approvals with changes" in configuration settings, I am trying to find something similar in GitHub
    – mattsmith5
    Sep 17, 2021 at 18:49
  • 1
    Of note, in our repos in Azure DevOps, we considered and decided to purposefully leave the setting to reset approvals off, because it renders useless the popular "Approve with suggestions". If I approve but ask the developer to tweak something, I don't want to become a bottleneck again when that minor tweak is done. 99% of the time we are happy with leaving it off. Every once in a while somebody accidentally adds a mistake after approvals that probably would have been caught if votes were reset. But so far it's been rare enough that empowering the developer has been worth that small risk.
    – TTT
    Sep 17, 2021 at 19:07
  • 1
    hi @TTT I agree, actually we had it reset approvals, and still allow approve without suggestions, makes sense, currently we have lot of bugs, so senior developers are trying to stricten our Github policy for a while, and I know matt was joking :)
    – mattsmith5
    Sep 17, 2021 at 19:24
  • 2
    This might be a dup of this question. @mattsmith5 can you confirm?
    – TTT
    Sep 17, 2021 at 19:36

1 Answer 1

4

GitHub has an option for this in the branch protection settings, which is “Dismiss stale pull request approvals when new commits are pushed.” That controls whether the approvals are removed, and while it doesn't specifically re-request approvals from the reviewers, they will receive the normal notifications that changes have been pushed, and they can choose to re-review when it's convenient. Of course, the submitter can always click on the button to explicitly request a re-review.

Note that, as mentioned in the comments, there are various reasons to allow this practice, since sometimes there are minor improvements that could be made, but the status quo would be acceptable nevertheless. However, in some environments, this cannot be allowed for compliance or policy reasons, so this option exists for those cases.

Not the answer you're looking for? Browse other questions tagged or ask your own question.