Skip to content

Commit

Permalink
MINOR: Parameterize changelog script (#2484)
Browse files Browse the repository at this point in the history
* modify script to respect release branch

* Separate usage and example

* Update dev/release/README.md

Co-authored-by: Andy Grove <[email protected]>
  • Loading branch information
jychen7 and andygrove authored May 8, 2022
1 parent cb44eb1 commit dfdeb42
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 19 deletions.
6 changes: 2 additions & 4 deletions dev/release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ git commit -a -m 'Update version'

### Update CHANGELOG.md

Manually edit the base version tag argument in
`dev/release/update_change_log-{ballista,datafusion}.sh`. Commits
between the base verstion tag and the latest upstream master will be used to
Define release branch (e.g. `master`), base version tag (e.g. `7.0.0`) and future version tag (e.g. `8.0.0`). Commits between the base version tag and the release branch will be used to
populate the changelog content.

You will need a GitHub Personal Access Token for the following steps. Follow
Expand All @@ -124,7 +122,7 @@ to generate one if you do not already have one.

```bash
# create the changelog
CHANGELOG_GITHUB_TOKEN=<TOKEN> ./dev/release/update_change_log-all.sh
CHANGELOG_GITHUB_TOKEN=<TOKEN> ./dev/release/update_change_log-all.sh master 8.0.0 7.0.0
# review change log / edit issues and labels if needed, rerun until you are happy with the result
git commit -a -m 'Create changelog for release'
```
Expand Down
9 changes: 6 additions & 3 deletions dev/release/update_change_log-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@
set -e

# Usage:
# CHANGELOG_GITHUB_TOKEN=<TOKEN> ./update_change_log-datafusion.sh
# CHANGELOG_GITHUB_TOKEN=<TOKEN> ./update_change_log-all.sh <branch> <release_tag> <base_tag>
# Example:
# CHANGELOG_GITHUB_TOKEN=<TOKEN> ./update_change_log-all.sh master 8.0.0 7.1.0
# CHANGELOG_GITHUB_TOKEN=<TOKEN> ./update_change_log-all.sh maint-7.x 7.1.0 7.0.0

SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SOURCE_TOP_DIR="$(cd "${SOURCE_DIR}/../../" && pwd)"

${SOURCE_DIR}/update_change_log-datafusion.sh
${SOURCE_DIR}/update_change_log-ballista.sh
${SOURCE_DIR}/update_change_log-datafusion.sh $1 $2 $3
${SOURCE_DIR}/update_change_log-ballista.sh $1 $2 $3
14 changes: 8 additions & 6 deletions dev/release/update_change_log-ballista.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@
#

# Usage:
# CHANGELOG_GITHUB_TOKEN=<TOKEN> ./update_change_log-ballista.sh
# CHANGELOG_GITHUB_TOKEN=<TOKEN> ./update_change_log-ballista.sh master ballista-0.7.0 ballista-0.6.0

SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SOURCE_TOP_DIR="$(cd "${SOURCE_DIR}/../../" && pwd)"
RELEASE_BRANCH=$1
RELEASE_TAG=$2
BASE_TAG=$3

CURRENT_VER=$(grep version "${SOURCE_TOP_DIR}/ballista/rust/client/Cargo.toml" | head -n 1 | awk '{print $3}' | tr -d '"')
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
${SOURCE_DIR}/update_change_log.sh \
ballista \
ballista-0.6.0 \
"${BASE_TAG}" \
--exclude-tags-regex "python-.+" \
--future-release "ballista-${CURRENT_VER}"
--future-release "${RELEASE_TAG}" \
--release-branch "${RELEASE_BRANCH}"
15 changes: 9 additions & 6 deletions dev/release/update_change_log-datafusion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@
#

# Usage:
# CHANGELOG_GITHUB_TOKEN=<TOKEN> ./update_change_log-datafusion.sh
# CHANGELOG_GITHUB_TOKEN=<TOKEN> ./update_change_log-datafusion.sh master 8.0.0 7.1.0
# CHANGELOG_GITHUB_TOKEN=<TOKEN> ./update_change_log-datafusion.sh maint-7.x 7.1.0 7.0.0

SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SOURCE_TOP_DIR="$(cd "${SOURCE_DIR}/../../" && pwd)"
RELEASE_BRANCH=$1
RELEASE_TAG=$2
BASE_TAG=$3

CURRENT_VER=$(grep version "${SOURCE_TOP_DIR}/datafusion/core/Cargo.toml" | head -n 1 | awk '{print $3}' | tr -d '"')
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
${SOURCE_DIR}/update_change_log.sh \
datafusion \
7.0.0 \
"${BASE_TAG}" \
--exclude-tags-regex "(python|ballista)-.+" \
--future-release "${CURRENT_VER}"
--future-release "${RELEASE_TAG}" \
--release-branch "${RELEASE_BRANCH}"

0 comments on commit dfdeb42

Please sign in to comment.