dailymotion-oss / octopilot

Automate your Gitops workflow, by automatically creating/merging GitHub Pull Requests

Home Page:https://dailymotion-oss.github.io/octopilot/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

failed to update repository fro Octopilot Yaml updater

topeawolwo opened this issue · comments

Having this issue with Octopilot in my Githubaction workflow

``
time="2023-06-02T10:00:01Z" level=error msg="Repository update failed" error="failed to update repository xxxxxxx/manifest-temp: failed to update repository oxygen-manifest-temp: failed to get value: failed to read file VERSION: open /tmp/octopilot4137132539/xxxxxx/oxygen-manifest-temp/VERSION: no such file or directory" repository=oxygen-manifest-temp
time="2023-06-02T10:00:01Z" level=info msg="Updates finished" repositories-count=1

``

Had gone through the docs : https://dailymotion-oss.github.io/octopilot/v1.0.10/index.html

``

      - name: Octo Command
        shell: bash
        run: |
              octopilot \
                --github-auth-method "token" \
                --github-token "${{ steps.xxx-githubrunner-test-token.outputs.token }}" \
                --github-app-id xxxxx \
                --github-installation-id xxxx \
                --pr-base-branch "main" \
                --git-branch-prefix "oxygen-update" \
                --repo "xxxx-manifest-temp" \
                --pr-merge "true" \
                --update "yaml(file=value.yaml,path='version')=file(path=VERSION)" \
                --strategy "recreate"

``

hi, do you have a VERSION file in your xxxx-manifest-temp repo?

@vbehar thanks for the response!, I am trying to update another hosted github repo containing this VERSION.yaml

""
imagetag: v1.0
version: 1.0.0

""

I want to update version: 1.0.0 to values: 2.0.0 using the --strategy "recreate"

oh then you should --update "yaml(file=value.yaml,path='version')=file(path=VERSION.yaml)" if the name of the file is VERSION.yaml (just adding the extension)

I am using https://github.com/dailymotion-oss/octopilot/releases/download/v1.2.7/octopilot_1.2.7_linux_amd64, could you let me know what is wrong with the code above

still having the same error, let me take the question again, this is my updated code in my Githubaction workflow :

octopilot
--github-auth-method "token"
--github-token "${{ steps.xxx-githubrunner-test-token.outputs.token }}"
--github-app-id xxxxx
--github-installation-id xxxx
--pr-base-branch "main"
--git-branch-prefix "oxygen-update"
--repo "xxxx-manifest-temp"
--pr-merge "true"
--update "yaml(file=values.yaml,path='app.values')=file(path=VALUES.yaml)"
--strategy "recreate"

            The remote Github repo I want to update xxxx-manifest-temp

            is having having this file in it MAIN branch base root


            ``
              app:
                imagetag: v1.0
                values: 1.0.0

            ``

The error from my Githubaction pipeline
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0} time="2023-06-02T15:54:19Z" level=error msg="Repository update failed" error="failed to update repository xxxxxxx/xxxxxx-manifest-temp: failed to update repository xxxxxxx/xxxxxx-manifest-temp: failed to get value: failed to read file VALUES.yaml: open github.com/xxxxx/xxxxx-manifest-temp/VALUES.yaml: no such file or directory" repository=xxxxx/xxxxx-manifest-temp time="2023-06-02T15:54:19Z" level=info msg="Updates finished" repositories-count=1

Another question! this line of code

is it

--update "yaml(file=values.yaml,path='app.values')=file(path='VALUES.yaml')" \

or

--update "yaml(file=values.yaml,path='app.values')=file(path=VALUES.yaml)" \

Hi,

the error is open github.com/xxxxx/xxxxx-manifest-temp/VALUES.yaml: no such file or directory - are you sure that you have a file named VALUES.yaml in the xxxxx-manifest-temp repository?

you can also try to use the --log-level=trace (or debug) flag, to get more logs. If you combine it with the --keep-files flag, it won't delete the cloned files, and you can find the path of the cloned repo in the logs, and check if there is a VALUES.yaml file there manually.

commented

thanks could you issue!