Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyUP not sending PRs for requirements inside project_slug #1966

Closed
browniebroke opened this issue Mar 18, 2019 · 5 comments
Closed

PyUP not sending PRs for requirements inside project_slug #1966

browniebroke opened this issue Mar 18, 2019 · 5 comments

Comments

@browniebroke
Copy link
Member

Looking at our dashboard in PyUP, it seems the service doesn't see the requirements under project_slug anymore:

Screenshot 2019-03-18 at 10 07 29

I noticed as Flower received an update more than 2 days ago, but no pull request open yet. It can take some time usually, but this looks quite long now.

I've tried to create a config file to explicitly point at our files, but it doesn't seem to help.

@browniebroke
Copy link
Member Author

browniebroke commented Mar 19, 2019

I've just run the PyUP bot manually to see if there were any errors in the logs but nothing showed up:

> pyup --repo=pydanny/cookiecutter-django --user-token=*** --initial
Update tox from 3.6.1 to 3.7.0: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:02<00:00,  1.23s/it]

A pull request was opened: #1970, which includes an update of the root requirements.txt, but nothing regarding the nested ones.

Installed PyUP from their master branch (1.0.3 unreleased on PyPI).

@browniebroke
Copy link
Member Author

browniebroke commented Mar 19, 2019

When running 1.0.2 released on PyPI, I get this:

Update flake8 from 3.7.6 to 3.7.7:   0%|                                                                                                                                                                                | 0/2 [00:00<?, ?it/s]ERROR:pyup.providers.github:Unable to create commit on Repository(full_name="pydanny/cookiecutter-django") for path /requirements.txt
Traceback (most recent call last):
  File "/Users/brunoalla/PycharmProjects/perso/pyupcli/venv/lib/python3.6/site-packages/pyup/providers/github.py", line 173, in create_commit
    **extra_kwargs
  File "/Users/brunoalla/PycharmProjects/perso/pyupcli/venv/lib/python3.6/site-packages/github/Repository.py", line 1715, in update_file
    input=put_parameters
  File "/Users/brunoalla/PycharmProjects/perso/pyupcli/venv/lib/python3.6/site-packages/github/Requester.py", line 264, in requestJsonAndCheck
    return self.__check(*self.requestJson(verb, url, parameters, headers, input, self.__customConnection(url)))
  File "/Users/brunoalla/PycharmProjects/perso/pyupcli/venv/lib/python3.6/site-packages/github/Requester.py", line 275, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.GithubException: 422 {'message': 'path cannot start with a slash', 'errors': [{'resource': 'Commit', 'field': 'path', 'code': 'invalid'}], 'documentation_url': 'https://developer.github.com/v3/repos/contents/#update-a-file'}
Traceback (most recent call last):
  File "/Users/brunoalla/PycharmProjects/perso/pyupcli/venv/bin/pyup", line 10, in <module>
    sys.exit(main())
  File "/Users/brunoalla/PycharmProjects/perso/pyupcli/venv/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/brunoalla/PycharmProjects/perso/pyupcli/venv/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/brunoalla/PycharmProjects/perso/pyupcli/venv/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/brunoalla/PycharmProjects/perso/pyupcli/venv/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/brunoalla/PycharmProjects/perso/pyupcli/venv/lib/python3.6/site-packages/pyup/cli.py", line 45, in main
    bot.update(branch=branch, initial=initial)
  File "/Users/brunoalla/PycharmProjects/perso/pyupcli/venv/lib/python3.6/site-packages/pyup/bot.py", line 125, in update
    scheduled=kwargs.get("scheduled", False)
  File "/Users/brunoalla/PycharmProjects/perso/pyupcli/venv/lib/python3.6/site-packages/pyup/bot.py", line 202, in apply_updates
    updates=updates,
  File "/Users/brunoalla/PycharmProjects/perso/pyupcli/venv/lib/python3.6/site-packages/pyup/bot.py", line 427, in commit_and_pull
    committer=self.bot if self.bot_token else self.user,
  File "/Users/brunoalla/PycharmProjects/perso/pyupcli/venv/lib/python3.6/site-packages/pyup/providers/github.py", line 182, in create_commit
    raise e
  File "/Users/brunoalla/PycharmProjects/perso/pyupcli/venv/lib/python3.6/site-packages/pyup/providers/github.py", line 173, in create_commit
    **extra_kwargs
  File "/Users/brunoalla/PycharmProjects/perso/pyupcli/venv/lib/python3.6/site-packages/github/Repository.py", line 1715, in update_file
    input=put_parameters
  File "/Users/brunoalla/PycharmProjects/perso/pyupcli/venv/lib/python3.6/site-packages/github/Requester.py", line 264, in requestJsonAndCheck
    return self.__check(*self.requestJson(verb, url, parameters, headers, input, self.__customConnection(url)))
  File "/Users/brunoalla/PycharmProjects/perso/pyupcli/venv/lib/python3.6/site-packages/github/Requester.py", line 275, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.GithubException: 422 {'message': 'path cannot start with a slash', 'errors': [{'resource': 'Commit', 'field': 'path', 'code': 'invalid'}], 'documentation_url': 'https://developer.github.com/v3/repos/contents/#update-a-file'}

Looks like an issue with on PyUP side which appears fixed on master, it's adding an extra / to the paths.

@browniebroke
Copy link
Member Author

browniebroke commented Mar 19, 2019

When running on 1.0.3 with the forward slash fixes, I'm getting a warning like this when using --log=DEBUG:

WARNING:pyup.providers.github:Unable to get {{cookiecutter.project_slug}}/requirements/local.txt on pydanny/cookiecutter-django
INFO:pyup.bot:Adding requirement file at {{cookiecutter.project_slug}}/requirements/production.txt
INFO:pyup.providers.github:Getting file at {{cookiecutter.project_slug}}/requirements/production.txt for branch master
DEBUG:urllib3.connectionpool:https://api.github.com:443 "GET /repos/pydanny/cookiecutter-django/contents/%257B%257Bcookiecutter.project_slug%257D%257D/requirements/production.txt?ref=master HTTP/1.1" 404 None

@browniebroke
Copy link
Member Author

I've set up a Lambda function to every the version of PyUP with the patch every hour. This is using my Github token, so incoming PRs will appear as me. Let's see how this go!

@browniebroke
Copy link
Member Author

Forgot about this, it's solved, now, we've received some updates recently.

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

No branches or pull requests

2 participants