Skip to content

Commit

Permalink
HASE-28414 create-release should spotless:apply after making any file…
Browse files Browse the repository at this point in the history
… changes (apache#5824)

Signed-off-by: Bryan Beaudreault <[email protected]>
  • Loading branch information
Apache9 authored and mnpoonia committed Apr 24, 2024
1 parent dc1d352 commit b6b667a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dev-support/create-release/release-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ if [[ "$1" == "tag" ]]; then

# Create release version
maven_set_version "$RELEASE_VERSION"
find . -name pom.xml -exec git add {} \;
maven_spotless_apply
git_add_poms
# Always put CHANGES.md and RELEASENOTES.md to parent directory, so later we do not need to
# check their position when generating release data. We can not put them under the source code
# directory because for 3.x+, CHANGES.md and RELEASENOTES.md are not tracked so later when
Expand All @@ -168,7 +169,8 @@ if [[ "$1" == "tag" ]]; then

# Create next version
maven_set_version "$NEXT_VERSION"
find . -name pom.xml -exec git add {} \;
maven_spotless_apply
git_add_poms
git commit -s -m "Preparing development version $NEXT_VERSION"

if ! is_dry_run; then
Expand Down
11 changes: 11 additions & 0 deletions dev-support/create-release/release-util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -871,3 +871,14 @@ function get_hadoop3_version() {
echo "${version}-hadoop3"
fi
}

# Run mvn spotless:apply to format the code base
# For 2.x, the generated CHANGES.md and RELEASENOTES.md may have lines end with whitespace and
# case spotless:check failure, so we should run spotless:apply before committing
function maven_spotless_apply() {
"${MVN[@]}" spotless:apply
}

function git_add_poms() {
find . -name pom.xml -exec git add {} \;
}

0 comments on commit b6b667a

Please sign in to comment.