Test linting osh on helm-toolkit changes

Since most of the charts in both openstack-helm and
this repo use helm-toolkit, changes in helm-toolkit
have the possibility of impacting charts in the
openstack-helm repo and will not be caught in testing
here.

This change adds a conditional linter to lint the
charts in the openstack-helm repo if any changes
to helm-toolkit are made.

Change-Id: I0f6a935eca53d966c01e0902e546ea132a636a9d
This commit is contained in:
Gage Hugo 2021-11-01 18:03:04 -05:00
parent b2dd2f77e9
commit ddb377df6d
3 changed files with 25 additions and 0 deletions

View File

@ -31,6 +31,12 @@
chdir: "{{ zuul.project.src_dir }}"
target: all
- name: make all osh
make:
chdir: "{{ zuul.project.src_dir }}/{{ zuul_osh_relative_path | default('../openstack-helm/') }}"
target: all
when: lint_osh is defined
- name: Prevent trailing whitespaces
shell: find . \! \( -path "*/\.*" -o -path "*/doc/build/*" -o -name "*.tgz" -o -name "*.png" \) -type f -exec egrep -l " +$" {} \;
register: _found_whitespaces
@ -66,4 +72,10 @@
args:
chdir: "{{ ansible_user_dir }}/src/{{ zuul.project.canonical_name }}"
when: yamllintconf.stat.exists == True
- name: Execute yamllint check for osh values* yaml files
command: tox -e lint
args:
chdir: "{{ zuul.project.src_dir }}/{{ zuul_osh_relative_path | default('../openstack-helm/') }}"
when: yamllintconf.stat.exists == True and lint_osh is defined
...

View File

@ -23,6 +23,17 @@
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- ^releasenotes/.*$
- job:
name: openstack-helm-lint-osh
parent: openstack-helm-lint
required-projects:
- openstack/openstack-helm
files:
- ^helm-toolkit/.*$
vars:
lint_osh: true
- job:
name: publish-openstack-helm-charts

View File

@ -20,6 +20,7 @@
check:
jobs:
- openstack-helm-lint
- openstack-helm-lint-osh
- openstack-helm-infra-bandit
- openstack-helm-infra-deploy
- openstack-helm-infra-aio-logging
@ -37,6 +38,7 @@
gate:
jobs:
- openstack-helm-lint
- openstack-helm-lint-osh
- openstack-helm-infra-aio-logging
- openstack-helm-infra-aio-monitoring
- openstack-helm-infra-openstack-support