RFR: 1084: Automatically update repository labels from Skara config

Kevin Rushforth kcr at openjdk.java.net
Tue Jul 6 21:30:52 UTC 2021


On Tue, 6 Jul 2021 20:56:51 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

> This patch adds a new WorkItem to the MailingListBridgeBot. The new LabelsUpdaterWorkItem runs once at startup and makes sure all mailing list labels configured for the repository actually exist as labels in the hosted repository (in GitHub or GitLab). I chose to implement this as a WorkItem, even though it's just run once. It will also block any other WorkItems in the bot from running until successful. By using the existing framework for this, we get automatic retries and I believe it will play better with other bots for resource usage, even though it doesn't quite fit in.
> 
> The new WorkItem also keeps the description field updated with the mailing list email address. This use of the description field was initially added manually for the main jdk repository on GitHub, but has not been kept up to date since, and has not been propagated to other repositories (jdk16 and jdk17). These description fields are both informative for the user, as well as being used by the CLI client to present information to users.
> 
> To verify the new interaction for managing labels on a repository with both GitLab and GitHub, I have implemented a new type of manual tests. They are disabled from automatic running in Gradle using the @Disabled annotation. To run them you need to provide a properties file with data about account and keys to use to access the servers. We don't want these kinds of tests to run against GitHub/GitLab automatically, but at least now there is a way to semi automatically verify that kind of functionality.

Not a complete review, but I left a couple questions inline.

bots/mlbridge/src/main/java/org/openjdk/skara/bots/mlbridge/ArchiveWorkItem.java line 65:

> 63:     public boolean concurrentWith(WorkItem other) {
> 64:         if (!(other instanceof ArchiveWorkItem otherArchiveItem)) {
> 65:             if (!(other instanceof LabelsUpdaterWorkItem otherLabelsUpdaterItem)) {

Pattern-matching `instanceof` was finalized in JDK 16. Has Skara already bumped its minimum JDK to 16?

forge/src/main/java/org/openjdk/skara/forge/github/GitHubRepository.java line 591:

> 589:                 .put("name", label.name())
> 590:                 // Color is Gray and matches all current labels
> 591:                 .put("color", "ededed");

Will this overwrite the existing color scheme? For a new repo, will it always use gray for all labels?

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

PR: https://git.openjdk.java.net/skara/pull/1194


More information about the skara-dev mailing list