Skip to content
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

refactored logging levels in jira.py, service_desk.py, confluence.py, insights.py #1468

Merged
merged 51 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
2e8e1b0
fixing minor issue in scrap_regex_from_issue method
Feb 3, 2024
715463b
new Confluence method scrap_regex_from_page+ docs + examples
Feb 4, 2024
4db577a
Merge branch 'atlassian-api:master' into master
gkowalc Feb 4, 2024
e13b5ba
Merge branch 'atlassian-api:master' into master
gkowalc Feb 8, 2024
9fd7ae4
added method get_attachments_ids_from_page to jira.py
Feb 8, 2024
f695346
added method download_attachments_from_issue
Feb 8, 2024
6f3c1f6
refactoring download_all_attachments_from_page method
Feb 8, 2024
7fd73d8
finished download_attachments_from_issue
Feb 9, 2024
ef752ab
added two new methods: download_attachments.from_issue and get_attac…
Feb 9, 2024
999de01
Merge branch 'atlassian-api:master' into master
gkowalc Feb 9, 2024
2edee0c
Merge branch 'atlassian-api:master' into master
gkowalc Feb 10, 2024
fe7c1f1
Merge branch 'master' of github.com:gkowalc/atlassian-python-api
Feb 15, 2024
bf7dcb4
Merge branch 'master' of github.com:gkowalc/atlassian-python-api
Feb 27, 2024
7d6b0a0
Merge branch 'master' of github.com:gkowalc/atlassian-python-api
Mar 13, 2024
a56b1be
added fix to the infinitive loop
Mar 13, 2024
0802a35
Merge branch 'master' of github.com:gkowalc/atlassian-python-api
Mar 19, 2024
c23e7cd
adding reursion depth condition
Mar 19, 2024
e8e8959
fixed reursion depth condition
Mar 19, 2024
8c2824b
added update4d jira.py with new method + docs +example
Mar 19, 2024
9b1c9c4
added update4d jira.py with new method + docs +exampl
Mar 19, 2024
08d4acb
fix flake8 issue
Mar 19, 2024
20cae0b
Merge branch 'atlassian-api:master' into master
gkowalc Mar 20, 2024
26cf691
hotfix get_issue_tree_recursive
Mar 20, 2024
4cc2a03
Merge branch 'master' of github.com:gkowalc/atlassian-python-api
Mar 22, 2024
10ee67e
added expand to get_issue method, added new method
Mar 22, 2024
273401b
get_issue_status_changelog method
Mar 22, 2024
b70f618
included param expand in get_issue method decription
Mar 22, 2024
6bcd2c0
Merge branch 'atlassian-api:master' into master
gkowalc Mar 29, 2024
6a83b0b
WIP PR changes - https://github.com/atlassian-api/atlassian-python-ap…
Mar 29, 2024
0a6367c
Merge branch 'atlassian-api:master' into master
gkowalc Apr 12, 2024
5596fd5
improving index.rst docs https://github.com/atlassian-api/atlassian-p…
Apr 12, 2024
7b359a2
Merge branch 'atlassian-api:master' into master
gkowalc Apr 21, 2024
19aaf29
added whiteboard methods
Apr 21, 2024
8233f84
Merge branch 'master' of github.com:gkowalc/atlassian-python-api
Apr 21, 2024
fd3c1b6
added confluence whiteboard endpoints
Apr 21, 2024
a8956db
Merge branch 'atlassian-api:master' into master
gkowalc Aug 6, 2024
ec2a1e6
Merge branch 'atlassian-api:master' into master
gkowalc Sep 24, 2024
083da82
Merge branch 'atlassian-api:master' into master
gkowalc Sep 30, 2024
5e0217f
fixing bug with default parameters in jira get_issue_tree_recursive m…
Sep 30, 2024
c880174
Merge branch 'atlassian-api:master' into master
gkowalc Oct 2, 2024
bfa7eae
export to csv/html/xml method
Oct 4, 2024
ab2393d
refactoring get_space_export
Oct 4, 2024
854f58c
Merge branch 'atlassian-api:master' into master
gkowalc Oct 15, 2024
feb3288
Merge branch 'master' of github.com:gkowalc/atlassian-python-api
Oct 15, 2024
b1698ad
added new get_space_export method
Oct 15, 2024
bc2a601
added new get_space_export method + small refactor
Oct 15, 2024
03bd7d6
added examples + focs for confluence/get_space_export method
Oct 15, 2024
b2df92c
fixing small typos
Oct 15, 2024
0db9b30
Merge branch 'atlassian-api:master' into master
gkowalc Oct 16, 2024
fc86bc1
refactoring log levels
Oct 18, 2024
7c45b58
refactoring log.warn logging levels
Oct 18, 2024
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
5 changes: 2 additions & 3 deletions atlassian/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,6 @@
@deprecated(version="2.4.2", reason="Use get_all_restrictions_for_content()")
def get_all_restictions_for_content(self, content_id):
"""Let's use the get_all_restrictions_for_content()"""
log.warning("Please, be informed that is deprecated as typo naming")
return self.get_all_restrictions_for_content(content_id=content_id)

