chart-testing-action icon indicating copy to clipboard operation
chart-testing-action copied to clipboard

Provide a helpful error when the target-branch is wrongly configured

Open ctron opened this issue 5 years ago • 4 comments

I created a new repository, and named the master branch main. Running the lint command failed with a weird error message:

…
Digest: sha256:b7bb1e485c9a7ff67f448ebf9bb54db2cf49150b4f71a3620a87b8f85c32d2d4
Status: Downloaded newer image for quay.io/helmpack/chart-testing:v3.0.0
01ae6f5ccb65b12eb7faa050bcf39fb8526bca8866fb88eecf556e06af7ed699

Error: Error running process: exit status 128
Removing ct container...
Done!

I took me a while to figure out that the linter requires a default branch named master. I know it is possible to re-configure using:

target-branch: main

However, I think that:

  • There should be a proper warning: Branch "master" not found
  • There should be some prominent piece of documentation

ctron avatar Aug 26 '20 09:08 ctron

+1 - ran into this myself. If you run the ct command natively it will provide more output. I believe this is because the stdout is lost in the docker run of ct and not piped out to the console, hence you are left with only the error-code.

davidkarlsen avatar Aug 29 '20 21:08 davidkarlsen

That's a weird one. I can reproduce it with the GitHub action. For some reason stderr seems to get lost. However, when I run ct locally in Docker the same way the action does, I get a better error message as expected.

$ docker run --rm -ti -v $(pwd):/workdir --workdir /workdir --detach --network host --name ct quay.io/helmpack/chart-testing:v3.1.1 cat
a784466f568784ea490abe50b0294cf710ca761d988fcbfd575400928d3fde1c

$ docker exec -i ct ct lint --target-branch foo
Linting charts...
------------------------------------------------------------------------------------------------------------------------
No chart changes detected.
------------------------------------------------------------------------------------------------------------------------
Error: Error linting charts: Error identifying charts to process: Error running process: exit status 128
Error linting charts: Error identifying charts to process: Error running process: exit status 128

unguiculus avatar Sep 26 '20 15:09 unguiculus

I can replicate both @ctron and @unguiculus errors, tried to solve the issue on github actions by debugging it locally, same error as mention above.

Update: Following this comment: https://github.com/helm/chart-testing-action/issues/25#issuecomment-687795744 I've managed to solve the issue by using configuration file, you can see the solution here: https://github.com/noygal/helm-github-pages-example/tree/main/.github

noygal avatar Oct 17 '20 21:10 noygal

+1, I encountered the same error.

jenting avatar May 25 '22 02:05 jenting

closing due inactivity and looks like there is an workaround

cpanato avatar Sep 27 '22 12:09 cpanato