Description of "Allow requestors to approve their own changes" is confusing - azure

The description on this page https://learn.microsoft.com/en-us/azure/devops/repos/git/branch-policies?view=azure-devops#require-a-minimum-number-of-reviewers says:
If Allow requestors to approve their own changes is selected, the creator of the pull request may vote on its approval. If not, they can still vote Approve on their pull request, but their vote won't count toward the Minimum number of reviewers.
This means it is assumed that the person that did changes on the source branch is at the same time the creator of the pull request. In our case often a different person than the developer is creating the pull request. Is this setting then only related to the creator of the pull request (and not caring about the commit pusher) or the person that pushed commits to be reviewed within the pull request?
If it is only about the creator of the pull request then the name of this setting should be changed since it has nothing to do with the actual changes (=commits) on source branch of the pull request.
Did I misunderstand something here?
Thank you

You are making a good point, Azure DevOps is implying here that the person who worked on a branch is also the initiator of the PR. This is not something that is 100% guaranteed, because it can happen that I created a dev branch, worked on code, made several commits, then my teammate creates a PR from my branch.
(The "most recent pusher" setting is probably closer to what you are looking for, which controls based on who pushed the latest commit from a local repository.)

Related

Enabling pre-receive server hook to get PR/MR approval before pushing to dev branch

Use case: I have code on my local machine and If I try to push it to remote server, a pre-receive hook in remote [GitLab] server should get triggered and ask for respective author approval to merge that code onto Gitlab repo.
After [code review] if author approves MR then code from my local repo will be pushed to remote server else push needs to be halted.
I am sure that I was asked to enable pre-receive hook on GitLab server side and not on client side.
I think it is not possible because code exists in developer's local machine and hence approver may not be able to do code review but not sure about pre-receive working.
Can pre-receive hook able to notify approver before code push? If it is possible need to know how?
If not, I want a strong valid point to negotiate😒
MR approval is not requested when one pushed a branch, but only when one makes (once the branch is pushed) a merge request to the target branch.
In your case:
protect the dev branch (nobody can push directly to it, so no need for a pre-receive hook)
make a merge request mandatory for that branch
make sure to configure your merge requests so that they must be approved before they can be merged.
That means any code eventually merged to dev:
will not have been pushed directly to dev (MR required)
will have been reviewed and approved first, before being accepted and merged to dev.
While it is true enforcing the MR approval process, meaning disabling the "Merge" button as long as approval is not met, is not free (premium only), you still have a way to enforce it.
Make sure nobody can push/merge to dev is a "Merge Manager" who is alone responsible to merge or not the MRs. If said merge manager sees there is no approval, they won't merge the MR.

Any way to set autocomplete for all future Pull request to a particular Branch say master

Is there a way for all future pull requests to be auto-completed once all branch policies have successfully passed? Can we set this on a branch level (e.g. all PR's targeting master), instead of doing this manually for every new PR?
Any way to set autocomplete for all future Pull request to a particular Branch say master
I am afraid there is no such a way to set autocomplete for all future Pull request to a particular Branch at this moment.
Many community members have submit the same request in our main suggestion forum:
Option to allow Auto-Complete to be the default option on new pull-requests
You could vote and add your comments for this feedback.

Can I tell who approved merge requests?

I have GitLab Starter which seems to mean that I am unable to restrict code approvers on a directory basis as everyone needs developer level access.
This is causing slight headaches.
Is there a way in GitLab that I can review who approved groups of merge requests? This way I can at least check after the fact that no one has approved code who should not have.
Is there a way to query the backend database or a way of gaining this information in some GUI screen somewhere?
There will be a way, with the upcoming GitLab 13.5 to clearly see the status of the approval process and who has approved a MR.
In the meantime, you still have the GitLab Merge Request approval API and the merge request API, with a call like GET /merge_requests does include paramters like approver_ids
Returns merge requests which have specified all the users with the given ids as individual approvers.
None returns merge requests without approvers.
Any returns merge requests with an approver.
That could help checking who has approved a MR.
Users on GitLab Starter, Bronze, or higher will also see the approvals_before_merge parameter.

Notify all participants about merge request

Is there a way to notify all gitlab project participants about new merge request, so they can review changes and vote? At the moment only a responsible person is notified and this is IMHO not very well team-oriented.
If this isn't supported, that would be a feature request to add to the "feedback.gitlab.com" page.
But consider also "Notify only requester and not whole team on comment in merge request":
the whole team is notified via email when someone comments on a merge request.
Please add the functionality to just notify the one who created the merge request to be notified
This is done since 5.3, which means a comment on a change request should notify a group, and not just the owner.

Need github repo commit list without based upon user

Im trying to get the commit list from GitHub repo using its API.
I am getting the commit list but its based upon particular user.
I need the list based upon the commit happened.
Below is the url I am using:
https://api.github.com/repos/user_name_here/repo_name_here/commits?access_token=XXXXXXXXXXX&per_page=5
It seems that the commits returns by the API will list all the commits from a particular repo, for all authors (ie not based on a user).
See for instance the commits of GitLabhq repo:
https://api.github.com/repos/gitlabhq/gitlabhq/commits
You will get all commits, without restriction. You will get both the original author and committer name as well.

Resources