def get_all_restrictions_for_content(self, content_id):
Expand Down Expand Up @@ -2284,7 +2283,7 @@
:param name: str
:return:
"""
log.warning("Removing group...")
log.info("Removing group: %s during Confluence remove_group method execution", name)

Check warning on line 2286 in atlassian/confluence.py

View check run for this annotation

Codecov / codecov/patch

atlassian/confluence.py#L2286

Added line #L2286 was not covered by tests
url = "rest/api/admin/group/{groupName}".format(groupName=name)

try:
Expand Down Expand Up @@ -2714,7 +2713,7 @@
}
elif export_type == "pdf":
url = "spaces/flyingpdf/doflyingpdf.action?key=" + space_key
log.info("Initiate PDF space export from space " + str(space_key))
log.info("Initiated PDF space export")

Check warning on line 2716 in atlassian/confluence.py

View check run for this annotation

Codecov / codecov/patch

atlassian/confluence.py#L2716

Added line #L2716 was not covered by tests
return self.get_pdf_download_url_for_confluence_cloud(url)
else:
raise ValueError("Invalid export_type parameter value. Valid values are: 'html/csv/xml/pdf'")
Expand Down
5 changes: 2 additions & 3 deletions atlassian/insight.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"""
if self.cloud:
raise NotImplementedError
log.warning("Adding attachment...")
log.info("Adding attachment...")

Check warning on line 121 in atlassian/insight.py

View check run for this annotation

Codecov / codecov/patch

atlassian/insight.py#L121

Added line #L121 was not covered by tests
url = "rest/insight/1.0/attachments/object/{objectId}".format(objectId=object_id)
with open(filename, "rb") as attachment:
files = {"file": attachment}
Expand All @@ -131,7 +131,7 @@
"""
if self.cloud:
raise NotImplementedError
log.warning("Adding attachment...")
log.info("Deleting attachment...")

Check warning on line 134 in atlassian/insight.py

View check run for this annotation

Codecov / codecov/patch

atlassian/insight.py#L134

Added line #L134 was not covered by tests
url = "rest/insight/1.0/attachments/{attachmentId}".format(attachmentId=attachment_id)
return self.delete(url)

Expand Down Expand Up @@ -373,7 +373,6 @@
@deprecated(version="3.29.0", reason="Use get_object_reference_info()")
def get_object_referenceinfo(self, object_id):
"""Let's use the get_object_reference_info()"""
log.warning("Please, be informed that is deprecated as typo naming")
self.get_object_reference_info(object_id)

def get_object_reference_info(self, object_id):
Expand Down
22 changes: 11 additions & 11 deletions atlassian/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@
return self.get(url)

def create_component(self, component):
log.warning('Creating component "%s"', component["name"])
log.info('Creating component "%s"', component["name"])

Check warning on line 602 in atlassian/jira.py

View check run for this annotation

Codecov / codecov/patch

atlassian/jira.py#L602

