Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] branches stats fails if there are no branches in the repo #29648

Open
b4rd opened this issue Jul 1, 2024 · 1 comment
Open

[BUG] branches stats fails if there are no branches in the repo #29648

b4rd opened this issue Jul 1, 2024 · 1 comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. DevOps Azure Devops Mgmt This issue is related to a management-plane library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@b4rd
Copy link

b4rd commented Jul 1, 2024

API Spec link

https://learn.microsoft.com/en-us/rest/api/azure/devops/git/stats/list?view=azure-devops-rest-7.1&tabs=HTTP

API Spec version

7.1-preview.1

Describe the bug

I have a git repository with no branches.
Calling {organization}/{project}/_apis/git/repositories/{repositoryId}/stats/branches returns with a 400 error.

Expected behavior

An empty list is returned. E.g.:

{
  "count": 0,
  "value": []
}

Actual behavior

An error is returned:

{
    "$id": "1",
    "innerException": null,
    "message": "VS403403: Cannot find any branches for the reposynctest repository.",
    "typeName": "System.ArgumentException, mscorlib",
    "typeKey": "ArgumentException",
    "errorCode": 0,
    "eventId": 0
}

Reproduction Steps

  • Create a repository.
  • Delete all branches.
  • Call the endpoint.

Environment

No response

@b4rd b4rd added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jul 1, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Jul 1, 2024
@v-jiaodi v-jiaodi added the Mgmt This issue is related to a management-plane library. label Jul 2, 2024
@v-jiaodi
Copy link
Member

v-jiaodi commented Jul 2, 2024

@anuragc617 Please help take a look, thanks.

@v-jiaodi v-jiaodi added Service Attention Workflow: This issue is responsible by Azure service team. DevOps Azure Devops labels Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. DevOps Azure Devops Mgmt This issue is related to a management-plane library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants