-
Notifications
You must be signed in to change notification settings - Fork 706
Bitbucket: start refactoring api versions #583
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
Conversation
| if not_json_response: | ||
| return response.content | ||
| if self.advanced_mode: | ||
| return response |
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.
Please pay attention!
In this place, the order of lines was messed and the 'else' block below ran in wrong cases
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.
Could you reverse that change, please?
Spacetown
left a comment
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.
This change was also my intension after #584 .
|
|
||
| def __init__(self, *args, **kwargs): | ||
| super(Bitbucket, self).__init__(*args, **kwargs) | ||
| url = kwargs.pop('url', False) |
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.
This block should be in front of the base init. See #584.
| url = 'rest/keys/1.0/projects/{key}/ssh'.format(key=key) | ||
| else: | ||
| url = 'rest/keys/2.0/projects/{key}/ssh'.format(key=key) | ||
| resource = self.resource_url('projects/{key}/ssh'.format(key=key)) |
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.
Here ressource_url MUST not be used, url is .../rest/keys/... and not .../rest/api/...
| else: | ||
| url = 'rest/keys/2.0/projects/{project_key}/repos/{repo_key}/ssh'.format(project_key=project_key, | ||
| repo_key=repo_key) | ||
| resource = self.resource_url('projects/{project_key}/repos/{repo_key}/ssh'.format(project_key=project_key, |
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.
Also .../rest/keys/... and not .../rest/api/...
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.
@Spacetown Any good idea around that?
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.
thx, I just missed this part!
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.
Create a member function ressource_url_keys which does mealy the same as the ressource_url. I'll create a PR for this.
Start removing messy api versions