-
Notifications
You must be signed in to change notification settings - Fork 211
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
Cannot lint charts in pipeline #186
Comments
Hi @g0blin79. I started experiencing the same issue today. It is not specific to my computer/user and abruptly started happening about 6 hours ago. Did you ever find a fix? |
Having a similar problem when running inside of a GitHub action. Here is the output. /usr/bin/docker run --name <redacted> --label f6cdeb --workdir /github/workspace --rm -e INPUT_ARGS -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/helm-charts/helm-charts":"/github/workspace" <redacted> lint --target-branch develop --chart-dirs . --chart-yaml-schema .github/actions/chart-testing-action/etc/chart_schema.yaml --lint-conf .github/actions/chart-testing-action/etc/lintconf.yaml --validate-maintainers=false --debug
Linting charts...
------------------------------------------------------------------------------------------------------------------------
Configuration
------------------------------------------------------------------------------------------------------------------------
Remote: origin
TargetBranch: develop
BuildId:
LintConf: .github/actions/chart-testing-action/etc/lintconf.yaml
ChartYamlSchema: .github/actions/chart-testing-action/etc/chart_schema.yaml
ValidateMaintainers: false
ValidateChartSchema: true
ValidateYaml: true
CheckVersionIncrement: true
ProcessAllCharts: false
Charts: []
ChartRepos: []
ChartDirs: [.]
ExcludedCharts: []
HelmExtraArgs:
HelmRepoExtraArgs: []
Debug: true
Upgrade: false
SkipMissingValues: false
Namespace:
ReleaseLabel:
------------------------------------------------------------------------------------------------------------------------
>>> git rev-parse --is-inside-work-tree
>>> git merge-base origin/develop HEAD
Error linting charts: Error identifying charts to process: Error running process: exit status 128
------------------------------------------------------------------------------------------------------------------------
No chart changes detected.
------------------------------------------------------------------------------------------------------------------------ |
|
Thanks for the insight on this @unguiculus. This turned my attention to the https://github.com/actions/checkout/releases/tag/v2-beta If you are using chart-testing with GitHub actions make sure to only use |
I can confirm this issue happens in gitlab as well. ct lint --debug --remote origin --target-branch master --chart-dirs stable --chart-repos xxx=yyy |
@unguiculus I added a "git fetch" per your recommendation. Now I no longer get a 128 exit code, but instead an exit code 1 with no logs at all. Any idea how to debug this? When would git merge-base return 1 with no logs? GIT_TRACE=1 didn't help either.
|
This issue is caused by your SCM creating a shallow clone. This leads to two git errors. error 128This is because there is no master branch with the shallow clone that most scm's create.
As it says, origin/master doesn't exist.
As has been discovered, you can overcome that by pulling in master:
error 1merge-base will still return errno 1 because this branch of your shallow clone is what's known as "grafted" meaning as far as git's concerned, it has no parents
To overcome that obsticle, you'll need to "unshallow" the branch checked out by CI
This will now allow merge-base to work
|
@coreywagehoft uses: actions/checkout@v2
with:
fetch-depth: "0" |
adding more details on charts manifest finalixing chart removed dependency on cert-manager removed blank lines and trailing spaces testing with different CI conf from helm/chart-testing#186 fix: helm testing library requires maintainers be configured addressing review comments fix: don't require cert-manager by default removing namespace reference re-adding namespace with reference to release fixying app version adding dependency cert-manager and added ci values trying to add a repo in ct conf" testing more removing trailing space removed ci.yml trying getting some more debug more testing and reading in https://github.com/helm/chart-testing/blob/master/doc/ct_install.md fixes trailing spaces" trying using helm native function for tls certificates
adding more details on charts manifest finalixing chart removed dependency on cert-manager removed blank lines and trailing spaces testing with different CI conf from helm/chart-testing#186 fix: helm testing library requires maintainers be configured addressing review comments fix: don't require cert-manager by default removing namespace reference re-adding namespace with reference to release fixying app version adding dependency cert-manager and added ci values trying to add a repo in ct conf" testing more removing trailing space removed ci.yml trying getting some more debug more testing and reading in https://github.com/helm/chart-testing/blob/master/doc/ct_install.md fixes trailing spaces" trying using helm native function for tls certificates
This worked for me in GitLab CI as well, by setting: variables:
GIT_DEPTH: "0" |
Took me some time to find the solution so I want to add it here: I'm also using Jenkins and in my case I had to add the following ref spec for the Git(Lab) branch source (so the main branch as the target branch is also available locally):
Also related to helm/chart-testing-action#25 |
This probably is not a bug, but only a problem I have and I don't understand why. I'm asking an help.
I start using
ct
for our company chart repository.Our charts are into a "stable" directory at the root of the repo.
If I try to lint my chart in local environment I do it with success.
But when I use the same command in my CI Environment (Gitlab Pipeline) I had this error:
Some infos:
In local development environment I run lint command using docker image, in this way:
`docker run -v $(pwd):/workdir gcr.io/kubernetes-charts-ci/test-image:v3.4.0 sh -c "ct lint --config .bmeme/config.yaml"
In pipeline, I tried running this command both native and with docker-in-docker: in both case I had the same error.
If I try to run same command with --debug option, I noticed the following differences about git commands:
local execution:
pipeline execution
Can you help me to debug this problem?
The text was updated successfully, but these errors were encountered: