Renovate: BUG: findFiles not working on GitLab repos with >20 Files

Created on 17 Oct 2017  路  6Comments  路  Source: renovatebot/renovate

With #945 and #950 you've introduced the findFiles method for Gitlab. Unfortunately, this is not working on repos with more than 20 Files.

Reason

You are calling the Tree API: GET /projects/:id/repository/tree in line 132

This request has two not documented query params: page which defaults to 1 and per_page which defaults to 20 and has a max of 100.

Solution

The /tree request returns the LINK header values for next, first and last. This should allow to loop over all files.

As alternative there is a not documented gitlab endpoint, which list all files from a repo at once. This endpoint is part of the UI to enable file search, so I'm not sure how stable this endpoint is:
http://gitlab.com/${USER}/${REPO}/files/${BRANCH}?format=json

priority-3-normal bug

All 6 comments

Thank you for the detailed bug report and sorry for the inconvenience caused. I'll try to fix within next hour or two.

@reicheltp although adding pagination support is something I plan to add imminently, I think this particular problem may actually be caused by a typo. See #963

Please try version 9.85.1 and confirm if now working or reopen if not, thanks.

Unfortunately, it's not currently not working for me.

First there was a problem with file encoding, I send a fix (#993).
Second I ran into another error, where I'm not sure if this relates or is another problem.

Error updating branch: You can only create or edit files when you are on a branch (400)

I will dig further and file an issue/PR, if I found the problem.

This is probably a separate issue, but I can reply here for now.

Error updating branch: You can only create or edit files when you are on a branch (400)

When is this occurring? e.g. during creation of renovate/configure branch, or later on?

Error was on my fault. IDEA has created an empty line at the end of the *-name.hbs files which caused a \r at the end of the branch names, which caused the 400 error.

Was this page helpful?
0 / 5 - 0 ratings