Skip to content

Commit 8b90689

Browse files
committed
Polish docs and add tests into package
1 parent 41bf268 commit 8b90689

File tree

20 files changed

+120
-109
lines changed

20 files changed

+120
-109
lines changed

.github/bump_version

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
if [[ ( -z ${1+x} ) || ( -z ${2+x} ) ]]; then
44
cat << EOF
5-
usage: $(basename ${0}) repo increment
5+
usage: $(basename "${0}") repo increment
66
77
Quick and dirty version bump script
88
If a variable "BUILD_VERSION" is set, returns that variable as is
@@ -30,7 +30,7 @@ function autoversion(){
3030
BUILD_NUMBER="0" # In the developer machine, this will build x.y.z.dev0
3131
fi
3232

33-
cd ${REPO_PATH} || exit 1
33+
cd "${REPO_PATH}" || exit 1
3434

3535
git fetch --tags 2>/dev/null
3636
last_tag=$(git tag | sort -Vr | head -1)

atlassian/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.40.0
1+
3.40.1

atlassian/bamboo.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ def project(self, project_key, expand=None, favourite=False, clover_enabled=Fals
127127

128128
def project_plans(self, project_key, start_index=0, max_results=25):
129129
"""
130-
Returns a generator with the plans in a given project
131-
:param project_key: Project key
130+
Returns a generator with the plans in a given project.
131+
:param project_key: project key
132132
:param start_index:
133133
:param max_results:
134134
:return: Generator with plans
@@ -295,7 +295,7 @@ def create_branch(
295295
:param branch_name: str new-shiny-branch
296296
:param vcs_branch: str feature/new-shiny-branch, /refs/heads/new-shiny-branch
297297
:param enabled: bool
298-
:param cleanup_enabled: bool
298+
:param cleanup_enabled: bool - enable/disable automatic cleanup of branch
299299
:return: PUT request
300300
"""
301301
resource = "plan/{plan_key}/branch/{branch_name}".format(plan_key=plan_key, branch_name=branch_name)
@@ -398,7 +398,7 @@ def latest_results(
398398
include_all_states=False,
399399
):
400400
"""
401-
Get latest Results
401+
Get the latest Results
402402
:param expand:
403403
:param favourite:
404404
:param clover_enabled:
@@ -433,7 +433,7 @@ def project_latest_results(
433433
include_all_states=False,
434434
):
435435
"""
436-
Get latest Project Results
436+
Get the latest Project Results
437437
:param project_key:
438438
:param expand:
439439
:param favourite:
@@ -533,7 +533,7 @@ def build_result(
533533

534534
def build_latest_result(self, plan_key, expand=None, include_all_states=False):
535535
"""
536-
Returns details of a latest build result
536+
Returns details of the latest build result
537537
:param expand: expands build result details on request. Possible values are: artifacts, comments, labels,
538538
Jira Issues, stages. stages expand is available only for top level plans. It allows to drill down to job results
539539
using stages.stage.results.result. All expand parameters should contain results. Result prefix.

atlassian/bitbucket/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _get_paged(
5050
Used to get the paged data
5151
5252
:param url: string: The url to retrieve
53-
:param params: dict (default is None): The parameters
53+
:param params: dict (default is None): The parameter's
5454
:param data: dict (default is None): The data
5555
:param flags: string[] (default is None): The flags
5656
:param trailing: bool (default is None): If True, a trailing slash is added to the url

atlassian/bitbucket/cloud/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _get_paged(
5151
Used to get the paged data
5252
5353
:param url: string: The url to retrieve
54-
:param params: dict (default is None): The parameters
54+
:param params: dict (default is None): The parameter's
5555
:param data: dict (default is None): The data
5656
:param flags: string[] (default is None): The flags
5757
:param trailing: bool (default is None): If True, a trailing slash is added to the url

atlassian/bitbucket/cloud/repositories/commits.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def get_build(self, key):
144144

145145
def comments(self):
146146
"""
147-
Return generator object of the comments endpoint.
147+
Return generator object endpoint of the comment.
148148
API docs: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commit-commit-comments-get
149149
"""
150150
for comment in self._get_paged("comments"):

atlassian/bitbucket/cloud/repositories/defaultReviewers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def __get_object(self, data):
1919

2020
def add(self, user):
2121
"""
22-
Adds the specified user to the repository"s list of default reviewers.
22+
Adds the specified user to the repository's list of default reviewers.
2323
2424
This method is idempotent. Adding a user a second time has no effect.
2525
@@ -34,7 +34,7 @@ def add(self, user):
3434

3535
def each(self, q=None, sort=None):
3636
"""
37-
Returns the repository"s default reviewers.
37+
Returns the repository's default reviewers.
3838
These are the users that are automatically added as reviewers on every new pull request
3939
that is created.
4040

atlassian/bitbucket/server/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def _get_paged(
3030
Used to get the paged data
3131
3232
:param url: string: The url to retrieve
33-
:param params: dict (default is None): The parameters
33+
:param params: dict (default is None): The parameter's
3434
:param data: dict (default is None): The data
3535
:param flags: string[] (default is None): The flags
3636
:param trailing: bool (default is None): If True, a trailing slash is added to the url

atlassian/confluence.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _get_paged(
5959
Used to get the paged data
6060
6161
:param url: string: The url to retrieve
62-
:param params: dict (default is None): The parameters
62+
:param params: dict (default is None): The parameter's
6363
:param data: dict (default is None): The data
6464
:param flags: string[] (default is None): The flags
6565
:param trailing: bool (default is None): If True, a trailing slash is added to the url
@@ -210,7 +210,7 @@ def get_child_pages(self, page_id):
210210

211211
def get_page_id(self, space, title, type="page"):
212212
"""
213-
Provide content id from search result by title and space
213+
Provide content id from search result by title and space.
214214
:param space: SPACE key
215215
:param title: title
216216
:param type: type of content: Page or Blogpost. Defaults to page
@@ -250,7 +250,7 @@ def get_parent_content_title(self, page_id):
250250

251251
def get_page_space(self, page_id):
252252
"""
253-
Provide space key from content id
253+
Provide space key from content id.
254254
:param page_id: content ID
255255
:return:
256256
"""
@@ -1138,8 +1138,8 @@ def attach_content(
11381138
comment=None,
11391139
):
11401140
"""
1141-
Attach (upload) a file to a page, if it exists it will update the
1142-
automatically version the new file and keep the old one.
1141+
Attach (upload) a file to a page, if it exists it will update automatically the
1142+
version the new file and keep the old one.
11431143
:param title: The page name
11441144
:type title: ``str``
11451145
:param space: The space name
@@ -1218,8 +1218,8 @@ def attach_file(
12181218
comment=None,
12191219
):
12201220
"""
1221-
Attach (upload) a file to a page, if it exists it will update the
1222-
automatically version the new file and keep the old one.
1221+
Attach (upload) a file to a page, if it exists it will update automatically the
1222+
version the new file and keep the old one.
12231223
:param title: The page name
12241224
:type title: ``str``
12251225
:param space: The space name
@@ -2899,8 +2899,8 @@ def add_user_to_group(self, username, group_name):
28992899
"""
29002900
Add given user to a group
29012901
2902-
:param username: str
2903-
:param group_name: str
2902+
:param username: str - username of user to add to group
2903+
:param group_name: str - name of group to add user to
29042904
:return: Current state of the group
29052905
"""
29062906
url = "rest/api/2/group/user"
@@ -2919,11 +2919,11 @@ def add_space_permissions(
29192919
"""
29202920
Add permissions to a space
29212921
2922-
:param space_key: str
2923-
:param subject_type: str
2924-
:param subject_id: str
2925-
:param operation_key: str
2926-
:param operation_target: str
2922+
:param space_key: str - key of space to add permissions to
2923+
:param subject_type: str - type of subject to add permissions for
2924+
:param subject_id: str - id of subject to add permissions for
2925+
:param operation_key: str - key of operation to add permissions for
2926+
:param operation_target: str - target of operation to add permissions for
29272927
:return: Current permissions of space
29282928
"""
29292929
url = "rest/api/space/{}/permission".format(space_key)

atlassian/crowd.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ def _crowd_api_url(self, api, resource):
3232

3333
def _user_change_status(self, username, active):
3434
"""
35-
Change user status
36-
37-
:params active bool
38-
35+
Change user status.
36+
:param username: str - username
37+
:param active: bool - True/False
3938
:return:
4039
"""
4140

@@ -59,12 +58,18 @@ def _user_change_status(self, username, active):
5958
)
6059

6160
def user(self, username):
61+
"""
62+
Get user information
63+
:param username:
64+
:return:
65+
"""
6266
params = {"username": username}
6367
return self.get(self._crowd_api_url("usermanagement", "user"), params=params)
6468

6569
def user_activate(self, username):
6670
"""
6771
Activate user
72+
:param username: str - username
6873
"""
6974

7075
return self._user_change_status(username, True)
@@ -116,7 +121,7 @@ def user_deactivate(self, username):
116121
def user_delete(self, username):
117122
"""
118123
Delete user
119-
124+
:param username: str - username
120125
:return:
121126
"""
122127

@@ -141,6 +146,11 @@ def group_add_user(self, username, groupname):
141146
)
142147

143148
def group_nested_members(self, group):
149+
"""
150+
Get nested members of group
151+
:param group:
152+
:return:
153+
"""
144154
params = {"groupname": group}
145155
return self.get(self._crowd_api_url("group", "nested"), params=params)
146156

atlassian/insight.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ def add_comment_to_object(self, comment, object_id, role):
142142
Add comment to Object
143143
144144
:param comment: str
145-
:param object_id: int
146-
:param role: int
145+
:param object_id: int - Object ID
146+
:param role: int - Role ID
147147
0 Insight Users
148148
1 Insight Managers
149149
2 Insight Administrators

atlassian/jira.py

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def get_cluster_zdu_state(self):
379379
# Issue Comments
380380
def issue_get_comments(self, issue_id):
381381
"""
382-
Get Comments on an Issue
382+
Get Comments on an Issue.
383383
:param issue_id: Issue ID
384384
:raises: requests.exceptions.HTTPError
385385
:return:
@@ -570,7 +570,7 @@ def get_all_fields(self):
570570
def create_custom_field(self, name, type, search_key=None, description=None):
571571
"""
572572
Creates a custom field with the given name and type
573-
:param name: str
573+
:param name: str - name of the custom field
574574
:param type: str, like 'com.atlassian.jira.plugin.system.customfieldtypes:textfield'
575575
:param search_key: str, like above
576576
:param description: str
@@ -739,7 +739,7 @@ def delete_filter(self, filter_id):
739739

740740
def get_filter_share_permissions(self, filter_id):
741741
"""
742-
Gets share permissions of a filter
742+
Gets share permissions of a filter.
743743
:param filter_id: Filter ID
744744
:return: Returns current share permissions of filter
745745
"""
@@ -759,7 +759,7 @@ def add_filter_share_permission(
759759
edit=None,
760760
):
761761
"""
762-
Adds share permission for a filter
762+
Adds share permission for a filter. See the documentation of the sharePermissions.
763763
:param filter_id: Filter ID
764764
:param type: What type of permission is granted (i.e. user, project)
765765
:param project_id: Project ID, relevant for type 'project' and 'projectRole'
@@ -815,8 +815,8 @@ def get_groups(self, query=None, exclude=None, limit=20):
815815
specifically Showing X of Y matching groups.
816816
The number of groups returned is limited by the system property "jira.ajax.autocomplete.limit"
817817
The groups will be unique and sorted.
818-
:param query: str
819-
:param exclude: str
818+
:param query: str - Query of searching groups by name.
819+
:param exclude: str - Exclude groups from search results.
820820
:param limit: int
821821
:return: Returned even if no groups match the given substring
822822
"""
@@ -849,9 +849,8 @@ def remove_group(self, name, swap_group=None):
849849
If you delete a group and content is restricted to that group, the content will be hidden from all users
850850
To prevent this, use this parameter to specify a different group to transfer the restrictions
851851
(comments and worklogs only) to
852-
853-
:param name: str
854-
:param swap_group: str
852+
:param name: str - name
853+
:param swap_group: str - swap group
855854
:return:
856855
"""
857856
log.warning("Removing group...")
@@ -1487,8 +1486,8 @@ def get_issue_remote_links(self, issue_key, global_id=None, internal_id=None):
14871486
"""
14881487
Finding all Remote Links on an issue, also with filtering by Global ID and internal ID
14891488
:param issue_key:
1490-
:param global_id: str
1491-
:param internal_id: str
1489+
:param global_id: str - Global ID
1490+
:param internal_id: str - internal ID
14921491
:return:
14931492
"""
14941493
base_url = self.resource_url("issue")
@@ -1512,9 +1511,9 @@ def create_or_update_issue_remote_links(
15121511
):
15131512
"""
15141513
Add Remote Link to Issue, update url if global_id is passed
1515-
:param issue_key: str
1516-
:param link_url: str
1517-
:param title: str
1514+
:param issue_key: str - issue key
1515+
:param link_url: str - url of the link
1516+
:param title: str - title of the link
15181517
:param global_id: str, OPTIONAL:
15191518
:param relationship: str, OPTIONAL: Default by built-in method: 'Web Link'
15201519
:param icon_url: str, OPTIONAL: Link to a 16x16 icon representing the type of the object in the remote system
@@ -4439,7 +4438,7 @@ def get_all_sprint(self, board_id, state=None, start=0, limit=50):
44394438
Returns all sprints from a board, for a given board ID.
44404439
This only includes sprints that the user has permission to view.
44414440
:param board_id:
4442-
:param state: Filters results to sprints in specified states.
4441+
:param state: Filter results to sprints in specified states.
44434442
Valid values: future, active, closed.
44444443
You can define multiple states separated by commas, e.g. state=active,closed
44454444
:param start: The starting index of the returned sprints.
@@ -4575,23 +4574,23 @@ def dvcs_update_linked_repo_with_remote(self, repository_id):
45754574
url = "rest/bitbucket/1.0/repositories/{}/sync".format(repository_id)
45764575
return self.post(url)
45774576

4578-
def flag_issue(self, issueKeys, flag=True):
4577+
def flag_issue(self, issue_keys, flag=True):
45794578
"""
45804579
Flags or un-flags one or multiple issues in Jira with a flag indicator.
4581-
:param issueKeys: List of issue keys to flag or un-flag.
4582-
:type issueKeys: list[str]
4580+
:param issue_keys: List of issue keys to flag or un-flag.
4581+
:type issue_keys: list[str]
45834582
:param flag: Flag indicating whether to flag or un-flag the issues (default is True for flagging).
45844583
:type flag: bool
45854584
:return: POST request response.
45864585
:rtype: dict
45874586
"""
45884587
url = "rest/greenhopper/1.0/xboard/issue/flag/flag.json"
4589-
data = {"issueKeys": issueKeys, "flag": flag}
4588+
data = {"issueKeys": issue_keys, "flag": flag}
45904589
return self.post(url, data)
45914590

45924591
def health_check(self):
45934592
"""
4594-
Get health status
4593+
Get health status of Jira.
45954594
https://confluence.atlassian.com/jirakb/how-to-retrieve-health-check-results-using-rest-api-867195158.html
45964595
:return:
45974596
"""

atlassian/rest_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def request(
209209
:param params:
210210
:param headers:
211211
:param files:
212-
:param trailing: bool
212+
:param trailing: bool - OPTIONAL: Add trailing slash to url
213213
:param absolute: bool, OPTIONAL: Do not prefix url, url is absolute
214214
:param advanced_mode: bool, OPTIONAL: Return the raw response
215215
:return:

0 commit comments

Comments
 (0)