RFR: 1914: IssuePoller always returns the most recently updated issue even if it has already been handled
Zhao Song
zsong at openjdk.org
Fri May 19 18:22:14 UTC 2023
When I was testing with [SKARA-1912](https://bugs.openjdk.org/browse/SKARA-1912), I observed an issue in the IssuePoller. Although some updated csr issues has been handled in the previous round, the most recently updated csr issue would be returned again in the next round. Therefore, this would trigger the CSRIssueWorkItem and CheckWorkItem to update the PR very frequently.
Erik investigated it and found the root cause.
In the IssuePoller#updatedIssues, the poller first queries for updated issues (which may include some handled issues due to the imprecise timestamp, measured in minutes). Subsequently, the poller checks whether the issues have been really updated by comparing them with their copies using JiraIssue#equals. In this method, we compare the json of the issue with our own copy. If the issues are really updated, the poller returns them.
Originally, the JiraIssue#equals method worked well. However, now, when the poller uses the REST API to retrieve the JSON of the issue, it includes a field called "customfield_11700," which represents the "Development" field used by Jira to display data quickly and easily in the issues. Within this field, there are various objects, such as "[SummaryItemBean at 5e105688](mailto:SummaryItemBean at 5e105688)." These objects change each time the poller makes a query. Therefore, even if the issue has not actually been updated, the JiraIssue#equals method will return false.
In this patch, some fields will be filtered out before comparing the jsons.
-------------
Commit messages:
- SKARA-1914
Changes: https://git.openjdk.org/skara/pull/1522/files
Webrev: https://webrevs.openjdk.org/?repo=skara&pr=1522&range=00
Issue: https://bugs.openjdk.org/browse/SKARA-1914
Stats: 33 lines in 2 files changed: 30 ins; 0 del; 3 mod
Patch: https://git.openjdk.org/skara/pull/1522.diff
Fetch: git fetch https://git.openjdk.org/skara.git pull/1522/head:pull/1522
PR: https://git.openjdk.org/skara/pull/1522
More information about the skara-dev
mailing list