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

Automatic PR generation fails to push #530

Open
mikaelarguedas opened this issue May 5, 2021 · 5 comments
Open

Automatic PR generation fails to push #530

mikaelarguedas opened this issue May 5, 2021 · 5 comments
Assignees

Comments

@mikaelarguedas
Copy link
Contributor

Last night the foxy and rolling images were out of date and CI tried to creat PRs to update them but failed with:

    HUB_REPO: ros
    HUB_RELEASE: rolling
    HUB_OS_NAME: ubuntu
    HUB_OS_CODE_NAME: focal
Traceback (most recent call last):
HUB_REPO:  ros
  File "/home/runner/work/docker_images/docker_images/.ci/ci_script.py", line 158, in main
HUB_RELEASE:  rolling
    test_diffs(diffs)
HUB_OS_NAME:  ubuntu
  File "/home/runner/work/docker_images/docker_images/.ci/ci_script.py", line 51, in test_diffs
HUB_OS_CODE_NAME:  focal
Error:     raise ValueError('Autogenerated files are not up to date')
GIT_UPSTREAM_REPO_SLUG:  osrf/docker_images
ValueError: Autogenerated files are not up to date

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/work/docker_images/docker_images/.ci/ci_script.py", line 224, in main
    repo.git.push(
  File "/opt/hostedtoolcache/Python/3.9.4/x64/lib/python3.9/site-packages/git/cmd.py", line 545, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.9.4/x64/lib/python3.9/site-packages/git/cmd.py", line 1011, in _call_process
    return self.execute(call, **exec_kwargs)
  File "/opt/hostedtoolcache/Python/3.9.4/x64/lib/python3.9/site-packages/git/cmd.py", line 828, in execute
    raise GitCommandError(command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
  cmdline: git push --force upstream_pr ros/rolling/ubuntu/focal:ros/rolling/ubuntu/focalNone

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/work/docker_images/docker_images/.ci/ci_script.py", line 279, in <module>
    main()
  File "/home/runner/work/docker_images/docker_images/.ci/ci_script.py", line 228, in main
    raise ValueError(
ValueError: Force push to branch:ros/rolling/ubuntu/focal failed! Stderr omitted to protect secrets.
---

@ruffsl FYI

@ruffsl
Copy link
Member

ruffsl commented May 5, 2021

Why is None appended to the end of the git push command?

  cmdline: git push --force upstream_pr ros/rolling/ubuntu/focal:ros/rolling/ubuntu/focalNone

@mikaelarguedas
Copy link
Contributor Author

I suspect this is a misleading print as we use the exact same string before and after the : Maybe something changed in the permissions / token of the osrf-docker-builder user? I do not have access to that account so am unable to look further into it.
Maybe @tfoote or @nuclearsandwich would know more ?
The last successful push was on April 28th
The first failed push was on May 5th

@tfoote
Copy link
Contributor

tfoote commented May 12, 2021

My best guess is that the keys used to push might have been invalidated? Possibly relating to codecov security @nuclearsandwich I see an attached specific key instead of leveraging single use github generated keys which I think can work for our use case: https://docs.github.com/en/actions/reference/authentication-in-a-workflow

@mikaelarguedas
Copy link
Contributor Author

@tfoote @nuclearsandwich Any news on this topic ? I would love to stop opening these PRs by hand ^^'

@ruffsl
Copy link
Member

ruffsl commented Mar 22, 2023

@tfoote @nuclearsandwich @sloretz with some current template changes:

we'll need this issue resolved so we can finally address:

Any updates?

I think our GITHUBTOKEN that was Personal Access Tokens from @osrf-docker-builder would need to be reissued.

https://github.com/osrf/docker_images/settings/secrets/actions


Alternatively, between the time that we first added our bot, it seems GitHub Actions marketplace supports this integration:

https://github.com/marketplace/actions/create-pull-request

@mikaelarguedas , it seems that the setting to allow GitHub Actions to create pull requests is already enabled for osrf/docker_images. I think we could also use this to open PR from our org's fork of docker-library/official-images:

There also seems to be a caveat on using automated PR to trigger automated workflows:

Note: If you want pull requests created by this action to trigger an on: push or on: pull_request workflow then you cannot use the default GITHUB_TOKEN. See the documentation here for workarounds.

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

No branches or pull requests

4 participants