Skip to content

Commit a1b3934

Browse files
committed
maintainers: Add script for release notes todo list
1 parent 3826d51 commit a1b3934

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

maintainers/release-notes-todo

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
# debug:
5+
# set -x
6+
7+
START_REF="${1}"
8+
END_REF="${2:-upstream/master}"
9+
10+
# Get the merge base
11+
MERGE_BASE=$(git merge-base "$START_REF" "$END_REF")
12+
unset START_REF
13+
14+
# Get date range
15+
START_DATE=$(git show -s --format=%cI "$MERGE_BASE")
16+
END_DATE=$(git show -s --format=%cI "$END_REF")
17+
18+
echo "Checking PRs merged between $START_DATE and $END_DATE" >&2
19+
20+
# Get all commits between merge base and HEAD
21+
COMMITS=$(git rev-list "$MERGE_BASE..$END_REF")
22+
23+
# Convert to set for fast lookup
24+
declare -A commit_set
25+
for commit in $COMMITS; do
26+
commit_set["$commit"]=1
27+
done
28+
29+
# Get the current changelog
30+
LOG_DONE="$(changelog-d doc/manual/rl-next)"
31+
is_done(){
32+
local nr="$1"
33+
echo "$LOG_DONE" | grep -E "^- .*/pull/$nr)"
34+
}
35+
36+
# Query merged PRs in date range
37+
gh pr list \
38+
--repo NixOS/nix \
39+
--state merged \
40+
--limit 1000 \
41+
--json number,title,author,mergeCommit \
42+
--search "merged:$START_DATE..$END_DATE" | \
43+
jq -r '.[] | [.number, .mergeCommit.oid, .title, .author.login] | @tsv' | \
44+
while IFS=$'\t' read -r pr_num merge_commit _title author; do
45+
# Check if this PR's merge commit is in our branch
46+
if [[ -n "${commit_set[$merge_commit]:-}" ]]; then
47+
# Full detail, not suitable for comment due to mass ping and duplicate title
48+
# echo "- #$pr_num $_title (@$author)"
49+
echo "- #$pr_num ($author)"
50+
if is_done "$pr_num"
51+
then
52+
echo " - [x] has note"
53+
else
54+
echo " - [ ] has note"
55+
fi
56+
echo " - [ ] skip"
57+
fi
58+
done

maintainers/release-process.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ release:
2424
* In a checkout of the Nix repo, make sure you're on `master` and run
2525
`git pull`.
2626

27+
* Compile a release notes to-do list by running
28+
29+
```console
30+
$ ./maintainers/release-notes-todo PREV_RELEASE HEAD
31+
```
32+
2733
* Compile the release notes by running
2834

2935
```console

0 commit comments

Comments
 (0)