Skip to content

Jira: Add duplicated account detection method #1399

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 1 commit into from
May 23, 2024
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 .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
fail_ci_if_error: true
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
31 changes: 31 additions & 0 deletions atlassian/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -5322,3 +5322,34 @@
# check as support tools
response = self.get("rest/supportHealthCheck/1.0/check/")
return response

Check warning on line 5325 in atlassian/jira.py

View check run for this annotation

Codecov / codecov/patch

atlassian/jira.py#L5325

Added line #L5325 was not covered by tests
def duplicated_account_checks_detail(self):
"""
Health check: Duplicate user accounts detail
https://confluence.atlassian.com/jirakb/health-check-duplicate-user-accounts-1063554355.html

Check warning on line 5329 in atlassian/jira.py

View check run for this annotation

Codecov / codecov/patch

atlassian/jira.py#L5328-L5329

Added lines #L5328 - L5329 were not covered by tests
:return:
"""
response = self.get("rest/api/2/user/duplicated/list")
return response

def duplicated_account_checks_flush(self):
"""
Health check: Duplicate user accounts by flush
The responses returned by the count and list methods are stored in the duplicate users cache for 10 minutes.

Check warning on line 5338 in atlassian/jira.py

View check run for this annotation

Codecov / codecov/patch

atlassian/jira.py#L5337-L5338

Added lines #L5337 - L5338 were not covered by tests
The cache is flushed automatically every time a directory
is added, deleted, enabled, disabled, reordered, or synchronized.
https://confluence.atlassian.com/jirakb/health-check-duplicate-user-accounts-1063554355.html
:return:
"""
params = {"flush": "true"}
response = self.get("rest/api/2/user/duplicated/list", params=params)
return response

def duplicated_account_checks_count(self):
"""
Health check: Duplicate user accounts count
https://confluence.atlassian.com/jirakb/health-check-duplicate-user-accounts-1063554355.html

Check warning on line 5351 in atlassian/jira.py

View check run for this annotation

Codecov / codecov/patch

atlassian/jira.py#L5349-L5351

Added lines #L5349 - L5351 were not covered by tests
:return:
"""
response = self.get("rest/api/2/user/duplicated/count")
return response
16 changes: 16 additions & 0 deletions docs/jira.rst
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,22 @@ Cluster methods (only for DC edition)
# Request current index from node (the request is processed asynchronously).
jira.request_current_index_from_node(node_id)

Health checks methods (only for on-prem edition)
------------------------------------------------
.. code-block:: python

# Get health status of Jira.
jira.health_check()

# Health check: Duplicate user accounts detail
jira.duplicated_account_checks_detail()

# Health check: Duplicate user accounts by flush
jira.duplicated_account_checks_flush()

# Health check: Duplicate user accounts count
jira.duplicated_account_checks_count()

TEMPO
----------------------
.. code-block:: python
Expand Down