RFR: 1084: Automatically update repository labels from Skara config

Erik Joelsson erikj at openjdk.java.net
Wed Jul 7 12:32:41 UTC 2021

On Tue, 6 Jul 2021 21:26:30 GMT, Kevin Rushforth <kcr 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.
> 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?

We are running the Skara bots on JDK 16, but officially we are still listing JDK 14 as minimum. I don't think it's worth bumping the minimum for this.

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

If addLabel() is called on an existing label, then I think the color scheme will be overwritten. The intention not to change any label, just to add the ones that are missing. The updateLabel method will not change the color.

Note that the labels we are adding with this patch are just the ones for mailing lists. Do you think we need to add automation for colors for the other set of labels we use (e.g. rfr, ready, csr etc)?


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

More information about the skara-dev mailing list