From b243a1e8292864ec28517da50c3930ff185b597b Mon Sep 17 00:00:00 2001 From: Gage Hugo Date: Mon, 8 Feb 2021 15:53:18 -0600 Subject: [PATCH] Track release note changes on chart change This change adds in the script to eventually enforce release note updates when a chart version is bumped. It will currently be set to ignore if it fails, however once all of the charts are updated, this should be removed to hard-enforce. Change-Id: If3b3b26619f7288b723c0d4e6e1b97d6cfe1cf74 --- playbooks/lint.yml | 7 +++++++ tools/gate/reno-check.sh | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100755 tools/gate/reno-check.sh 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