The statuses API we are using _apis/git/repositories/{repo}/pullRequests/{id}/statuses doesn't return what we want (it will be empty). Instead, to get the statuses we need to look up the merge commit in the PR (lastMergeCommit), then look up the statuses by that: _apis/git/repositories/{repo}/commits/{mergeCommit}/statuses?latestOnly=true&api-version=5.0-preview.1
The caveat here is that this only returns the build statuses for the commit, not approval status. So we'll need to find a way to check that too, or determine that Maestro is unable to merge if a policy requiring a reviewer is present.
/cc @jcagme @alexperovich
I would like to get auto-merge for DARC PR's to work in https://dev.azure.com/dnceng/internal/_git/dotnet-wpf-int. Since this is now one of WPF's main repo's, not having auto-merge is creating a bunch of extra work.
@riarenas, @mmitche suggested that perhaps you'd be able to investigate and help with this.
/cc @dotnet/wpf-developers
I can start investigating in what the correct APIs to call are. We are currently doing a push to get better validation for Maestro scenarios, and I'll start working on getting this working afterwards.
@riarenas, has there been any progress on this?
@vatsan-madhavan Still working on our automated validation and testing. I will start looking into this one early next week.
That would mean that we will still be doing manual-merges when updates are coming in for Preview 5 (//build). I'm hoping that we can get this fix this week, so that when _//build_/preview 5 builds start being snapped next week, we don't have human-in-the loop delays.
Discussed with @mmitche and we reshuffled things a bit. I'll start taking a look at this one.
It looks like the Policy Evaluations API is what we want to be using for this.
This is checked in and awaiting rollout.
This is now fixed. https://dev.azure.com/dnceng/internal/_git/dotnet-wpf-int/pullrequest/996?_a=overview was auto merged
Thanks for getting this done - this is great!
/cc @mmitche