We have a requirement that every commit must be reviewed before being integrated into master (Git). In order to facilitate this we use feature branches, with Upsource branch review. In our CI we query Upsource API to verify that a branch review exists for the branch and that all reviewers has accepted the changes and that the review is closed. Otherwise the CI job will fail with an appropriate error.
This works very well for us, except for a scenario where a developer adds additional commits on top of the feature branch after the reviewer has accepted the branch and closed the review. In that case we still see that the branch review is accepted or closed.
My question is how can I use the API - or workflows - in order to verify that no additional commits have been added on top of a branch with an accepted and closed review? Of course we should still allow adding more commits on a feature branch, for example if the developer would like an intermediate review on a commit but has more commits to add to the feature branch. Just make them have these commits reviewed as well.
We use Upsource 3.5 (willing to upgrade to 2017.1 if it helps), Git and Jenkins.