RFR: 1595: Introduce an IssuePoller similar to the PullRequestPoller

Erik Joelsson erikj at openjdk.org
Mon Sep 12 21:21:23 UTC 2022

Inspired by the `PullRequestPoller`, I have now also created an `IssuePoller`. The requirements are a bit different on this poller, which makes it a bit easier to implement. 

Like the `PullRequestPoller`, it needs to handle retries, something I had overlooked in the original `CSRIssueBot`. Compared to that implementation, I'm also moving away from using `IssueProject::lastUpdatedIssue` for the initial query. The problem with relying on such a query for the very first round is if it, or something else in that round, fails. At least for the `CSRIssueBot`, once we are in the second round, after a failed first round, it's no longer safe to only query for the very last updated Issue, there could be multiple updates that we would miss. Instead there is a configurable `Duration` that defines how far back we go from the time the bot was created for the first query. Depending on what the bot needs, this Duration can be expected to cover any downtime for the bot (typically in the order of days), which would be the case for the `SyncLabelBot` bot, or it could just be needed to cover any time sync differences between the bot and the server (typically in the order of 
 minutes to an hour), which would apply to the `CSRIssueBot`.

Like with my revised PR for SKARA-1565, I'm not changing any bot to use this poller yet. I'm going to followup with that change for the CSRBot in SKARA-1594, and for other bots later.


Commit messages:
 - SKARA-1595

Changes: https://git.openjdk.org/skara/pull/1372/files
 Webrev: https://webrevs.openjdk.org/?repo=skara&pr=1372&range=00
  Issue: https://bugs.openjdk.org/browse/SKARA-1595
  Stats: 370 lines in 6 files changed: 370 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/skara/pull/1372.diff
  Fetch: git fetch https://git.openjdk.org/skara pull/1372/head:pull/1372

PR: https://git.openjdk.org/skara/pull/1372

More information about the skara-dev mailing list