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

Octopilot to create automated PR instead of using a manual human Pull Request #234

Open
chekly opened this issue Jun 5, 2023 · 11 comments

Comments

@chekly
Copy link

chekly commented Jun 5, 2023

I am using Octopilot in my GitubAction to create a PR instead of using a manual human Pull Request. I want to reproduce this (automated no human clicking)

image

following this documentation : https://dailymotion-oss.github.io/octopilot/v1.2.7/index.html#pull-request

The below command does not give automated Pull Request creation

                octopilot \
                --pr-merge "true" \
                --pr-merge-method "merge" \
                --pr-merge-commit-title "cadevce(deps): updating cadevce app" \
                --pr-merge-commit-message "{{ githubRelease (printf oxygen app) | expandGithubLinks | extractMarkdownURLs | md2txt }}" \
                --update "yaml(file=values.yaml,path='app.imagetags')=file(path='values.yaml')" \
                --strategy "recreate" \
                --pr-labels "octopilot-chuj" \
                --pr-body-update-operation "not applicable" \
                --pr-title "Updating files"
@chekly
Copy link
Author

chekly commented Jun 5, 2023

image

I want a PULL REQUEST to be created automated

@vbehar
Copy link
Collaborator

vbehar commented Jun 5, 2023

hi, can you please copy/paste the output of octopilot please? if needed you can also run it in a more verbose mode with the --log-level flag, set to debug or even trace

@chekly
Copy link
Author

chekly commented Jun 5, 2023

Hi in my team environment, we create PR manually. I am not having any error in using Octopilot. My team just want to know what commands to create automated PR instead of using a manual human Pull Request.

We want Octopilot to CREATE PR from a DEV branch and merge them into the the MAIN branch without human clicking

@chekly
Copy link
Author

chekly commented Jun 5, 2023

               We are using octopilot \
                            --strategy "recreate"  \
                            .....


               BUT PR and MERGE into MAIN BRANCH not created automatically!

@vbehar
Copy link
Collaborator

vbehar commented Jun 5, 2023

sorry I don't understand your issue. can you please copy/paste the whole octopilot command (with all the flags), and the output of this command?

usually if octopilot doesn't create a pull request, it's because there is nothing to change.

and if octopilot creates a PR but doesn't merge it automatically, it may be because the PR is not "mergeable". for example depending on your github settings, you may require extra steps (approval policy, ...)

@chekly
Copy link
Author

chekly commented Jun 5, 2023

My full octopilot command

``
octopilot
--github-auth-method "token"
--github-token "${{ steps.backstage-runner-test-token.outputs.token }}"
--github-app-id 300550
--github-installation-id 34466512
--git-clone-dir "github.com"
--repo "backstage/manifest-temple"
--pr-base-branch "main"
--pr-merge "true"
--pr-merge-method "merge"
--pr-merge-commit-title "oxygen(deps): updating oxygen apps"
--pr-merge-commit-message "{{ githubRelease (printf oxygen apps) | expandGithubLinks | extractMarkdownURLs | md2txt }}"
--update "yaml(file=values.yaml,path='app.imagetags')=file(path='values.yaml')"
--strategy "recreate"
--pr-labels "octopilot-chuj"
--pr-body-update-operation "not applicable"
--pr-title "Updating files"

  ``

i just want to create PR in an automated way!

@chekly
Copy link
Author

chekly commented Jun 5, 2023

The error from the GithubAction

``
time="2023-06-05T11:57:51Z" level=error msg="Repository update failed" error="failed to create Pull Request: failed to create a new Pull Request for repository backstage/manifest-temple: POST https://api.github.com/repos/backstage/manifest-temple/pulls: 403 Resource not accessible by integration []" repository=backstage/manifest-temple
time="2023-06-05T11:57:51Z" level=info msg="Updates finished" repositories-count=1

``

@chekly
Copy link
Author

chekly commented Jun 5, 2023

image

@chekly
Copy link
Author

chekly commented Jun 5, 2023

please do note this repository=backstage/manifest-temple exist internally!, the token attached to the Octopilot from the GithubApp token authentication gives full administration, content write and read

@vbehar
Copy link
Collaborator

vbehar commented Jun 5, 2023

from the error message POST https://api.github.com/repos/backstage/manifest-temple/pulls: 403 Resource not accessible by integration I think there's a permission issue somewhere - not related to octopilot.

I suggest to contact the github support or try to find something on google, such as actions/first-interaction#10 for example

@MPV
Copy link
Contributor

MPV commented Nov 20, 2023

@chekly I have gotten that to work — so just to say that it's possible (using a GitHub app). Have you tried using a token from the app using another method (i.e. curl/GH CLI) to verify that it works (is installed on your org?) and has the permissions you need?

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

No branches or pull requests

3 participants