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
444 stars 67 forks source link

Gitlab Provider: requirements.txt located in subfolder causes Commit Not Found error #287

Open sliverc opened 6 years ago

sliverc commented 6 years ago

In our project we have the following .pyup.yml configuration:

search: False
requirements:
        - django/requirements.txt:
                update: all
                pin: True
        - django/requirements-dev.txt:
                update: all
                pin: True

When running pyup this leads to following error:

Traceback (most recent call last):
  File "versions/bin/pyup", line 11, in <module>
    sys.exit(main())
  File "versions/3.6.4/envs/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "versions/3.6.4/envs/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "versions/3.6.4/envs/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "versions/3.6.4/envs/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "versions/3.6.4/envs/lib/python3.6/site-packages/pyup/cli.py", line 45, in main
    bot.update(branch=branch, initial=initial)
  File "versions/3.6.4/envs/lib/python3.6/site-packages/pyup/bot.py", line 121, in update
    scheduled=kwargs.get("scheduled", False)
  File "versions/3.6.4/envs/lib/python3.6/site-packages/pyup/bot.py", line 198, in apply_updates
    updates=updates,
  File "versions/3.6.4/envs/lib/python3.6/site-packages/pyup/bot.py", line 423, in commit_and_pull
    committer=self.bot if self.bot_token else self.user,
  File "versions/3.6.4/envs/lib/python3.6/site-packages/pyup/providers/gitlab.py", line 138, in create_commit
    f = repo.files.get(file_path=path, ref=branch)
  File "versions/3.6.4/envs/lib/python3.6/site-packages/gitlab/base.py", line 99, in get
    return self.obj_cls.get(self.gitlab, id, **args)
  File "versions/3.6.4/envs/lib/python3.6/site-packages/gitlab/base.py", line 274, in get
    return cls(gl, id, **kwargs)
  File "versions/3.6.4/envs/lib/python3.6/site-packages/gitlab/base.py", line 387, in __init__
    data = self.gitlab.get(self.__class__, data, **kwargs)
  File "versions/3.6.4/envs/lib/python3.6/site-packages/gitlab/__init__.py", line 468, in get
    raise_error_from_response(r, GitlabGetError)
  File "versions/3.6.4/envs/lib/python3.6/site-packages/gitlab/exceptions.py", line 230, in raise_error_from_response
    response_body=response.content)
gitlab.exceptions.GitlabGetError: 404: 404 Commit Not Found

I checked when requirements.txt is in the root folder it seems to work, but not if it is in a subfolder.

bluespider42 commented 6 years ago

Is there any news on this?

rafaelpivato commented 4 years ago

If you are still experiencing this, can you please turn --log DEBUG on and return results? My suspect is that it might relate to the slash on the config file not being quoted properly.

sliverc commented 4 years ago

I unfortunately do not have access to a GitLab instance anymore where this issue occurred.

@bluespider42 can you still reproduce this issue?