I've got an Azure DevOps Git repository that sits in Azure DevOps in the cloud. We're using Pull Requests to manage code merging down to our release branch.
The feature branches have an automatic reviewer assigned that will have the sole purpose of adding an approval vote when the functional testing reaches successful completion in our continuous deployment environment. The idea is that this will provide a more robust check on automated merges down to our release branch.
I've got a partial Powershell API that hits the Azure DevOps REST API will get me a reference to the reviewer on the pull request, but I'm getting failures attempting to cast a vote or approval for the reviewer via the API.
The documentation suggests I need the reviewer Id to pass to the following URI
When I use the reviewer Id which I obtain from the pull request
https://dev.azure.com/$organization/$projectId/_apis/git/repositories/$repositoryId/pullrequests
reviewerUrl : https://dev.azure.com/my-organization/be283e5e-0466-41ef-aeb7-24264e12f6d6/_apis/git/repositories/3c4b0093-30fc-4652-a39e-08bb442b1879/pullRequests/2/reviewers/a72ce17b-22de-41a0-b6a5-49e5ba189826
vote : 10
isRequired : True
displayName : [email protected]
url : https://spsprodcca1.vssps.visualstudio.com/A41d8d933-620f-4153-952c-4ee19c0e4c0b/_apis/Identities/a72ce17b-22de-41a0-b6a5-49e5ba189826
_links : @{avatar=}
id : a72ce17b-22de-41a0-b6a5-49e5ba189826
uniqueName : [email protected]
imageUrl : https://dev.azure.com/my-organization/_api/_common/identityImage?id=a72ce17b-22de-41a0-b6a5-49e5ba189826
I get the following error
"Invalid argument value.\r\nParameter name: A valid reviewer ID must be supplied."
I'm not sure if I'm going about this the right way, but I would like my Octopus Deployment to initiate functional tests in our target environment and then upon successful test completion, the pull request approval be granted for the automated test reviewer via the REST API.
All the documentation I can find ultimately points me back to this document, but I can't for the life of me see how to apply the approval for my reviewer.