Added line #L602 was not covered by tests
base_url = self.resource_url("component")
url = "{base_url}/".format(base_url=base_url)
return self.post(url, data=component)
Expand All @@ -610,7 +610,7 @@
return self.put(url, data=component)

def delete_component(self, component_id):
log.warning('Deleting component "%s"', component_id)
log.info('Deleting component "%s"', component_id)

Check warning on line 613 in atlassian/jira.py

View check run for this annotation

Codecov / codecov/patch

atlassian/jira.py#L613

Added line #L613 was not covered by tests
base_url = self.resource_url("component")
return self.delete("{base_url}/{component_id}".format(base_url=base_url, component_id=component_id))

Expand Down Expand Up @@ -965,7 +965,7 @@
:param swap_group: str - swap group
:return:
"""
log.warning("Removing group...")
log.info("Removing group: %s ", name)

Check warning on line 968 in atlassian/jira.py

View check run for this annotation

Codecov / codecov/patch

atlassian/jira.py#L968

Added line #L968 was not covered by tests
url = self.resource_url("group")
if swap_group is not None:
params = {"groupname": name, "swapGroup": swap_group}
Expand Down Expand Up @@ -1030,7 +1030,7 @@
:param group_name: str
:return:
"""
log.warning("Removing user from a group...")
log.info("Removing user: %s from a group: %s", username, group_name)

Check warning on line 1033 in atlassian/jira.py

View check run for this annotation

Codecov / codecov/patch

atlassian/jira.py#L1033

Added line #L1033 was not covered by tests
url = self.resource_url("group/user")
url_domain = self.url
if "atlassian.net" in url_domain:
Expand Down Expand Up @@ -1422,7 +1422,7 @@
:param issue_key: str
:param attachment: IO Object
"""
log.warning("Adding attachment...")
log.info("Adding attachment: %s", attachment)

Check warning on line 1425 in atlassian/jira.py

View check run for this annotation

Codecov / codecov/patch

atlassian/jira.py#L1425

Added line #L1425 was not covered by tests
base_url = self.resource_url("issue")
url = "{base_url}/{issue_key}/attachments".format(base_url=base_url, issue_key=issue_key)
if attachment:
Expand Down Expand Up @@ -1472,13 +1472,13 @@
else:
params["deleteSubtasks"] = "false"

log.warning("Removing issue %s...", issue_id_or_key)
log.info("Removing issue %s...", issue_id_or_key)

Check warning on line 1475 in atlassian/jira.py

View check run for this annotation

Codecov / codecov/patch

atlassian/jira.py#L1475

Added line #L1475 was not covered by tests

return self.delete(url, params=params)

# @todo merge with edit_issue method
def issue_update(self, issue_key, fields):
log.warning('Updating issue "%s" with "%s"', issue_key, fields)
log.info('Updating issue "%s" with "%s"', issue_key, fields)

Check warning on line 1481 in atlassian/jira.py

View check run for this annotation

Codecov / codecov/patch

atlassian/jira.py#L1481

Added line #L1481 was not covered by tests
base_url = self.resource_url("issue")
url = "{base_url}/{issue_key}".format(base_url=base_url, issue_key=issue_key)
return self.put(url, data={"fields": fields})
Expand Down Expand Up @@ -1512,7 +1512,7 @@
:param user:
:return:
"""
log.warning('Adding user %s to "%s" watchers', user, issue_key)
log.info('Adding user %s to "%s" watchers', user, issue_key)

Check warning on line 1515 in atlassian/jira.py

View check run for this annotation

Codecov / codecov/patch

atlassian/jira.py#L1515

