RFR: 1914: IssuePoller always returns the most recently updated issue even if it has already been handled

Erik Joelsson erikj at openjdk.org
Fri May 19 20:41:18 UTC 2023


On Fri, 19 May 2023 18:16:24 GMT, Zhao Song <zsong at openjdk.org> wrote:

> 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.

I think this looks ok, but do you think you could write at least a manual test in `JiraProjectTests`? Let me know if you need helping setting up the environment to get such a test running.

-------------

PR Review: https://git.openjdk.org/skara/pull/1522#pullrequestreview-1435087784


More information about the skara-dev mailing list