Skip to content

Fix broken Bitbucket Cloud client #611

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

Merged
merged 7 commits into from
Oct 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
651 changes: 329 additions & 322 deletions atlassian/bitbucket.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion atlassian/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def log_curl_debug(self, method, url, data=None, headers=None, level=logging.DEB
url=url)
log.log(level=level, msg=message)

def resource_url(self, resource, api_root, api_version):
def resource_url(self, resource, api_root=None, api_version=None):
if api_root is None:
api_root = self.api_root
if api_version is None:
Expand Down
4 changes: 2 additions & 2 deletions examples/bitbucket/bitbucket-branch-restrictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
matcher_type="branch", # lowercase matcher type
matcher_value="master",
permission_type="no-deletes",
repository="repository_name",
repository_slug="repository_name",
except_users=["user1", "user2"]
)
print(single_permission)
Expand Down Expand Up @@ -74,7 +74,7 @@
matcher_type="branch",
matcher_value="master",
permission_type="no-deletes",
repository="repository_name",
repository_slug="repository_name",
except_users=["user1", "user2"]
)
print(multiple_permissions)
4 changes: 2 additions & 2 deletions examples/bitbucket/bitbucket-changes-between-branches.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
password='admin')

changelog = bitbucket.get_changelog(
project='DEMO',
repository='example-repository',
project_key='DEMO',
repository_slug='example-repository',
ref_from='develop',
ref_to='master')

Expand Down
2 changes: 1 addition & 1 deletion examples/bitbucket/bitbucket-clean-jira-branches.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def is_can_removed_branch(branch_candidate):
last_date_commit = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(committer_time_stamp))
if is_can_removed_branch(branch):
if not DRY_RUN:
stash.delete_branch(project=PROJECT_KEY, repository=repository, name=display_id,
stash.delete_branch(project_key=PROJECT_KEY, repository_slug=repository, name=display_id,
end_point=branch['latestCommit'])
log.write("{},{},{}\n".format(display_id, last_date_commit, True))
step += 1
Expand Down
6 changes: 3 additions & 3 deletions examples/bitbucket/bitbucket-fork-repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
password='admin')

data = bitbucket.fork_repository(
project='DEMO',
repository='example-repository',
new_repository='forked-repository')
project_key='DEMO',
repository_slug='example-repository',
new_repository_slug='forked-repository')

print(data)
8 changes: 4 additions & 4 deletions examples/bitbucket/bitbucket-tag-manipulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
password='admin')

if __name__ == '__main__':
response = bitbucket.set_tag(project='gonchik.tsymzhitov',
repository='gonchik',
response = bitbucket.set_tag(project_key='gonchik.tsymzhitov',
repository_slug='gonchik',
tag_name='test1',
commit_revision='ebcf5fdffa0',
description='Stable release')
print("Response after set_tag method")
print(response)

response = bitbucket.get_project_tags(project='INT', repository='jira-plugins', tag_name='test1')
response = bitbucket.get_project_tags(project_key='INT', repository_slug='jira-plugins', tag_name='test1')
print("Retrieve tag")
print(response)
print("Remove tag")
bitbucket.delete_tag(project='INT', repository='jira-plugins', tag_name='test1')
bitbucket.delete_tag(project_key='INT', repository_slug='jira-plugins', tag_name='test1')