From 2b3fafc243182cac5f962157449be8df83271068 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 8 May 2020 19:37:20 -0700 Subject: [PATCH 1/2] feat(mkreleasenotes): include more repos We should be including multiformats repos and repos from our core contributors. --- bin/mkreleaselog | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/bin/mkreleaselog b/bin/mkreleaselog index 12f2952490f..89f43706745 100755 --- a/bin/mkreleaselog +++ b/bin/mkreleaselog @@ -6,8 +6,30 @@ export GOPATH="$(go env GOPATH)" alias jq="jq --unbuffered" -[[ -n "${REPO_FILTER+x}" ]] || REPO_FILTER="github.com/(ipfs|libp2p|ipld)" -[[ -n "${IGNORED_FILES+x}" ]] || IGNORED_FILES='^\(\.gx\|package.json\|\.travis.yml\|go.mod\|go.sum\)$' +AUTHORS=( + # orgs + ipfs + ipld + libp2p + multiformats + filecoin-project + ipfs-shipyard + + # Authors of personal repos used by go-ipfs that should be mentioned in the + # release notes. + whyrusleeping + Kubuxu + jbenet + Stebalien + marten-seemann + hsanjuan + lucas-clemente + warpfork +) + +[[ -n "${REPO_FILTER+x}" ]] || REPO_FILTER="github.com/(${$(printf "|%s" "${AUTHORS[@]}"):1})" + +[[ -n "${IGNORED_FILES+x}" ]] || IGNORED_FILES='^\(\.gx\|package\.json\|\.travis\.yml\|go.mod\|go\.sum|\.github|\.circleci\)$' NL=$'\n' From d2b1d5b7d4bfaca2f1365499b52e8163308a9947 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 8 May 2020 19:37:56 -0700 Subject: [PATCH 2/2] fix(mkreleasenotes): include commits directly to master This will include: * Commits to master. * Squashed merges. In the release notes. --- bin/mkreleaselog | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/bin/mkreleaselog b/bin/mkreleaselog index 89f43706745..8d3de98cc7c 100755 --- a/bin/mkreleaselog +++ b/bin/mkreleaselog @@ -88,27 +88,42 @@ resolve_commits() { jq '. + {Ref: (.Version|capture("^((?.*)\\+incompatible|v.*-(0\\.)?[0-9]{14}-(?[a-f0-9]{12})|(?v.*))$") | .ref1 // .ref2 // .ref3)}' } +pr_link() { + local repo="$1" + local prnum="$2" + local ghname="${repo##github.com/}" + printf -- "[%s#%s](https://%s/pull/%s)" "$ghname" "$prnum" "$repo" "$prnum" +} + # Generate a release log for a range of commits in a single repo. release_log() { + setopt local_options BASH_REMATCH + local repo="$1" local start="$2" local end="${3:-HEAD}" - local ghname="${repo##github.com/}" local dir="$GOPATH/src/$repo" - local commit prnum + local commit pr git -C "$dir" log \ --format='tformat:%H %s' \ - --merges \ + --first-parent \ "$start..$end" | - sed -n -e 's/\([a-f0-9]\+\) .*#\([0-9]\+\).*/\1 \2/p' | - while read commit prnum; do + while read commit subject; do # Skip gx-only PRs. git -C "$dir" diff-tree --no-commit-id --name-only "$commit^" "$commit" | grep -v "${IGNORED_FILES}" >/dev/null || continue - local desc="$(git -C "$dir" show --summary --format='tformat:%b' "$commit" | head -1)" - printf -- "- %s ([%s#%s](https://%s/pull/%s))\n" "$desc" "$ghname" "$prnum" "$repo" "$prnum" + if [[ "$subject" =~ '^Merge pull request #([0-9]+) from' ]]; then + local prnum="${BASH_REMATCH[2]}" + local desc="$(git -C "$dir" show --summary --format='tformat:%b' "$commit" | head -1)" + printf -- "- %s (%s)\n" "$desc" "$(pr_link "$repo" "$prnum")" + elif [[ "$subject" =~ '\(#([0-9]+)\)$' ]]; then + local prnum="${BASH_REMATCH[2]}" + printf -- "- %s (%s)\n" "$subject" "$(pr_link "$repo" "$prnum")" + else + printf -- "- %s\n" "$subject" + fi done }