You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe it's how Renovate checks the statuses and how Azure DevOps PR work when you have build policy set with build expiration.
In short, Azure DevOps in such configuration creates new temporary commit for the purpose of building PR's commit. Then that temporary commit is tagged with the build status while the original commit (latest commit on PR's branch) is left un-tagged.
From Azure DevOps API perspective:
GET https://dev.azure.com/{{organization}}/_apis/git/pullrequests/{{pullRequestId}}?api-version=4.1
returns object that contains:
`lastMergeSourceCommit.commitId` - it is the latest commit on PR's branch
`lastMergeCommit.commitId` - it is that temporary commit created for PR's build
If you then use the
GET https://dev.azure.com/{{organization}}/{{project}}/_apis/git/repositories/{{repositoryId}}/commits/{{commitId}}/statuses?latestOnly=true&api-version=4.1
with above commit IDs you can tell that only temporary commit contains the build status, while the latest commit on PR's branch has no build status at all.
First point of clarification: Renovate uses the AZDO SDK instead of API directly.
Renovate's getBranchStatus() implementation for AZDO is here:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Tell us more.
From a Mend.io customer who's using Renovate:
First point of clarification: Renovate uses the AZDO SDK instead of API directly.
Renovate's
getBranchStatus()
implementation for AZDO is here:renovate/lib/modules/platform/azure/index.ts
Lines 405 to 446 in a581f7b
It relies on this function:
renovate/lib/modules/platform/azure/index.ts
Lines 361 to 379 in a581f7b
Like with other platforms it:
Theoretically instead:
getPullRequest
: https://learn.microsoft.com/en-us/javascript/api/azure-devops-extension-api/gitrestclient#azure-devops-extension-api-gitrestclient-getstatusesProposal:
lastMergeCommit
or it's the same aslastMergeSourceCommit
then use that commit (should in theory be the same result as today)lastMergeCommit
exists then use it exclusively, or check both it andlastMergeSourceCommit
and combine results?Question:
Beta Was this translation helpful? Give feedback.
All reactions