RFR: 1818: Get rid of extra REST request in GitLabMergeRequest#author

Erik Joelsson erikj at openjdk.org
Mon Feb 13 22:28:10 UTC 2023


On Mon, 13 Feb 2023 21:01:06 GMT, Zhao Song <zsong at openjdk.org> wrote:

> Currently, in GitLabMergeRequest#author, the bot makes an unnecessary REST request to retrieve the HostUser object. 
> However, with recent advancements in GitLab, it's possible to parse the HostUser directly from the pull request JSON. 
> Getting rid of this redundant REST request would also solve the 'user is inactive' issue.

forge/src/main/java/org/openjdk/skara/forge/gitlab/GitLabMergeRequest.java line 85:

> 83:     @Override
> 84:     public HostUser author() {
> 85:         return host.parseAuthorField(json);

Did you test this? I would assume you need something like this:
Suggestion:

        return host.parseAuthorField(json.get("author"));

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

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


More information about the skara-dev mailing list