pyupio / pyup

A tool to update your project's dependencies on GitHub. Runs on pyup.io, comes with a command line interface.
https://pyup.io
MIT License
454 stars 67 forks source link

gitlab support seems to be broken #374

Closed shield007 closed 4 years ago

shield007 commented 4 years ago

I've been using gitlab support within pyup for a while and it's worked, but now it seems to be broken. I'm guessing it was due to a gitlab API change.

If I run the command:

pyup --provider gitlab --repo=team/repo --user-token xxx --log DEBUG

I get the following output:

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): gitlab.com:443
DEBUG:urllib3.connectionpool:https://gitlab.com:443 "GET /api/v4/projects/team%2Frepo HTTP/1.1" 200 2690
INFO:pyup.providers.gitlab:Getting file at /.pyup.yml for branch master
DEBUG:urllib3.connectionpool:https://gitlab.com:443 "GET /api/v4/projects/11004625/repository/files/%2F%2Epyup%2Eyml?ref=master HTTP/1.1" 400 49
Traceback (most recent call last):
  File "/usr/local/bin/pyup", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pyup/cli.py", line 47, in main
    bot.update(branch=branch, initial=initial)
  File "/usr/local/lib/python3.8/site-packages/pyup/bot.py", line 121, in update
    self.configure(**kwargs)
  File "/usr/local/lib/python3.8/site-packages/pyup/bot.py", line 105, in configure
    repo_config = self.get_repo_config(
  File "/usr/local/lib/python3.8/site-packages/pyup/bot.py", line 74, in get_repo_config
    content, _ = self.provider.get_file(repo, "/.pyup.yml", branch)
TypeError: cannot unpack non-iterable NoneType object

I've done a bit of debugging using the curl command and the gitlab API's. I think the problem is the way it looks up the .pyup.yml file. If I use the query path from the above logs, then it does not work. But if I change the path to /api/v4/projects/11004625/repository/files/%2Epyup%2Eyml?ref=master then it does work.