Closed BartoszZawadzki closed 1 year ago
It's worth mentioning that all steps before this pass successfully (ct lint)
I ran into this today with ct v3.7.1, and it seemed to be relate to the git command returning with error 128:
[pid 154575] execve("/sbin/git", ["git", "merge-base", "origin/master", "HEAD"], 0xc0000aa000 /* 64 vars */ <unfinished ...>
[pid 154575] <... execve resumed>) = 0
[pid 154575] write(2, "fatal: Not a valid object name origin/master\n", 45) = 45
[pid 154575] exit_group(128 <unfinished ...>
[pid 154575] <... exit_group resumed>) = ?
[pid 154575] +++ exited with 128 +++
To debug this on your end, I suggest invoking ct lint
with strace
, such as:
strace -s 1024 -f ct lint 2>&1 | egrep 'execve|write|exit'
The error you are seeing could be related to any number of git problems, but for myself, the workaround was to use ct lint --target-branch main
.
It'd be nice if ct
output the error message from git
instead of swallowing it.
You can see there is an output No chart changes detected.
in the error messages of ct install
.
It is caused by the step list-changed
. Because there are no chart changes detected, this command will still make the changed
true.
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
Becase the output of ct list-changed
will have other strings even if the chart is not changed. So the check of if [[ -n "$changed" ]]
will always be true.
Linting charts...
>>> helm version --template {{ .Version }}
>>> git rev-parse --is-inside-work-tree
>>> git merge-base origin/main HEAD
>>> git diff --find-renames --name-only c8b9381a98059c07b5b65510b8162c5df3f43cd0 -- charts
The output with chart changes will output a chart name, like this.
Found changes
>>> helm version --template {{ .Version }}
>>> git rev-parse --is-inside-work-tree
>>> git merge-base origin/main HEAD
>>> git diff --find-renames --name-only c8b9381a98059c07b5b65510b8162c5df3f43cd0 -- charts
charts/pulsar-resources-operator
hello, I was not able to reproduce this issue, see https://github.com/cpanato/testing-ci-providers/actions/runs/4510324297/jobs/7941131580?pr=1802
the workflow
name: Lint and Test Charts
on:
pull_request:
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.11.0
- uses: actions/setup-python@v4
with:
python-version: '3.9'
check-latest: true
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.3.1
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config ct.yaml --target-branch ${{ github.event.repository.default_branch }}
- name: Create kind cluster
uses: helm/kind-action@v1.5.0
if: steps.list-changed.outputs.changed == 'true'
- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --config ct.yaml --target-branch ${{ github.event.repository.default_branch }}
will close this issue, but feel free to reopen or open a new one
Hi,
I'm trying to use this but it fails on:
My wokrflow: