Skip to content

chore(scripts): fix a few release script changelog issues #13200

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

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
17 changes: 14 additions & 3 deletions scripts/release/check_commit_metadata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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})"
Expand All @@ -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
Expand All @@ -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:
Expand Down
1 change: 0 additions & 1 deletion scripts/release/generate_release_notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading