Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-12701: [Website][Release] Include Rust contributors, committers, and commits in release notes #10774

Closed
wants to merge 13 commits into from
81 changes: 63 additions & 18 deletions dev/release/post-03-website.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ set -u
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ARROW_DIR="${SOURCE_DIR}/../.."
ARROW_SITE_DIR="${ARROW_DIR}/../arrow-site"
ARROW_RS_DIR="${ARROW_DIR}/../arrow-rs"
# TODO: add this back in when we have datafusion releases included
#ARROW_DF_DIR="${ARROW_DIR}/../arrow-datafusion"

if [ "$#" -ne 2 ]; then
echo "Usage: $0 <previous-version> <version>"
Expand Down Expand Up @@ -55,17 +58,57 @@ rough_n_development_months=$((
git_tag=apache-arrow-${version}
git_range=apache-arrow-${previous_version}..${git_tag}

committers_command_line="git shortlog -csn ${git_range}"
contributors_command_line="git shortlog -sn ${git_range}"

committers=$(${committers_command_line})
contributors=$(${contributors_command_line})
# Previously this code counted commits, committers, and contributors only to the
# apache/arrow repository. After the Rust implementation of Arrow was moved to
# the separate apache/arrow-rs repository, this code was modified to also count
# commits, committers, and contributors to that repository.
#
# TODO: Add DataFusion directory and git ranges here once git tagging convention
# for apache/arrow-datafusion repo is confirmed with DF team
#
# TODO: Consider counting other apache/arrow-* repos here if tagging conventions
# permit (arrow-cookbook, arrow-site)

directories=("${ARROW_DIR}" "${ARROW_RS_DIR}")
ianmcook marked this conversation as resolved.
Show resolved Hide resolved
git_ranges=(apache-arrow-${previous_version}..${git_tag} ${previous_version}..${version})

format_results='
{person="";
for (x=2; x<=NF; x++) {person=person " " $x};
counts[person]+=$1 } END {for (person in counts) print counts[person], person}'

committers=$(
for (( i=0; i<${#directories[@]}; i++ ));
do
cd ${directories[$i]}
git shortlog -csn ${git_ranges[$i]}
done |
awk "$format_results" |
sort -rn
)

contributors=$(
for (( i=0; i<${#directories[@]}; i++ ));
do
cd ${directories[$i]}
git shortlog -sn ${git_ranges[$i]}
done |
awk "$format_results" |
sort -rn
)

n_commits=0
for (( i=0; i<${#directories[@]}; i++ ));
do
cd ${directories[$i]}
commits_here=$(git log --pretty=oneline ${git_ranges[$i]} | wc -l)
n_commits=$((n_commits+commits_here))
done

n_commits=$(git log --pretty=oneline ${git_range} | wc -l)
n_contributors=$(${contributors_command_line} | wc -l)
n_contributors=$(echo "$contributors" | awk 'END{print NR}')

pushd "${ARROW_DIR}"
git_tag_hash=$(git log -n 1 --pretty=%H ${git_tag})

popd

pushd "${ARROW_SITE_DIR}"
Expand Down Expand Up @@ -112,44 +155,46 @@ This is a major release covering more than ${rough_n_development_months} months

## Contributors

This release includes ${n_commits} commits from ${n_contributors} distinct contributors.
This release includes ${n_commits} commits from ${n_contributors} distinct contributors in ${#directories[@]} Arrow repositories.

\`\`\`console
$ ${contributors_command_line}
thisisnic marked this conversation as resolved.
Show resolved Hide resolved
ANNOUNCE

echo "${contributors}" >> "${announce_file}"

cat <<ANNOUNCE >> "${announce_file}"
\`\`\`
cat <<'ANNOUNCE' >> "${announce_file}"
```

## Patch Committers

The following Apache committers merged contributed patches to the repository.
The following Apache committers merged contributed patches to Arrow repositories.

\`\`\`console
$ ${committers_command_line}
```console
ANNOUNCE

echo "${committers}" >> "${announce_file}"

cat <<ANNOUNCE >> "${announce_file}"
\`\`\`
cat <<'ANNOUNCE' >> "${announce_file}"
```

## Changelog

The following changelog is for the `apache/arrow` repository. For the Rust
implementation of Apache Arrow, see the [`apache/arrow-rs` changelog][7].

ANNOUNCE

archery release changelog generate ${version} | \
sed -e 's/^#/##/g' >> "${announce_file}"

cat <<ANNOUNCE >> "${announce_file}"
cat <<'ANNOUNCE' >> "${announce_file}"
[1]: https://www.apache.org/dyn/closer.lua/arrow/arrow-${version}/
[2]: https://apache.jfrog.io/artifactory/arrow/centos/
[3]: https://apache.jfrog.io/artifactory/arrow/debian/
[4]: https://apache.jfrog.io/artifactory/arrow/python/${version}/
[5]: https://apache.jfrog.io/artifactory/arrow/ubuntu/
[6]: https://github.com/apache/arrow/releases/tag/apache-arrow-${version}
[7]: https://github.com/apache/arrow-rs/blob/${version}/CHANGELOG.md
ANNOUNCE
git add "${announce_file}"

Expand Down