python-jira-plus 1.0.15__tar.gz → 2.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_jira_plus-1.0.15/python_jira_plus.egg-info → python_jira_plus-2.0.1}/PKG-INFO +1 -1
- {python_jira_plus-1.0.15 → python_jira_plus-2.0.1}/python_jira_plus/jira_plus.py +43 -2
- {python_jira_plus-1.0.15 → python_jira_plus-2.0.1/python_jira_plus.egg-info}/PKG-INFO +1 -1
- {python_jira_plus-1.0.15 → python_jira_plus-2.0.1}/setup.py +1 -1
- {python_jira_plus-1.0.15 → python_jira_plus-2.0.1}/LICENSE +0 -0
- {python_jira_plus-1.0.15 → python_jira_plus-2.0.1}/MANIFEST.in +0 -0
- {python_jira_plus-1.0.15 → python_jira_plus-2.0.1}/README.md +0 -0
- {python_jira_plus-1.0.15 → python_jira_plus-2.0.1}/pyproject.toml +0 -0
- {python_jira_plus-1.0.15 → python_jira_plus-2.0.1}/python_jira_plus/__init__.py +0 -0
- {python_jira_plus-1.0.15 → python_jira_plus-2.0.1}/python_jira_plus/describe_allowed_value.py +0 -0
- {python_jira_plus-1.0.15 → python_jira_plus-2.0.1}/python_jira_plus.egg-info/SOURCES.txt +0 -0
- {python_jira_plus-1.0.15 → python_jira_plus-2.0.1}/python_jira_plus.egg-info/dependency_links.txt +0 -0
- {python_jira_plus-1.0.15 → python_jira_plus-2.0.1}/python_jira_plus.egg-info/requires.txt +0 -0
- {python_jira_plus-1.0.15 → python_jira_plus-2.0.1}/python_jira_plus.egg-info/top_level.txt +0 -0
- {python_jira_plus-1.0.15 → python_jira_plus-2.0.1}/requirements.txt +0 -0
- {python_jira_plus-1.0.15 → python_jira_plus-2.0.1}/setup.cfg +0 -0
|
@@ -119,7 +119,11 @@ class JiraPlus:
|
|
|
119
119
|
jira_err_count: int = 3,
|
|
120
120
|
json_result: bool = True,
|
|
121
121
|
) -> ResultList[Issue] | dict | None:
|
|
122
|
-
|
|
122
|
+
if self.server_type == ServerType.ON_PREMISE:
|
|
123
|
+
_paginate_query_func = self._paginate_query
|
|
124
|
+
else:
|
|
125
|
+
_paginate_query_func = self._paginate_query_new
|
|
126
|
+
return _paginate_query_func(
|
|
123
127
|
query=query,
|
|
124
128
|
max_results=max_results,
|
|
125
129
|
specific_fields=specific_fields,
|
|
@@ -127,6 +131,43 @@ class JiraPlus:
|
|
|
127
131
|
json_result=json_result,
|
|
128
132
|
)
|
|
129
133
|
|
|
134
|
+
def _paginate_query_new(
|
|
135
|
+
self,
|
|
136
|
+
query: str,
|
|
137
|
+
max_results: int,
|
|
138
|
+
specific_fields: str | list[str],
|
|
139
|
+
jira_err_limit: int,
|
|
140
|
+
json_result: bool,
|
|
141
|
+
) -> ResultList[Issue] | list:
|
|
142
|
+
all_issues = []
|
|
143
|
+
retries = 0
|
|
144
|
+
page = None
|
|
145
|
+
while True: # pylint: disable=W0149
|
|
146
|
+
try:
|
|
147
|
+
self.logger.debug(f"Fetching issues from startAt={len(all_issues)}")
|
|
148
|
+
page = self.jira_client.enhanced_search_issues(
|
|
149
|
+
jql_str=query,
|
|
150
|
+
nextPageToken=page['nextPageToken'] if page else None,
|
|
151
|
+
maxResults=max_results,
|
|
152
|
+
fields=specific_fields,
|
|
153
|
+
json_result=json_result,
|
|
154
|
+
)
|
|
155
|
+
all_issues += page["issues"] if json_result else page
|
|
156
|
+
if page['isLast']:
|
|
157
|
+
break
|
|
158
|
+
retries = 0 # reset on success
|
|
159
|
+
except JIRAError as err:
|
|
160
|
+
if err.status_code == 400:
|
|
161
|
+
self.logger.error(f"Bad Request: {err.text}")
|
|
162
|
+
raise JIRAError(f"Bad Request: {err.text}") from err
|
|
163
|
+
retries += 1
|
|
164
|
+
self.logger.warning(f"Retry {retries}/{jira_err_limit} after JIRAError: {err}")
|
|
165
|
+
if retries >= jira_err_limit:
|
|
166
|
+
self.logger.exception("Max retries exceeded.")
|
|
167
|
+
return []
|
|
168
|
+
time.sleep(300 if retries == jira_err_limit - 1 else 90)
|
|
169
|
+
return all_issues
|
|
170
|
+
|
|
130
171
|
def _paginate_query(
|
|
131
172
|
self,
|
|
132
173
|
query: str,
|
|
@@ -141,7 +182,7 @@ class JiraPlus:
|
|
|
141
182
|
while True: # pylint: disable=W0149
|
|
142
183
|
try:
|
|
143
184
|
self.logger.debug(f"Fetching issues from startAt={start_at}")
|
|
144
|
-
page = self.jira_client.
|
|
185
|
+
page = self.jira_client.enhanced_search_issues(
|
|
145
186
|
jql_str=query,
|
|
146
187
|
startAt=start_at,
|
|
147
188
|
maxResults=max_results,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_jira_plus-1.0.15 → python_jira_plus-2.0.1}/python_jira_plus/describe_allowed_value.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_jira_plus-1.0.15 → python_jira_plus-2.0.1}/python_jira_plus.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|