RFR: 1611: Improve adding and removing of labels in GitLab

Erik Joelsson erikj at openjdk.org
Wed Oct 12 21:39:44 UTC 2022

On Wed, 12 Oct 2022 20:59:44 GMT, Zhao Song <zsong at openjdk.org> wrote:

>> Improved adding and removing of labels in GitLabMergeRequest.
>> And make the label handling consistent with GitHubPullRequest.
> forge/src/main/java/org/openjdk/skara/forge/gitlab/GitLabMergeRequest.java line 706:
>> 704:                     .sorted()
>> 705:                     .collect(Collectors.toList());
>> 706:         }
> I don't know if we need to make it consistent with GitHubPullRequest but I did.

Please note that GitLabMergeRequest handles labels a bit differently to JiraIssue and GitHubPullRequest. The internal cache is a list of String, and we override the labelNames() method. This is all because of an optimization I made recently.

This means that the lazy fetch needs to happen in labelNames() instead, and the labels() method should call labelNames() to get the list to convert to Label objects.


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

More information about the skara-dev mailing list