mattermost-plugin-gitlab icon indicating copy to clipboard operation
mattermost-plugin-gitlab copied to clipboard

Number of Issues, Notes etc. not correct: API call responds are limited

Open nippold opened this issue 4 years ago • 6 comments
trafficstars

The plugin shows in Mattermost only 20 issues, notes etc.

In my case. I have 66 Issues and 24 notes in gitlab. gitlab

But unfortunately the Plugin shows only 20 at maximum. mm

Same to the note list with /gitlab todo list

The problem is, that every API call is limited to 20 respond objects in default and 100 in max.

https://docs.gitlab.com/ee/api/#pagination

Could you please implement an iteration to respect all pagination sites, so that the value for issues, notes etc. are correct?

Thx a lot :)

nippold avatar Nov 27 '20 11:11 nippold

@hanzei I would like to work on this but I don't have any visual understanding of this. (unable to setup local runtime)

tw-ayush avatar Feb 09 '21 13:02 tw-ayush

@tw-ayush Thanks for taking a shot! This bug can be fixed without a local setup. The gist is that all List API calls needs to make use pagination.

hanzei avatar Feb 09 '21 14:02 hanzei

@hanzei is it up for grab? I can have a look at this one. I also believe there should not be any front-end changes required.

tw-ayush avatar Feb 21 '21 16:02 tw-ayush

@tw-ayush All yours! Currect, there should be no front-end changed needed.

hanzei avatar Feb 22 '21 09:02 hanzei

Okay a quick question: when you call /gitlab todo it makes several call to get unreads, assignments, merged, etc. So this doesn't look like a good idea to ask the caller to pass in the page info [page number and size]. So the possible solution is to iterate over these calls multiple time unless you have all the data(read all the data from gitlab). does it sound right to you as well. Or were you thinking something else when you mentioned the solution?

tw-ayush avatar Feb 24 '21 13:02 tw-ayush

@tw-ayush Exactly. The Responsehttps://pkg.go.dev/github.com/xanzy/go-gitlab#Response) send by GitLab contains information about the next page, which should be used for pagination.

hanzei avatar Mar 04 '21 20:03 hanzei