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] az repos ref create #1133

Closed
t3mi opened this issue Jun 3, 2021 · 2 comments · Fixed by #1171
Closed

[Bug] az repos ref create #1133

t3mi opened this issue Jun 3, 2021 · 2 comments · Fixed by #1171
Assignees
Labels
Area: ProToCol The bugs under ProToCol Team bug

Comments

@t3mi
Copy link

t3mi commented Jun 3, 2021

Describe the bug
az repos ref create should exit with non zero exit code when it could not complete the action instead of exiting with 0 and showing the error:

{
  "customMessage": "TF401027: You need the Git 'CreateBranch' permission to perform this action. Details: identity '<guid>\\email', scope 'repository'.",
  "isLocked": false,
  "name": "refs/heads/branch1",
  "newObjectId": "05abcd2cfc888fccc25b132bb777d84b84d169a8",
  "oldObjectId": "0000000000000000000000000000000000000000",
  "rejectedBy": null,
  "repositoryId": "<guid>",
  "success": false,
  "updateStatus": "createBranchPermissionRequired"
}

To Reproduce
Azure Cli Version:

azure-cli                         2.21.0 *

core                              2.21.0 *
telemetry                          1.0.6

Extensions:
azure-devops                      0.18.0

Steps to reproduce the behavior:

  1. Remove Create branch permission for the identity from the repository.
  2. Try to create a branch with that identity.

Expected behavior
az exits with non zero exit code.

@t3mi t3mi added Area: ProToCol The bugs under ProToCol Team bug labels Jun 3, 2021
@roshan-sy
Copy link
Contributor

  • Time taken to come up with proposal and timeline : 0.5 day

Proposal

We can check if failure reason is 'createBranchPermissionRequired' or 'createTagPermissionRequired'
We can change the status to success
1133

Expected timeline

implementation - 0.5 day - 16 Aug
unit test - 1 day - 17 Aug

@gauravsaralMs
Copy link
Contributor

gauravsaralMs commented Aug 16, 2021

@roshan-sy : thanks for the detailed proposal 😄

I will suggest to take dependency only on response.success

if response.success is false:
  raise new CLIException(response.message)

because I belive the ask from customer is to not return 0 (success) in case operation failed on ADO service side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: ProToCol The bugs under ProToCol Team bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants