-
Notifications
You must be signed in to change notification settings - Fork 62
Conversation
Linting the helm templates fail, eg:
We can't use |
#165 Should unblock this PR. |
be694cc
to
9de4f1d
Compare
Rebased on top of master to include #165. |
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.
Awesome work! This is the way to go with Python + Bazel!
9de4f1d
to
7041b3f
Compare
Many thanks for the review :). Also, I'm quite embarrassed by the simple mistakes I did. I have fixed the typos and force-pushed with new changes, which I think it's gonna be cleaner:
|
Python 3 compatibility is yet unreleased, pin commit for now.
Pip3 install yamllint by performing a 2-step process, first declare a pip repostory with pip_repositories(), and then install the module and dependencies with pip_install(). Pip needs to be executed at WORKSPACE-evaluation time. Call yamllint by wrapping it on `dev/linters/run_yamllint.py`, using py_binary() bazel function.
Use relaxed rules for only errors, don't check ./deploy/helm/kubecf/* as it contains helm templates, but check ./deploy/helm/kubecf/values.* .
7041b3f
to
3f92af2
Compare
Rebased on top of master to fix conflicts. |
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.
Thanks for the changes!
Description
This PR adds yaml linting to the dev/ scripts and gitlab, which lints for yaml files, excluding
deploy/helm/kubecf/*
, as those are helm templates that should be better linted withhelm lint
.To achieve it, it adds a bazel target
//dev/linters:yamllint
to install the yamllint python module, and a python wrapper to call it. I haven't found any other way in Bazel to pull a python module and then call it.It provides the script
dev/linters/yamllint.sh
that calls the python wrapper. And it updates.gitlab-ci.yaml
to call this last script.Bazel's pip_install() doesn't install pip, so this PR needs f0rmiga/bazel-docker-image#3.
Motivation and Context
How Has This Been Tested?
I have tested it locally by running
dev/linters/yamllint.sh
.I have tested it against gitlab-ci by editing the
.gitlab-ci.yaml
tozypper in pip
, and runninggitlab-runner exec docker lint
.Screenshots (if appropriate):
Types of changes
Checklist: