A REST call to get pull requests does not return the UUID in the info for each pull request.
A UUID for the PR is needed to programmatically modify pull request reviews, as shown here:
import requests
import json
url = "http://0.0.0.0:8080/api/plugins/dolt/pull_requests_reviews/"
state = 0 # 0 = comment, 1 = approved, 2 = blocked
# Problems to solve:
# - getting the pull request UUID
payload = json.dumps({
"pull_request": "92eb3092-361d-4356-bf1c-934a336bcb62", # <--- we need pull_request UUID to add a PR review/comment
"reviewer": "71cbe632-c69a-40a5-9c0f-e75fba2bdf53",
"state": 0,
"summary": "this is from a python script again"
})
headers = {
'Authorization': 'Token nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
If the UUID for each PR is not available when querying for PRs, users will be unable to programmatically query for a given pull request and modify specific pull request reviews because pull requests are referenced by UUID, as shown in the code above.
A REST call to get pull requests does not return the UUID in the info for each pull request.
A UUID for the PR is needed to programmatically modify pull request reviews, as shown here:
If the UUID for each PR is not available when querying for PRs, users will be unable to programmatically query for a given pull request and modify specific pull request reviews because pull requests are referenced by UUID, as shown in the code above.