Skip to content

Commit

Permalink
tools/changelog-helper: Ignore foreign-milestone PRs despite mentions…
Browse files Browse the repository at this point in the history
… in git log

Previously, all PRs from the relevant git log were added to the
ChangeLog. This causes false positives when older PRs are intentionally
mentioned again (e.g. for further fixes or documentation updates).
At the same time, simply skipping them removes an additional method to
avoid forgotten PRs.

Therefore, only add git-mentioned PRs if they don't have a milestone (or
a matching one).

Fixes: jamulussoftware#2657
  • Loading branch information
hoffie committed Jun 18, 2022
1 parent 7e1af43 commit fc2b310
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/changelog-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@ find_or_add_missing_entries() {
target_ref="${target_release_tag}"
fi
echo
echo "Checking if all PR or references in git log since ${prev_release_tag} are included for ${target_release} based on ref ${target_ref}..."
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}..master" | grep -oP '#\K(\d+)'); do
gh pr view "${id}" --json title &> /dev/null || continue # Skip non-PRs
milestone=$(gh pr view "${id}" --json milestone --jq .milestone.title)
if [[ "${milestone}" =~ "Release " ]] && [[ "${milestone}" != "Release ${target_release}" ]]; then
echo "-> Ignoring PR #${id}, which was mentioned in 'git log ${prev_release_tag}..HEAD', but already has milestone '${milestone}'"
continue
fi
check_or_add_pr "${id}"
done

Expand Down

0 comments on commit fc2b310

Please sign in to comment.