RFR: 1532: CSRBot is too inefficient

Erik Joelsson erikj at openjdk.org
Mon Aug 15 16:58:26 UTC 2022

On Mon, 15 Aug 2022 14:02:10 GMT, Guoxiong Li <gli at openjdk.org> wrote:

> I don't really know whether it is a good idea to has both CSRIssueBot and CSRPullRequestBot. It seems that one CSRBot contains two work items, `IssueWorkItem` and `PullRequestWorkItem`, works well too.

The reason for having two separate bots is that the CSRPullRequestBot has one instance for each repo, while the CSRIssueBot has one instance for each IssueProject. There are generally multiple repos that share the same IssueProject. It would be possible to have one single CSRBot for each IssueProject and just loop over all the repos in it. I chose to split them to keep each "bot" more focused on polling one kind of thing. Compare with the existing `MailingListArchiveReaderBot` and `MailingListBridgeBot`.

> Or we can seperate the `CSRIssueBot` to a new module, like `IssueBot`, to be reused in the future. But it may exceed the range of this patch.

A separate module would be tricky as we need WorkItems that are specialized for CSR, but those wouldn't be accessible in the other module. I do agree that part of the implementation here would be nice to be able to reuse, but until we know how some other bot would like to reuse it, I would rather not complicate the current patch further.

> bots/csr/src/main/java/org/openjdk/skara/bots/csr/CSRBotFactory.java line 33:
>> 31: import java.util.logging.Logger;
>> 32: import org.openjdk.skara.forge.HostedRepository;
>> 33: import org.openjdk.skara.issuetracker.IssueProject;
> The import statements can be polished. The same/similar package could be put nearly.

That does look pretty bad. I never really care for import statements as the IDE handles it automatically, but I will see what can be done.


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

More information about the skara-dev mailing list