Skip to content

Commit 666cdf3

Browse files
Fix chart linting issue in evg/run_pre_commit task (#470)
# Summary The helm chart linting functionality is added as part on `lint_repo` task eventually called our precommit script. Apart from the lint_repo task, precommit script also gets called from the evg task `evg/run_pre_commit`. And when it's run via `evg/run_pre_commit` it's failing, because `ct` is not found. We forgot to update the `evg/run_pre_commit` task to setup `ct` because it's doesn't get run in PR patches. Since this task (`evg/run_pre_commit`) doesn't get executed as part of PR patches, we didn't face this problem in PR patches. But we got to know about it from [a PR](#468) that dependabot raises. In PR patches the task `evg/run_pre_commit` gets run but the precommit script doesn't actually get executed because it's requires the branch name to be in [specific format](https://github.com/mongodb/mongodb-kubernetes/blob/master/scripts/evergreen/precommit_bump.sh#L18). ## Proof of Work Successful CI in this PR. - Make sure lint_repo passes - Make sure run_pre_commit passes and it actually calls precommit, because this PR branch is named in the format `_version_bump`, that is expected by `run_pre_commit`. https://github.com/mongodb/mongodb-kubernetes/blob/master/scripts/evergreen/precommit_bump.sh#L18 ## Checklist - [ ] Have you linked a jira ticket and/or is the ticket in the title? - [x] Have you checked whether your jira ticket required DOCSP changes? - [x] Have you added changelog file? - use `skip-changelog` label if not needed - refer to [Changelog files and Release Notes](https://github.com/mongodb/mongodb-kubernetes/blob/master/CONTRIBUTING.md#changelog-files-and-release-notes) section in CONTRIBUTING.md for more details
1 parent be29e59 commit 666cdf3

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.evergreen-functions.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,15 @@ functions:
242242
- ${workdir}/bin
243243
binary: scripts/dev/setup_evg_host.sh
244244

245+
setup_chart_testing_cli: &setup_chart_testing_cli
246+
command: subprocess.exec
247+
type: setup
248+
params:
249+
working_dir: src/github.com/mongodb/mongodb-kubernetes
250+
add_to_path:
251+
- ${workdir}/bin
252+
command: scripts/dev/setup_chart_testing_cli.sh
253+
245254
lint_repo:
246255
- command: subprocess.exec
247256
type: setup
@@ -250,13 +259,7 @@ functions:
250259
add_to_path:
251260
- ${workdir}/bin
252261
command: scripts/evergreen/setup_yq.sh
253-
- command: subprocess.exec
254-
type: setup
255-
params:
256-
working_dir: src/github.com/mongodb/mongodb-kubernetes
257-
add_to_path:
258-
- ${workdir}/bin
259-
command: scripts/dev/setup_chart_testing_cli.sh
262+
- *setup_chart_testing_cli
260263
- command: subprocess.exec
261264
type: test
262265
params:

.evergreen.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ tasks:
311311
- command: github.generate_token
312312
params:
313313
expansion_name: GH_TOKEN
314+
- func: setup_chart_testing_cli
314315
- command: subprocess.exec
315316
type: setup
316317
params:

0 commit comments

Comments
 (0)