Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DiffRefs not populating for Merge Requests List #391

Closed
baymac opened this issue Jun 19, 2019 · 4 comments
Closed

DiffRefs not populating for Merge Requests List #391

baymac opened this issue Jun 19, 2019 · 4 comments

Comments

@baymac
Copy link
Contributor

baymac commented Jun 19, 2019

For my GitLab Plugin for Jenkins,

I need DiffRefs of Merge Request. Although DiffRefs get populated for single MergeRequest call e.g.

System.out.println(gitLabApi.getMergeRequestApi().getMergeRequest(projectpath, 1));

But it doesn't work when called for a list of Merge Requests. The DiffRefs field is returned null
e.g.

for(final MergeRequest m : gitLabApi.getMergeRequestApi().getMergeRequests("catwoman/gitlab-bs", Constants.MergeRequestState.OPENED)) {
        System.out.println(m);
        System.out.println("-----------------");
    }

For getting the DiffRefs I need to perform an extra api call inside the for loop, e.g.

for(final MergeRequest m : gitLabApi.getMergeRequestApi().getMergeRequests("catwoman/gitlab-bs", Constants.MergeRequestState.OPENED)) {
        System.out.println(gitLabApi.getMergeRequestApi().getMergeRequest(project, m.getIid()));
        System.out.println("-----------------");
    }

Want to know if this has to do something with default GitLab API or gitlab4j?

Thanks.

@gmessner
Copy link
Collaborator

@baymac
Copy link
Contributor Author

baymac commented Jun 19, 2019

I do not see any reason for that. Anyway, thanks @gmessner as always. :)

@baymac baymac closed this as completed Jun 19, 2019
@gmessner
Copy link
Collaborator

@baymac
It may be resource intensive to fetch the diff refs, you might think about submitting an issue with GitLab to ask this question. See https://gitlab.com/gitlab-org/gitlab-ce/issues

@baymac
Copy link
Contributor Author

baymac commented Jun 19, 2019

Okay, I have raised a ticket.

tomasbjerre added a commit to tomasbjerre/violation-comments-to-gitlab-lib that referenced this issue Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants