From ddb377df6d4a3516c875fa2af52fb9451af46d0c Mon Sep 17 00:00:00 2001 From: Gage Hugo Date: Mon, 1 Nov 2021 18:03:04 -0500 Subject: [PATCH] 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 --- playbooks/lint.yml | 12 ++++++++++++ zuul.d/jobs.yaml | 11 +++++++++++ zuul.d/project.yaml | 2 ++ 3 files changed, 25 insertions(+) diff --git a/playbooks/lint.yml b/playbooks/lint.yml index 2a1e93eed..737e16aa2 100644 --- a/playbooks/lint.yml +++ b/playbooks/lint.yml @@ -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 ... diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 0e54101af..d63b4443e 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -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 diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index f57581e8c..01a3bcf2d 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -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