Skip to content

Commit 4fdcd53

Browse files
committed
Add find-unmentioned-prs.sh helper script
1 parent 34c4f5f commit 4fdcd53

3 files changed

Lines changed: 83 additions & 2 deletions

File tree

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ prune docs/api/public
3333

3434
# Misc
3535
recursive-include .github *.yml *.yaml
36-
recursive-include cicd_utils README.md *.py
36+
recursive-include cicd_utils README.md *.py *.sh
3737
recursive-include misc *.py *.ipynb *.txt *.png
3838
recursive-include requirements *.txt
3939
recursive-include tests *.py

cicd_utils/find-unmentioned-prs.sh

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/usr/bin/env zsh
2+
3+
# Script to find PRs not mentioned in the changelog
4+
#
5+
# Disclaimer: This script was auto-generated by Claude Code.
6+
#
7+
# Usage: ./cicd_utils/find-unmentioned-prs.sh
8+
#
9+
# Note: Take a look at the `all_prs=($(gh pr list ...))` line to see all the filters used to fetch PRs.
10+
#
11+
# Requirements:
12+
# * GitHub CLI (gh) must be installed and authenticated.
13+
# * jq must be installed for JSON parsing.
14+
# * The changelog file must exist at ./docs/reference/changelog.md
15+
# * The script assumes the main branch is named 'main'
16+
# * PRs are referenced in the changelog using the pattern {gh-pr}`PR-NUMBER`
17+
# * The script should be run from the root of the repository
18+
19+
set -e
20+
21+
CHANGELOG_FILE="./docs/reference/changelog.md"
22+
23+
# Check if changelog file exists
24+
if [[ ! -f "$CHANGELOG_FILE" ]]; then
25+
echo "Error: Changelog file not found at $CHANGELOG_FILE"
26+
exit 1
27+
fi
28+
29+
# Check if gh CLI is available
30+
if ! command -v gh &> /dev/null; then
31+
echo "Error: GitHub CLI (gh) is not installed"
32+
exit 1
33+
fi
34+
35+
echo "🔍 Finding PRs not mentioned in changelog..."
36+
echo
37+
38+
# Get all PR numbers from GitHub (both open and closed)
39+
echo "📥 Fetching all PRs from GitHub..."
40+
all_prs=($(gh pr list --state merged --base main --label 'skip news' --search 'merged:>2025-09-01' --limit 100 --json number --jq '.[].number'))
41+
if [[ ${#all_prs[@]} -eq 0 ]]; then
42+
echo "No PRs found in this repository."
43+
exit 0
44+
fi
45+
46+
echo "Found ${#all_prs[@]} total PRs"
47+
48+
# Extract PR numbers mentioned in changelog using the pattern {gh-pr}`PR-NUMBER`
49+
echo "📖 Parsing changelog for mentioned PRs..."
50+
mentioned_prs=($(grep -o '{gh-pr}`[0-9]\+`' "$CHANGELOG_FILE" | sed 's/{gh-pr}`\([0-9]\+\)`/\1/' | sort -n | uniq))
51+
52+
echo "Found ${#mentioned_prs[@]} PRs mentioned in changelog"
53+
echo
54+
55+
# Find PRs not mentioned in changelog
56+
unmentioned_prs=()
57+
58+
for pr in "${all_prs[@]}"; do
59+
if [[ ! " ${mentioned_prs[*]} " =~ " $pr " ]]; then
60+
unmentioned_prs+=($pr)
61+
fi
62+
done
63+
64+
# Display results
65+
if [[ ${#unmentioned_prs[@]} -eq 0 ]]; then
66+
echo "✅ All PRs are mentioned in the changelog!"
67+
else
68+
echo "📋 PRs not mentioned in changelog (${#unmentioned_prs[@]} total):"
69+
echo
70+
71+
for pr in "${unmentioned_prs[@]}"; do
72+
# Get PR title and URL for better readability
73+
pr_info=$(gh pr view "$pr" --json title,url --jq '{title: .title, url: .url}')
74+
pr_title=$(echo "$pr_info" | jq -r '.title')
75+
pr_url=$(echo "$pr_info" | jq -r '.url')
76+
77+
echo " #$pr: $pr_title"
78+
echo " $pr_url"
79+
echo
80+
done
81+
fi

docs/development/release_process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
You need to have push-access to the project's repository to make releases. Therefore, the following release steps are intended to be used as a reference for maintainers or [collaborators](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-user-account-settings/permission-levels-for-a-personal-account-repository#collaborator-access-for-a-repository-owned-by-a-personal-account) with push-access to the repository.
77
:::
88

9-
1. Review the **`## Unreleased changes`** section at the top of the {repo-file}`docs/reference/changelog.md` file and, if necessary, group and/or split entries into relevant subsections (e.g., _Features_, _Docs_, _Bugfixes_, _Security_, etc.). Take a look at previous release notes for guidance and try to keep the format consistent.
9+
1. Review the **`## Unreleased changes`** section at the top of the {repo-file}`docs/reference/changelog.md` file and, if necessary, group and/or split entries into relevant subsections (e.g., _Features_, _Docs_, _Bugfixes_, _Security_, etc.). Take a look at previous release notes for guidance and try to keep the format consistent. You can also use the `./cicd_utils/find-unmentioned-prs.sh` helper script to find merged PRs that were not mentioned in the changelog yet.
1010
2. [Review](https://github.com/tpvasconcelos/ridgeplot/compare) new usages of `.. versionadded::`, `.. versionchanged::`, and `.. deprecated::` directives that were added to the documentation since the last release. If necessary, update the version numbers in these directives to reflect the new release version.
1111
* You can determine the latest release version by running `git describe --tags --abbrev=0` on the `main` branch. Based on this, you can determine the next release version by incrementing the relevant _MAJOR_, _MINOR_, or _PATCH_ numbers.
1212
3. **IMPORTANT:** Remember to switch to the `main` branch and pull the latest changes before proceeding.

0 commit comments

Comments
 (0)