Azure / Azure/azure-rest-api-specs

[BUG] Get Commits Batch git history is not traversed completely (followup)

Open
#37,530 0 comments 0 reactions 0 assignees View on GitHub
bug customer-reported question
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 2h
Merged PRs (30d)
424

Description

### API Spec link

https://learn.microsoft.com/en-us/rest/api/azure/devops/git/commits/get-commits-batch?view=azure-devops-rest-7.2&tabs=HTTP

### API Spec version

7.1

### Describe the bug

follow up of issue #37529
let there be the same two commits in the same relationship to each other as in #37529
however let there be the order of the commits be switched in the request (compareVersion and itemVersion switched)
this also does not traverse the git history fully (not even by the same amount)

### Expected behavior

git history is fully traversed until the revisions are found or the max number of revisions to report is reached

### Actual behavior

```
$ curl -H "authorization: bearer $token" -H "content-type: application/json" -X POST "https://dev.azure.com/Clarios/SW_Euler/_apis/git/repositories/Euler/commitsbatch?api-version=7.1" --data '{"compareVersion":{"version":"65a7bc018019d195f14542ce6b36c32f0ccad79c", "versionOptions":"none", "versionType":"commit"}, "itemV
ersion" : {"version":"d926c886eaa6bc5e765840f77c8cbfbd82db1910", "versionOptions":"none", "versionType":"commit"}, "$top
": 50000}' | jq > response.json && head response.json && tail response.json
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 147k 100 147k 100 258 107k 187 0:00:01 0:00:01 --:--:-- 107k
{
"count": 230,
"value": [
{
"commitId": "65a7bc018019d195f14542ce6b36c32f0ccad79c",
"author": {

},
"changeCounts": {
"Add": 4,
"Edit": 0,
"Delete": 0
},
"url": "https://dev.azure.com/Clarios/82560627-1b33-4b56-b301-b6adb46c6b51/_apis/git/repositories/4f4f6996-6aaa-4a7c-b9db-9949301a922e/commits/7a4fa605a9d6e88206e18df75b20fc17c046ff29",
"remoteUrl": "https://dev.azure.com/Clarios/SW_Euler/_git/Euler/commit/7a4fa605a9d6e88206e18df75b20fc17c046ff29"
}
]
}
```

### Reproduction Steps

can be taken from actual behavior snippet

### Environment

_No response_

Contributor guide

Open the contributing guide

Research direction

Use the API Spec link and issue #37529 as the starting references. Reproduce the POST request with compareVersion and itemVersion switched, then compare the returned count and commit range with the expected traversal. Done means the reported history is traversed fully until the revisions are found or $top is reached.

Written by the indexing model from the issue text.

Assessment

Tech stack
git
Domain
api
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.