Added line #L1515 was not covered by tests
data = user
base_url = self.resource_url("issue")
return self.post(
Expand All @@ -1527,7 +1527,7 @@
:param user:
:return:
"""
log.warning('Deleting user %s from "%s" watchers', user, issue_key)
log.info('Deleting user %s from "%s" watchers', user, issue_key)

Check warning on line 1530 in atlassian/jira.py

View check run for this annotation

Codecov / codecov/patch

atlassian/jira.py#L1530

Added line #L1530 was not covered by tests
params = {"username": user}
base_url = self.resource_url("issue")
return self.delete(
Expand Down Expand Up @@ -1613,7 +1613,7 @@

# @todo refactor and merge with create_issue method
def issue_create(self, fields):
log.warning('Creating issue "%s"', fields["summary"])
log.info('Creating issue "%s"', fields["summary"])

Check warning on line 1616 in atlassian/jira.py

View check run for this annotation

Codecov / codecov/patch

atlassian/jira.py#L1616

Added line #L1616 was not covered by tests
url = self.resource_url("issue")
return self.post(url, data={"fields": fields})

Expand Down Expand Up @@ -2141,7 +2141,7 @@
Default:false.
:return:
"""
log.warning("Creating user %s", display_name)
log.info("Creating user %s", display_name)

Check warning on line 2144 in atlassian/jira.py

View check run for this annotation

Codecov / codecov/patch

atlassian/jira.py#L2144

Added line #L2144 was not covered by tests
data = {
"name": username,
"emailAddress": email,
Expand Down
18 changes: 9 additions & 9 deletions atlassian/service_desk.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
:param email: str - email address
:return: New customer
"""
log.warning("Creating customer...")
log.info("Creating customer using create_customer method...")
data = {"fullName": full_name, "email": email}

return self.post(
Expand Down Expand Up @@ -236,7 +236,7 @@
:param comment: OPTIONAL: str
:return: None
"""
log.warning("Performing transition...")
log.info("Performing transition for issue: " + issue_id_or_key)

Check warning on line 239 in atlassian/service_desk.py

View check run for this annotation

Codecov / codecov/patch

atlassian/service_desk.py#L239

Added line #L239 was not covered by tests
data = {"id": transition_id, "additionalComment": {"body": comment}}
url = "rest/servicedeskapi/request/{}/transition".format(issue_id_or_key)

Expand Down Expand Up @@ -373,7 +373,7 @@
:param name: str
:return: Organization data
"""
log.warning("Creating organization...")
log.info("Creating organization: " + name)
url = "rest/servicedeskapi/organization"
data = {"name": name}

Expand All @@ -387,7 +387,7 @@
:param organization_id: int
:return:
"""
log.warning("Adding organization...")
log.info("Adding organization...")
url = "rest/servicedeskapi/servicedesk/{}/organization".format(service_desk_id)
data = {"organizationId": organization_id}

Expand All @@ -401,7 +401,7 @@
:param organization_id: int
:return:
"""
log.warning("Removing organization...")
log.info("Removing organization...")
url = "rest/servicedeskapi/servicedesk/{}/organization".format(service_desk_id)
data = {"organizationId": organization_id}

Expand All @@ -414,7 +414,7 @@
:param organization_id:
:return:
"""
log.warning("Deleting organization...")
log.info("Deleting organization: %s ", organization_id)
url = "rest/servicedeskapi/organization/{}".format(organization_id)

return self.delete(url, headers=self.experimental_headers)
Expand All @@ -430,7 +430,7 @@
:param users_list: list
:return:
"""
log.warning("Adding users...")
log.info("Adding users: %s ", str(users_list))
url = "rest/servicedeskapi/organization/{}/user".format(organization_id)
data = {"usernames": users_list, "accountIds": account_list}

Expand All @@ -447,7 +447,7 @@
:param account_list: list
:return:
"""
log.warning("Removing users...")
log.info("Removing users: %s", str(users_list))
url = "rest/servicedeskapi/organization/{}/user".format(organization_id)
data = {"usernames": users_list, "accountIds": account_list}

Expand Down Expand Up @@ -901,7 +901,7 @@
:param request_name: str
:param request_description: str
"""
log.warning("Creating request type...")
log.info("Creating request type")

Check warning on line 904 in atlassian/service_desk.py

View check run for this annotation

Codecov / codecov/patch

atlassian/service_desk.py#L904

Added line #L904 was not covered by tests
data = {
"issueTypeId": request_type_id,
"name": request_name,
Expand Down