[Blink] Update Buganizer GetIssueList API response parsing
GetIssueList request return list of issue in the same structure as the
payload returned from CreateIssue [1], so it should be parsed the same
way before returning to the caller.
[1]: http://google3/google/devtools/issuetracker/v1/issuetracker_service.proto;l=1814;rcl=623266776
Change-Id: I5e01e8ab761745811f9b423baf6c35658796ce21
Bug: 335457566
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5501448
Reviewed-by: Jonathan Lee <jonathanjlee@google.com>
Reviewed-by: Weizhong Xia <weizhong@google.com>
Commit-Queue: An Sung <ansung@google.com>
Cr-Commit-Position: refs/heads/main@{#1294923}
diff --git a/third_party/blink/tools/blinkpy/w3c/buganizer.py b/third_party/blink/tools/blinkpy/w3c/buganizer.py
index a03d21b..a82dd1f14 100644
--- a/third_party/blink/tools/blinkpy/w3c/buganizer.py
+++ b/third_party/blink/tools/blinkpy/w3c/buganizer.py
@@ -163,7 +163,9 @@
'error: %s', str(e))
return {'error': str(e)}
- def GetIssueList(self, query_string, limit: int = MAX_PAGE_SIZE):
+ def GetIssueList(self,
+ query_string,
+ limit: int = MAX_PAGE_SIZE) -> List[BuganizerIssue]:
"""Makes a request to the issue tracker to get list of issues by query"""
# TODO(crbug.com/333112144) : Use nextPageToken in response to support
# more than 500 issues
@@ -173,7 +175,14 @@
view='FULL')
try:
response = self._ExecuteRequest(request)
- issues = response.get('issues', []) if response else []
+ logging.debug('[BuganizerClient] GetIssueList response: %s',
+ response)
+ if not response:
+ return []
+ issues = [
+ BuganizerIssue.from_payload(issue_payload)
+ for issue_payload in response.get('issues', [])
+ ]
return issues
except Exception as e:
raise BuganizerError(f'failed to get issue list: {e}') from e