This commit is contained in:
Ayoub Mrini 2025-08-04 21:32:53 -07:00 committed by GitHub
commit 0efeb88016
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 76 additions and 6 deletions

View File

@ -1,9 +1,5 @@
<!--
Please give your PR a title in the form "area: short description". For example "tsdb: reduce disk usage by 95%"
If your PR is to fix an issue, put "Fixes #issue-number" in the description.
Don't forget!
- Please give your PR a title in the form "area: short description". For example "tsdb: reduce disk usage by 95%"
- Please sign CNCF's Developer Certificate of Origin and sign-off your commits by adding the -s / --signoff flag to `git commit`. See https://github.com/apps/dco for more information.
@ -17,3 +13,23 @@
- All comments should start with a capital letter and end with a full stop.
-->
#### Which issue(s) does the PR fix:
<!--
If it applies.
Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
More at https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->
#### Does this PR introduce a user-facing change?
<!--
If no, just write "NONE" in the release-notes block below.
Otherwise, please describe what should be mentioned in the CHANGELOG. Use the following prefixes:
[FEATURE] [ENHANCEMENT] [PERF] [BUGFIX] [SECURITY] [CHANGE]
Refer to the existing CHANGELOG for inspiration: https://github.com/prometheus/prometheus/blob/main/CHANGELOG.md
If you need help formulating your entries, consult the reviewer(s).
-->
```release-notes
```

View File

@ -0,0 +1,23 @@
name: 'Check release notes'
on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
permissions:
contents: read
pull-requests: read
jobs:
check_release_notes:
name: check
runs-on: ubuntu-latest
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- env:
PR_DESCRIPTION: ${{ github.event.pull_request.body }}
run: |
echo "$PR_DESCRIPTION" | ./scripts/check_release_notes.sh

View File

@ -108,7 +108,7 @@ Changes for a patch release or release candidate should be merged into the previ
Bump the version in the `VERSION` file and update `CHANGELOG.md`. Do this in a proper PR pointing to the release branch as this gives others the opportunity to chime in on the release in general and on the addition to the changelog in particular. For a release candidate, append something like `-rc.0` to the version (with the corresponding changes to the tag name, the release name etc.).
When updating the `CHANGELOG.md` look at all PRs included in the release since the last release and verify if they need a changelog entry.
When updating the `CHANGELOG.md` look at all PRs included in the release since the last release and verify if they need a changelog entry. Most PRs will have their changelog entries specified in the `release-notes` blocks within their PR descriptions.
Note that `CHANGELOG.md` should only document changes relevant to users of Prometheus, including external API changes, performance improvements, and new features. Do not document changes of internal interfaces, code refactorings and clean-ups, changes to the build process, etc. People interested in these are asked to refer to the git history.
@ -120,6 +120,7 @@ Entries in the `CHANGELOG.md` are meant to be in this order:
* `[CHANGE]`
* `[FEATURE]`
* `[ENHANCEMENT]`
* `[PERF]`
* `[BUGFIX]`
Then bump the UI module version:

30
scripts/check_release_notes.sh Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -u -o pipefail
echo "Checking the release-notes block in the PR description"
content=$(cat | tr -d '\r' | sed -n '/```release-notes/,/```/p' | grep -v '```' | grep -v '^[[:space:]]*$')
if [[ -z "$content" ]]; then
echo "Error: release-notes block empty or not found, see template at https://github.com/prometheus/prometheus/blob/main/.github/PULL_REQUEST_TEMPLATE.md?plain=1"
exit 1
fi
if [[ "$content" == "NONE" ]]; then
echo "Release note check passed, content is NONE"
exit 0
fi
prefixes='FEATURE|ENHANCEMENT|PERF|BUGFIX|SECURITY|CHANGE'
while IFS= read -r line; do
if [[ ! $line =~ ^\[($prefixes)\] ]]; then
echo "Error: Invalid prefix in '$line'"
# Convert pipes to brackets
echo "Content should be NONE or entries should start with one of: [${prefixes//|/] [}]"
exit 1
fi
done <<<"$content"
echo "Release note check passed"