Azure / Azure/azure-devops-cli-extension
Correctly return project information created when executing az devops project create command
- Dominant language
- Python
- Stars
- 682
- Forks
- 278
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 3
Description
The expected behavior of the az devops project create command is to return project information.
However, the az devops project create command sporadically returns a VS800075 error. Even when VS800075 is returned, the project is created normally.
_VS800075: The project with id 'vstfs:///Classification/TeamProject/' does not exist, or you do not have permission to access it._
We believe this is because the REST API for project creation running inside the az devops project create command immediately returns a Status code 202.
https://github.com/Azure/azure-devops-cli-extension/blob/7fc9bfc19c61876ebf7e12eb23f55b38d2bdc78e/azure-devops/azext_devops/dev/team/project.py#L75
When status code 202 is returned, project creation is in progress, and if you try to get project information in this state, status code 404 error will be returned, and then VS800075 will occur.
https://github.com/Azure/azure-devops-cli-extension/blob/7fc9bfc19c61876ebf7e12eb23f55b38d2bdc78e/azure-devops/azext_devops/dev/team/project.py#L83
[Debug logs]
```logs
azext_devops.devops_sdk.client: POST https://dev.azure.com//_apis/projects
urllib3.connectionpool: https://dev.azure.com:443 "POST //_apis/projects HTTP/1.1" 202 171
// VS800075 occurs.
urllib3.connectionpool: https://dev.azure.com:443 "GET //_apis/projects/?includeCapabilities=true HTTP/1.1" 404 397
// VS800075 does not occur. (Expected behavior)
urllib3.connectionpool: https://dev.azure.com:443 "GET //_apis/projects/?includeCapabilities=true HTTP/1.1" 200 728
```
Contributor guide
Assessment
This issue has not been assessed yet.