Skip to content

Adding the gitlab api pagination support #2

Open
duckty wants to merge 18 commits intomonokh:masterfrom
duckty:master
Open

Adding the gitlab api pagination support #2
duckty wants to merge 18 commits intomonokh:masterfrom
duckty:master

Conversation

@duckty
Copy link

@duckty duckty commented Jan 23, 2019

gitlab api support pagination.

page | Page number (default: 1)
per_page | Number of items to list per page (default: 20)

the current app doesn't support to retrieve the project items more than 20.
ref: https://docs.gitlab.com/ee/api/README.html#pagination.

I added the pagination support for getProjects function

For next fix, I should add the pagination support for getProjectMergeRequests function too

Copy link
Owner

@monokh monokh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing! I've left a few comments

src/gitlab.js Outdated

// console.log('projects', projects.length);
return projects;
} catch(e) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer not to swallow errors here and let it bubble up to the user

@@ -1,34 +1,181 @@
{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see quite a few new libraries being added in the lock file. This shouldn't be needed, from what I see there are no new dependencies that the library requires. Could we revert this file?

Copy link
Author

@duckty duckty Jan 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used var request = require('request-promise-native'); to get the response headers

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

Successfully merging this pull request may close these issues.

2 participants