Renovate: hosted-gitlab/api/v3/projects/project/repository/tree not returning path attribute

Created on 11 Dec 2017  路  3Comments  路  Source: renovatebot/renovate

I just tried Renovate on a private GitLab repository and could not get it to work. It seems it's because GitLab API project/repository/tree is not returning the path of the files.

Version : GitLab 8.12.6 fa20b51

$ cat .env
GITLAB_TOKEN=deadbeef
GITLAB_ENDPOINT=https://gitlab.mydomain/api/v3/
$ envfile .env -- yarn renovate --platform gitlab  my-project/my-repo

Error

 INFO: Renovating repository
 INFO: renovateRepository loop 1
DEBUG: initRepo(myrepository)
DEBUG: Determining Gitlab API version
DEBUG: Detected Gitlab API v3
DEBUG: myrepository default branch = master
DEBUG: getCommitMessages
DEBUG: No semantic commit type found
DEBUG: No renovate.json found
DEBUG: Checking if repo is onboarded
DEBUG: findPr(renovate/configure, Configure Renovate, all)
DEBUG: Creating onboarding branch
ERROR: Failed to process repository: Cannot read property 'includes' of undefined
DEBUG: Cannot read property 'includes' of undefined
       "err": {}

No stacktrace here (I had --log-lovel debug). Added a console.log to log the error.

TypeError: Cannot read property 'includes' of undefined
    at /Users/pbrowne/code/renovate-heroku/node_modules/renovate/dist/manager/index.js:11:21
    at Array.some (<anonymous>)
    at /Users/pbrowne/code/renovate-heroku/node_modules/renovate/dist/manager/index.js:10:34
    at Array.filter (<anonymous>)

https://github.com/renovateapp/renovate/blob/7e6befe4a833909f32328c52d4b6bbe6ba6bae22/lib/workers/repository/onboarding/branch/check.js#L5

Added a second console.log to check the files.

    const files = (yield config.api.getFileList())
    console.log(files)
    const fileList = files.filter(function (file) {

Result :

[ undefined,
  undefined,
  undefined,
  undefined,
  undefined,

It seems Renovate is building a list of things that get to be undefined.

https://github.com/renovateapp/renovate/blob/7e6befe4a833909f32328c52d4b6bbe6ba6bae22/lib/platform/gitlab/index.js#L124

It seems on my version of the API, path are not returned.

$ curl --header "Private-Token: $TOKEN" 'https://gitlab.mydomain/api/v3/projects/myproject/repository/tree?ref=master&recursive=true&per_page=100'
[
...
  {
    "id": "c0e847ef59d0a48ca9204ca0ff3b9ac4de88018a",
    "name": "yarn.lock",
    "type": "blob",
    "mode": "100644"
  }
...
]
priority-3-normal docs

All 3 comments

Hi @ptbrowne, thanks for raising the issue. We actually deprecated v3 of GitLab API in [email protected]. Are you planning to upgrade your GitLab version any time soon?

Looking at npmjs data, it looks like the last 9.x release was "9.100.0". I don't plan to backport any features or fixes to 9.x but it should still work with the v3 API. I am not 100% sure if this causes the path problem, but I'm pretty sure there's no way you can get Renovate 10.x to work with GitLab v3 anyway.

Also not to self: we should make it clear somewhere in the docs about GitLab API version support.

We actually deprecated v3 of GitLab API in [email protected].

OK I'll try to update my GitLab then.

Also not to self: we should make it clear somewhere in the docs about GitLab API version support.

馃憤

Thanks for the quick support !

Oops, I reopen for the docs thing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Flydiverny picture Flydiverny  路  4Comments

Arcanemagus picture Arcanemagus  路  4Comments

zephraph picture zephraph  路  3Comments

ChristianMurphy picture ChristianMurphy  路  4Comments

amilajack picture amilajack  路  3Comments