diff --git a/playbooks/lint.yml b/playbooks/lint.yml index 070b1cd9b..af7c4d248 100644 --- a/playbooks/lint.yml +++ b/playbooks/lint.yml @@ -36,6 +36,13 @@ args: chdir: "{{ ansible_user_dir }}/src/{{ zuul.project.canonical_name }}" + - name: Check release note version matches + shell: ./tools/gate/reno-check.sh + args: + chdir: "{{ zuul.project.src_dir }}" + # TODO(gagehugo): Remove this when all the release notes are updated + ignore_errors: True + - name: Check if yamllint.conf exists stat: path: "{{ ansible_user_dir }}/src/{{ zuul.project.canonical_name }}/yamllint.conf" diff --git a/tools/gate/reno-check.sh b/tools/gate/reno-check.sh new file mode 100755 index 000000000..47c5f3f60 --- /dev/null +++ b/tools/gate/reno-check.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e + +RESULT=0 + +while read -r line; do + SERVICE=$(echo $line | awk '{ print $1 }' FS=':' | awk '{ print $2 }' FS='/') + VERSION=$(echo $line | awk '{ print $3 }' FS=':' | xargs) + if grep -q "$VERSION" ./releasenotes/notes/$SERVICE.yaml ; then + echo "$SERVICE is up to date!" + else + echo "$SERVICE version does not match release notes. Likely requires a release note update" + RESULT=1 + fi +done < <(grep -r --include Chart.yaml "version:" .) + +exit $RESULT