diff --git a/RELEASE.md b/RELEASE.md index 29e3a6e0ecd..70f0224313d 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -78,6 +78,35 @@ Maintenance branches should follow naming convention: `release-major.minor` (e.g * Once the release tag is created, the `ci-release` workflow will kick in and deploy the artifacts for the patch release. 5. Do not perform a new release of the documentation since the major.minor is not changing. The one change that may be useful is bumping the `binariesLatest` variable in the `config.toml` file ([example](https://github.com/jaegertracing/documentation/commit/eacb52f332a7e069c254e652a6b4a58ea5a07b32)). +## Manual Release Preparation Steps + +If you prefer to manually create the release PR instead of using the automated script, follow these steps: + +1. Update CHANGELOG.md to include: + * A new section with the header `1.x.x / 2.x.x (YYYY-MM-DD)` (copy the template at the top) + * A curated list of notable changes and links to PRs. Do not simply dump git log, select the changes that affect the users. + To obtain the list of all changes run `make changelog`. + * The section can be split into sub-section if necessary, e.g. UI Changes, Backend Changes, Bug Fixes, etc. + +2. Update the UI submodule to the latest version: + ```bash + git submodule init + git submodule update + pushd jaeger-ui + git checkout main + git pull + git checkout {new_ui_version} # e.g. v1.5.0 + popd + ``` + * If there are only dependency bumps, indicate this with "Dependencies upgrades only" ([example](https://github.com/jaegertracing/jaeger-ui/pull/2431/files)). + * If there are no changes, indicate this with "No changes" ([example](https://github.com/jaegertracing/jaeger/pull/4131/files)). + +3. Rotate the release managers table placing yourself at the bottom. The date should be the first Wednesday of the month. + +4. Commit your changes and create a pull request. + +5. Add label `changelog:skip` to the pull request. + ## Release managers A Release Manager is the person responsible for ensuring that a new version of Jaeger is released. This person will coordinate the required changes, including to the related components such as UI, IDL, and jaeger-lib and will address any problems that might happen during the release, making sure that the documentation above is correct. diff --git a/scripts/release/prepare.sh b/scripts/release/prepare.sh new file mode 100644 index 00000000000..2e2fd6968ec --- /dev/null +++ b/scripts/release/prepare.sh @@ -0,0 +1,71 @@ +#!/bin/bash +set -e + +[[ $# -ge 2 ]] || { echo "Usage: $0 v1.x.x v2.x.x [--create-tags]"; exit 1; } + +v1="$1" +v2="$2" +create_tags=false + +if [[ "$3" == "--create-tags" ]]; then + create_tags=true +fi + +# Git operations (only skip in dry-run) +if [[ "${DRY_RUN:-}" != "true" ]]; then + if [[ "$create_tags" == "true" ]]; then + # Tag creation mode + git checkout main + git pull --ff-only upstream main + echo "About to create and push tags: $v1 and $v2" + echo "This will run:" + echo " git tag $v1 -s -m \"Release $v1\"" + echo " git tag $v2 -s -m \"Release $v2\"" + echo " git push upstream $v1 $v2" + echo "" + read -p "Continue? (y/N): " -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]]; then + git tag "$v1" -s -m "Release $v1" + git tag "$v2" -s -m "Release $v2" + git push upstream "$v1" "$v2" + echo "Tags created and pushed successfully!" + else + echo "Tag creation cancelled." + fi + else + # PR creation mode + # Generate changelog + make changelog > changelog_content.tmp + + # Update CHANGELOG.md directly (no awk complexity) + current_date=$(date +"%Y-%m-%d") + echo "## $v1 / $v2 ($current_date)" > new_changelog.md + echo "" >> new_changelog.md + cat changelog_content.tmp >> new_changelog.md + echo "" >> new_changelog.md + cat CHANGELOG.md >> new_changelog.md + mv new_changelog.md CHANGELOG.md + + # Update jaeger-ui submodule + git submodule update --init jaeger-ui + cd jaeger-ui + git checkout main + git pull + cd .. + + git checkout -b "prepare-release-$v1-$v2" + git add CHANGELOG.md jaeger-ui + git commit -m "Prepare release $v1 / $v2" + git push origin "prepare-release-$v1-$v2" + gh pr create --title "Prepare release $v1 / $v2" --label changelog:skip + echo "" + echo "PR created successfully. After merging the PR, run:" + echo "bash ./scripts/release/prepare.sh $v1 $v2 --create-tags" + fi +else + echo "DRY RUN: Changes made locally. Would create PR for prepare-release-$v1-$v2" +fi + +# Cleanup +rm -f changelog_content.tmp diff --git a/scripts/release/start.sh b/scripts/release/start.sh old mode 100644 new mode 100755 index ce10e18b336..8aab9e55be2 --- a/scripts/release/start.sh +++ b/scripts/release/start.sh @@ -29,7 +29,7 @@ if ! current_version_v1=$(make "echo-v1"); then fi # removing the v so that in the line "New version: v1.66.1", v cannot be removed with backspace -clean_version="${current_version_v1#v}" +clean_version="${current_version_v1#v}" IFS='.' read -r major minor patch <<< "$clean_version" @@ -45,7 +45,7 @@ if ! current_version_v2=$(make "echo-v2"); then fi # removing the v so that in the line "New version: v1.66.1", v cannot be removed with backspace -clean_version="${current_version_v2#v}" +clean_version="${current_version_v2#v}" IFS='.' read -r major minor patch <<< "$clean_version" @@ -60,22 +60,39 @@ echo "Using new version: ${new_version}" -TMPFILE=$(mktemp "/tmp/DOC_RELEASE.XXXXXX") -wget -O "$TMPFILE" https://raw.githubusercontent.com/jaegertracing/documentation/main/RELEASE.md +cmd_v1="v${user_version_v1}" +cmd_v2="v${user_version_v2}" -# Ensure the UI Release checklist is up to date. -make init-submodules +issue_body=$(cat << EOF +## Prepare Jaeger Release ${cmd_v1} / ${cmd_v2} -issue_body=$(python scripts/release/formatter.py "${TMPFILE}" "${user_version_v1}" "${user_version_v2}") +This issue tracks the release of Jaeger ${cmd_v1} / ${cmd_v2}. + +**Automated option**: Run \`bash ./scripts/release/prepare.sh ${cmd_v1} ${cmd_v2}\` to automatically create the PR with changelog updates. + +**Manual option**: Follow the [manual release preparation steps](https://github.com/jaegertracing/jaeger/blob/main/RELEASE.md#manual-release-preparation-steps) in \`RELEASE.md\`. + +--- + +### Tagging + +After merging the PR, create signed tags and push them: + +```bash +bash ./scripts/release/prepare.sh ${cmd_v1} ${cmd_v2} --create-tags +EOF +) if $dry_run; then - echo "${issue_body}" + printf "%s\n" "${issue_body}" + exit 0 else - gh issue create -R jaegertracing/jaeger --title "Prepare Jaeger Release ${new_version}" --body "$issue_body" + issue_output=$(gh issue create -R jaegertracing/jaeger --title "Prepare Jaeger Release ${new_version}" --body "$issue_body") + issue_number=$(echo "$issue_output" | grep -o '#[0-9]*' | head -1) + echo "Created tracking issue: $issue_output" + echo "" + echo "Next step: Run the following command:" + echo "bash ./scripts/release/prepare.sh ${cmd_v1} ${cmd_v2}" fi -rm "${TMPFILE}" - -exit 1; -