Skip to content

Fix errors of black #1093

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 4 commits into from
Dec 3, 2022
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
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Apache License
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2014 Mateusz Harasymczuk
Copyright 2014 Mateusz Harasymczuk, Gonchik Tsymzhitov

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
75 changes: 51 additions & 24 deletions atlassian/bamboo.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,15 @@ def _get_generator(
yield response

def base_list_call(
self, resource, expand, favourite, clover_enabled, max_results, label=None, start_index=0, **kwargs
self,
resource,
expand,
favourite,
clover_enabled,
max_results,
label=None,
start_index=0,
**kwargs,
):
flags = []
params = {"max-results": max_results}
Expand All @@ -89,7 +97,13 @@ def base_list_call(

""" Projects & Plans """

def projects(self, expand=None, favourite=False, clover_enabled=False, max_results=25):
def projects(
self,
expand=None,
favourite=False,
clover_enabled=False,
max_results=25,
):
return self.base_list_call(
"project",
expand=expand,
Expand Down Expand Up @@ -369,7 +383,7 @@ def results(
elements_key="results",
element_key="result",
label=label,
**params
**params,
)

def latest_results(
Expand Down Expand Up @@ -483,7 +497,14 @@ def plan_results(
include_all_states=include_all_states,
)

def build_result(self, build_key, expand=None, include_all_states=False, start=0, max_results=25):
def build_result(
self,
build_key,
expand=None,
include_all_states=False,
start=0,
max_results=25,
):
"""
Returns details of a specific build result
:param expand: expands build result details on request. Possible values are: artifacts, comments, labels,
Expand Down Expand Up @@ -545,7 +566,14 @@ def delete_build_result(self, build_key):
params = {"buildKey": plan_key, "buildNumber": build_number}
return self.post(custom_resource, params=params, headers=self.form_token_headers)

def execute_build(self, plan_key, stage=None, execute_all_stages=True, custom_revision=None, **bamboo_variables):
def execute_build(
self,
plan_key,
stage=None,
execute_all_stages=True,
custom_revision=None,
**bamboo_variables,
):
"""
Fire build execution for specified plan.
!IMPORTANT! NOTE: for some reason, this method always execute all stages
Expand Down Expand Up @@ -581,7 +609,14 @@ def stop_build(self, plan_key):

""" Comments & Labels """

def comments(self, project_key, plan_key, build_number, start_index=0, max_results=25):
def comments(
self,
project_key,
plan_key,
build_number,
start_index=0,
max_results=25,
):
resource = "result/{}-{}-{}/comment".format(project_key, plan_key, build_number)
params = {"start-index": start_index, "max-results": max_results}
return self.get(self.resource_url(resource), params=params)
Expand All @@ -594,7 +629,14 @@ def create_comment(self, project_key, plan_key, build_number, comment, author=No
}
return self.post(self.resource_url(resource), data=comment_data)

def labels(self, project_key, plan_key, build_number, start_index=0, max_results=25):
def labels(
self,
project_key,
plan_key,
build_number,
start_index=0,
max_results=25,
):
resource = "result/{}-{}-{}/label".format(project_key, plan_key, build_number)
params = {"start-index": start_index, "max-results": max_results}
return self.get(self.resource_url(resource), params=params)
Expand Down Expand Up @@ -1018,7 +1060,8 @@ def agent_capabilities(self, agent_id, include_shared=True):
:return: agents
"""
return self.get(
self.resource_url("agent/{}/capability".format(agent_id)), params={"includeShared": include_shared}
self.resource_url("agent/{}/capability".format(agent_id)),
params={"includeShared": include_shared},
)

def activity(self):
Expand Down Expand Up @@ -1100,22 +1143,6 @@ def health_check(self):
response = self.get("rest/supportHealthCheck/1.0/check/")
return response

def upload_plugin(self, plugin_path):
"""
Provide plugin path for upload into Jira e.g. useful for auto deploy
:param plugin_path:
:return:
"""
files = {"plugin": open(plugin_path, "rb")}
upm_token = self.request(
method="GET",
path="rest/plugins/1.0/",
headers=self.no_check_headers,
trailing=True,
).headers["upm-token"]
url = "rest/plugins/1.0/?token={upm_token}".format(upm_token=upm_token)
return self.post(url, files=files, headers=self.no_check_headers)

def get_elastic_instance_logs(self, instance_id):
"""
Get logs from an EC2 instance
Expand Down
Loading