-
Notifications
You must be signed in to change notification settings - Fork 18
[CLOUDP-343558] Run helm chart-testing tool ct
as part of CI (lint_repo
)
#450
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
base: master
Are you sure you want to change the base?
Conversation
Somehow all the efforts to set path env var using below code ``` - command: subprocess.exec type: test params: add_to_path: - ${workdir}/bin - ${workdir}/venv/bin working_dir: src/github.com/mongodb/mongodb-kubernetes binary: scripts/evergreen/lint_helm_chart.sh ``` I even tried to remove `subprocess.exec` and use `shell.exec` and used `env:` for params, that didn't work as well. that's why we are finally settling on to setting path at the lowest level. Otherwise `ct` CLI resulted into `yamale` and `yamllint` are not found.
MCK 1.3.1 Release Notes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good, still I have one general ask.
When we add or change logic in our linting requirements we should also consider adding them to .githooks/pre-commit
. Otherwise there is no way locally to lint the helm charts.
Secondly we should make scripts that are run in EVG CI easy to run locally as well. I wouldn't put them in scripts/evergreen/
directory, but in scripts/helm
and make them available for developers. I think also .githooks/pre-commit
takes care of installing all prerequisite applications.
@@ -420,3 +420,8 @@ prepare-local-olm-e2e: | |||
|
|||
prepare-operator-configmap: # prepares the local environment to run a local operator | |||
source scripts/dev/set_env_context.sh && source scripts/funcs/printing && source scripts/funcs/operator_deployment && prepare_operator_config_map "$(kubectl config current-context)" | |||
|
|||
# Lint the helm chart using helm chart-testing tool (`ct`) using the default configuration available at `helm_chart/tests/schemas/` | |||
lint-chart: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about target for installing chart-testing
locally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both scripts should not be in scripts/evergreen/
dir, they can be used outside of evg
Summary
Whenever we raised PR in to helm chart repo CI failed there because we had linting issues in our helm chart. A previous PR that I raised fixed the linting problem. But we should have a linting mechanism in our CI that would consistently check if we have made any mistake in our charts. This PR does that.
The
chart_schema.yaml
andlintconf.yaml
are the default yaml files using whichct
should be run. Andct
is the tool that is used for linting in our helm charts repo.Proof of Work
Passing
lint_repo
task here https://spruce.mongodb.com/version/68c43aae1d5d5d000770c624/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC and in this PR as well.Checklist
skip-changelog
label if not needed