From 33dded9d3e5fe1459e9640d5d528c36761773766 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Tue, 7 May 2024 18:33:28 +0300 Subject: [PATCH] chore(scripts): fix a few release script changelog issues --- scripts/release.sh | 1 + scripts/release/check_commit_metadata.sh | 17 ++++++++++++++--- scripts/release/generate_release_notes.sh | 1 - 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/release.sh b/scripts/release.sh index d1d2af1502d16..01da3c7728ec5 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -210,6 +210,7 @@ new_version="${new_version%$'\n'}" # Remove the trailing newline. release_notes="$(execrelative ./release/generate_release_notes.sh --old-version "$old_version" --new-version "$new_version" --ref "$ref")" +mkdir -p build release_notes_file="build/RELEASE-${new_version}.md" if ((dry_run)); then release_notes_file="build/RELEASE-${new_version}-DRYRUN.md" diff --git a/scripts/release/check_commit_metadata.sh b/scripts/release/check_commit_metadata.sh index 41b4d4229d155..906818412a4a9 100755 --- a/scripts/release/check_commit_metadata.sh +++ b/scripts/release/check_commit_metadata.sh @@ -99,7 +99,9 @@ main() { git_cherry_out=$( { git log --no-merges --cherry-mark --pretty=format:"%m %H %s" "${to_ref}...origin/main" + echo git log --no-merges --cherry-mark --pretty=format:"%m %H %s" "${from_ref}...origin/main" + echo } | { grep '^=' || true; } | sort -u | sort -k3 ) if [[ -n ${git_cherry_out} ]]; then @@ -209,6 +211,15 @@ main() { fi fi + author= + if [[ -v authors[${commit_sha_long}] ]]; then + author=${authors[${commit_sha_long}]} + if [[ ${author} == "app/dependabot" ]]; then + log "Skipping commit by app/dependabot ${commit_sha_short} (${commit_sha_long})" + continue + fi + fi + if [[ ${left_right} == "<" ]]; then # Skip commits that are already in main. log "Skipping commit ${commit_sha_short} from other branch (${commit_sha_long} ${title})" @@ -218,7 +229,7 @@ main() { COMMIT_METADATA_COMMITS+=("${commit_sha_long_orig}") # Safety-check, guarantee all commits had their metadata fetched. - if [[ ! -v authors[${commit_sha_long}] ]] || [[ ! -v labels[${commit_sha_long}] ]]; then + if [[ -z ${author} ]] || [[ ! -v labels[${commit_sha_long}] ]]; then if [[ ${ignore_missing_metadata} != 1 ]]; then error "Metadata missing for commit ${commit_sha_short} (${commit_sha_long})" else @@ -228,8 +239,8 @@ main() { # Store the commit title for later use. COMMIT_METADATA_TITLE[${commit_sha_short}]=${title} - if [[ -v authors[${commit_sha_long}] ]]; then - COMMIT_METADATA_AUTHORS[${commit_sha_short}]="@${authors[${commit_sha_long}]}" + if [[ -n ${author} ]]; then + COMMIT_METADATA_AUTHORS[${commit_sha_short}]="@${author}" fi # Create humanized titles where possible, examples: diff --git a/scripts/release/generate_release_notes.sh b/scripts/release/generate_release_notes.sh index 7aa24ee4fe198..b593ccad3cc5b 100755 --- a/scripts/release/generate_release_notes.sh +++ b/scripts/release/generate_release_notes.sh @@ -147,7 +147,6 @@ for commit in "${commits[@]}"; do title="${title} (${commit})" fi line="- ${title}" - line=${line//) (/, )} if [[ -v COMMIT_METADATA_AUTHORS[${commit}] ]]; then line+=" (${COMMIT_METADATA_AUTHORS[${commit}]})" fi