From 64f60fd6590f2f21c978c9a501b9917929c6671d Mon Sep 17 00:00:00 2001 From: Andrew Tayler Date: Fri, 6 Mar 2026 19:36:13 -0700 Subject: [PATCH 1/2] ci: add NEWS.md entry check for chart version bumps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a CI check that verifies changed charts with a version bump also have a corresponding heading in NEWS.md. This prevents changelog entries from being forgotten when releasing chart updates. The check runs on PRs only (not main) and complements the existing chart-testing version bump requirement — if ct lint already requires a version bump for every chart change, then every bump should have a changelog entry. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/chart-test.yaml | 5 ++++ tools/dev/check-news-entries.sh | 44 +++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100755 tools/dev/check-news-entries.sh diff --git a/.github/workflows/chart-test.yaml b/.github/workflows/chart-test.yaml index be4428e5..25376460 100644 --- a/.github/workflows/chart-test.yaml +++ b/.github/workflows/chart-test.yaml @@ -104,6 +104,11 @@ jobs: ./tools/dev/check-uncommitted-changes.sh || \ (echo "run 'just update-lock' and commit the result." && exit 1) + # checks that bumped chart versions have a corresponding NEWS.md entry + - name: Check NEWS.md entries + if: github.ref != 'refs/heads/main' + run: ./tools/dev/check-news-entries.sh main + - name: Notify Slack of chart unittest failure if on main if: github.ref == 'refs/heads/main' && steps.unittest.outcome == 'failure' uses: slackapi/slack-github-action@v1.27.0 diff --git a/tools/dev/check-news-entries.sh b/tools/dev/check-news-entries.sh new file mode 100755 index 00000000..175233b8 --- /dev/null +++ b/tools/dev/check-news-entries.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# +# Verify that changed charts with a version bump also have a NEWS.md entry +# for the new version. Runs in CI alongside the existing version bump check. +# +set -euo pipefail + +TARGET_BRANCH="${1:-main}" +exit_code=0 + +for chart_dir in charts/*/ other-charts/*/; do + chart_yaml="${chart_dir}Chart.yaml" + news_md="${chart_dir}NEWS.md" + + [ -f "$chart_yaml" ] || continue + + # Get the current version + current_version=$(grep '^version:' "$chart_yaml" | awk '{print $2}') + + # Get the version on the target branch + base_version=$(git show "origin/${TARGET_BRANCH}:${chart_yaml}" 2>/dev/null | grep '^version:' | awk '{print $2}' || echo "") + + # Skip if version didn't change + [ "$current_version" != "$base_version" ] || continue + + # Version was bumped — check for NEWS.md entry + if [ ! -f "$news_md" ]; then + echo "Error: ${chart_dir} has a version bump ($base_version -> $current_version) but no NEWS.md file." + exit_code=1 + continue + fi + + if ! grep -q "^## ${current_version}$" "$news_md"; then + echo "Error: ${chart_dir}NEWS.md is missing an entry for version ${current_version}." + echo " Add a '## ${current_version}' section to ${news_md}." + exit_code=1 + fi +done + +if [ $exit_code -eq 0 ]; then + echo "All changed charts have NEWS.md entries." +fi + +exit $exit_code From 79e2459192cc593ae5d0a21b4fecfdd4e834d63a Mon Sep 17 00:00:00 2001 From: Andrew Tayler Date: Sat, 7 Mar 2026 07:27:17 -0700 Subject: [PATCH 2/2] improve NEWS.md check: friendlier error message, document in CONTRIBUTING.md - Add NEWS.md requirement to CONTRIBUTING.md under "Assumptions / Common Dev Workflows" so contributors know about it before hitting CI - Improve the error message to show the version diff and an example of what to add Co-Authored-By: Claude Opus 4.6 --- CONTRIBUTING.md | 2 ++ tools/dev/check-news-entries.sh | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 47fe3626..41bb06d9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,6 +26,8 @@ We'll try to be as responsive as possible in reviewing and accepting pull reques [Go templating](./charts/_templates.gotmpl) and `helm-docs`. - Run `just setup` to install `helm-doc`. - CI requires that the chart version get bumped for any change in the directory. +- When bumping a chart version, add a `## X.Y.Z` entry to the chart's `NEWS.md` + describing what changed. CI will check for this. - Use `just update-lock` to update all chart's lockfiles. - Changes to the `rstudio-library` chart will update all downstream charts at the same time (via the `file://` syntax in `Chart.yaml`) diff --git a/tools/dev/check-news-entries.sh b/tools/dev/check-news-entries.sh index 175233b8..c895e6d5 100755 --- a/tools/dev/check-news-entries.sh +++ b/tools/dev/check-news-entries.sh @@ -31,8 +31,17 @@ for chart_dir in charts/*/ other-charts/*/; do fi if ! grep -q "^## ${current_version}$" "$news_md"; then - echo "Error: ${chart_dir}NEWS.md is missing an entry for version ${current_version}." - echo " Add a '## ${current_version}' section to ${news_md}." + echo "Error: ${news_md} is missing an entry for version ${current_version}." + echo "" + echo " Chart version was bumped from ${base_version} to ${current_version}," + echo " but NEWS.md has no '## ${current_version}' heading." + echo "" + echo " To fix, add a section like this to ${news_md}:" + echo "" + echo " ## ${current_version}" + echo "" + echo " - Description of what changed" + echo "" exit_code=1 fi done