Add branch support to ChangeLog helper tool - #3837
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the tools/changelog-helper.sh release-process helper to support checking PR references against a specified branch instead of always using main, enabling accurate ChangeLog verification for release branches (e.g. release/3_12).
Changes:
- Add a
--branchCLI option (defaulting tomain) to select which branch to check. - Pass the selected branch through to the “find/add missing entries” flow and update
--helpoutput accordingly. - Adjust git ref handling in the missing-entry scan to incorporate the selected branch.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8491e6a to
9c69be7
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
tools/changelog-helper.sh:104
target_refis computed (and even switched to the release tag when it exists), but the subsequentgit logstill uses${branch}. This means the selected ref/tag is ignored and the output can be wrong for released versions or when the target branch only exists asorigin/<branch>. Also the "Ignoring PR" message still refers to..HEADinstead of the actual range being scanned.
echo
echo "Checking if all PR references in git log since ${prev_release_tag} are included for ${target_release} based on ref ${target_ref}..."
local milestone
for id in $(git log "${prev_release_tag}..${branch}" | grep -oP '#\K(\d+)'); do
gh pr view "${id}" --json title &> /dev/null || continue # Skip non-PRs
softins
left a comment
There was a problem hiding this comment.
Apart from those comments, this looks sensible and in line with the existing design of the script.
9c69be7 to
5e89019
Compare
5e89019 to
744e110
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
tools/changelog-helper.sh:95
target_refis built from user input (--branch). Using an unquoted assignment here is inconsistent with the rest of the script’s quoting style and can allow unexpected glob expansion if special characters slip in. Quote the constructed ref for consistency and safety.
local target_ref=origin/${branch}
tools/changelog-helper.sh:84
- Parameter expansion in this script is typically quoted (e.g.,
local lang="${1}"), butlocal branch=${1:-main}is unquoted and can trigger word-splitting/globbing if the value ever contains special characters. Quoting keeps behavior consistent and safer.
This issue also appears on line 95 of the same file.
local branch=${1:-main}
744e110 to
198e513
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
tools/changelog-helper.sh:382
- The
--branchoption is described as a generic branch name, but the script always checks the remote-tracking reforigin/${branch}(so passing--branch origin/release/3_12would becomeorigin/origin/release/3_12). Clarifying in--helpthat the value should be the branch name without theorigin/prefix (and that the script usesorigin/<branch>) would avoid confusing/incorrect invocations.
echo " --branch branch-name: Specify the branch to check (default: main)"
echo " This option ensures only PRs merged into the specified branch are considered."
Short description of changes
I made this change when working on the release 3.12.3 changes because there were multiple fixes in the release.
As written, the tool had
mainhard coded. This change now makesmainthe default branch but allows an alternative branch to be specified -- e.g.--branch release/3_12.Tested - it no longer finds merges to main that didn't get to release/3_12.
CHANGELOG: SKIP
Context: Fixes an issue?
Release process helper update.
Does this change need documentation? What needs to be documented and how?
No. (
--helpupdated)Status of this Pull Request
Test on Release 3.12.3 ChangeLog.
What is missing until this pull request can be merged?
Should be okay to merge.
Checklist