Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/chart-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down
53 changes: 53 additions & 0 deletions tools/dev/check-news-entries.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/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: ${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

if [ $exit_code -eq 0 ]; then
echo "All changed charts have NEWS.md entries."
fi

exit $exit_code
Loading