-
Notifications
You must be signed in to change notification settings - Fork 243
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
Fixed: Made object id optional #1166
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest adding some UTs also, specially for negative cases
logger.error('ref not found') | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.error('ref not found') | |
return | |
raise CLIError("Failed to find object_id for ref " + name + ". Please provide object_id.") |
ref = client.get_refs(repository_id=repository, | ||
project=project, | ||
filter=name) | ||
if not ref: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not ref: | |
if not ref or len(ref) > 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to be sure we are not getting multiple id's from service because in that case we can't be sure which one to delete
Working on Adding more Unit test cases |
@roshan-sy : unit tests are present in https://github.com/Azure/azure-devops-cli-extension/blob/master/azure-devops/azext_devops/test/repos/test_ref.py btw: nice work adding E2E test cases, the reason we need unit test cases as well is that unit test cases are easier/ fast to run and can be used to validate small changes one unit test is already present for delete_ref azure-devops-cli-extension/azure-devops/azext_devops/test/repos/test_ref.py Lines 87 to 96 in 211d0c5
|
Got it, I'll add the UT as well, |
Please make sure the code is following contribution guidelines in CONTRIBUTING.md
Fixes: #1132
Made object id optional while deleting the refs (i.e. heads and tags)
Changes done: