Skip to content

Conversation

@Jonathan-Fan
Copy link
Contributor

Based on gitlab api doc, the default items number per-page is 20, so if the project has more than 20 variables, current listVariables function won't be able to list all of them.

Brief workflow for updated listVariables:

  • retrieve total number of pages
  • get variables for each page and combine them together
  • return all of them

@quangkhoa
Copy link
Contributor

The code looks good.

However, would it be simpler to set the number of items per page to 100 on the query string, e.g. per_page=100? Then it's just 1 http call. IMHO, it's crazy to have more than 100 variables on a gitlab project.

@brendo
Copy link
Contributor

brendo commented Dec 28, 2017

Tend to agree with @quangkhoa here. While the code is great and clean, we can prevent introducing any complexity by requesting 100 at a time.

@Jonathan-Fan
Copy link
Contributor Author

Closed this one and opened another PR: https://github.com/temando/gitlab-ci-variables-cli/pull/9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants