Skip to content

Commit

Permalink
Create a template/checklist for Jaeger release (jaegertracing#6691)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
- Resolves jaegertracing#6688 

## Description of the changes
- 

## How was this change tested?
- 

## Checklist
- [ ] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [ ] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [ ] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `npm run lint` and `npm run test`

---------

Signed-off-by: cs-308-2023 <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]>
  • Loading branch information
3 people authored Mar 10, 2025
1 parent 14d4bb4 commit ef4c955
Show file tree
Hide file tree
Showing 3 changed files with 177 additions and 5 deletions.
19 changes: 14 additions & 5 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Jaeger Overall Release Process

Create an issue with the checklist for the release by running `bash scripts/release/start.sh`.

1. Determine new version numbers for v1.x.x and v2.x.x
2. Perform UI release according to https://github.com/jaegertracing/jaeger-ui/blob/main/RELEASE.md
3. Perform Backend release (see below)
Expand All @@ -10,6 +12,8 @@

# Jaeger Backend Release Process

<!-- BEGIN_CHECKLIST -->

1. Create a PR "Prepare release 1.x.x / 2.x.x" against main or maintenance branch ([example](https://github.com/jaegertracing/jaeger/pull/543/files)) by updating 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.
Expand Down Expand Up @@ -39,6 +43,16 @@
3. Create a release on Github:
* Automated:
* `make draft-release`
4. Go to [Publish Release](https://github.com/jaegertracing/jaeger/actions/workflows/ci-release.yml) workflow on GitHub
and run it manually using Run Workflow button on the right.
1. For monitoring and troubleshooting, open the logs of the workflow run from above URL.
2. Check the images are available on [Docker Hub](https://hub.docker.com/r/jaegertracing/)
and binaries are uploaded [to the release]()https://github.com/jaegertracing/jaeger/releases.
<!-- END_CHECKLIST -->
## Manual release
* Manual:
* Title "Release 1.x.x / 2.x.x"
* Tag `v1.x.x` (note the `v` prefix) and choose appropriate branch (usually `main`)
Expand All @@ -48,11 +62,6 @@
Before doing the previous step, you can click that button and then remove everything
except the New Contributors section. Change the header to `### 👏 New Contributors`,
then copy the main changelog above it. [Example](https://github.com/jaegertracing/jaeger/releases/tag/v1.55.0).
4. Go to [Publish Release](https://github.com/jaegertracing/jaeger/actions/workflows/ci-release.yml) workflow on GitHub
and run it manually using Run Workflow button on the right.
1. For monitoring and troubleshooting, open the logs of the workflow run from above URL.
2. Check the images are available on [Docker Hub](https://hub.docker.com/r/jaegertracing/)
and binaries are uploaded [to the release]()https://github.com/jaegertracing/jaeger/releases.
## Patch Release
Expand Down
89 changes: 89 additions & 0 deletions scripts/release/formatter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/usr/bin/env python3
# Copyright (c) 2025 The Jaeger Authors.
# SPDX-License-Identifier: Apache-2.0

import re
import sys

def extract_section_from_file(file_path, start_marker, end_marker):
with open(file_path, 'r') as f:
text = f.read()
start_index = text.find(start_marker)
if start_index == -1:
raise Exception(f"start marker {start_marker!r} not found")
start_index += len(start_marker)
end_index = text.find(end_marker)
if end_index == -1:
raise Exception(f"end marker {end_marker!r} not found")
return text[start_index:end_index]

def replace_star(text):
re_star = re.compile(r'(\n\s*)(\*)(\s)')
text = re_star.sub(r'\1\2 [ ]\3', text)
return text

def replace_dash(text):
re_dash = re.compile(r'(\n\s*)(\-)')
text = re_dash.sub(r'\1* [ ]', text)
return text

def replace_num(text):
re_num = re.compile(r'(\n\s*)([0-9]*\.)(\s)')
text = re_num.sub(r'\1* [ ]\3', text)
return text

def replace_version(ui_text, backend_text, doc_text, pattern, ver):
ui_text = re.sub(pattern, ver, ui_text)
backend_text = re.sub(pattern, ver, backend_text)
doc_text = re.sub(pattern, ver, doc_text)
return ui_text, backend_text, doc_text

def fetch_content(file_name):
start_marker = "<!-- BEGIN_CHECKLIST -->"
end_marker = "<!-- END_CHECKLIST -->"
text = extract_section_from_file(file_name, start_marker, end_marker)
return text

def main():

loc = sys.argv[1]
v1 = sys.argv[2]
v2 = sys.argv[3]
try:
backend_file_name = "RELEASE.md"
backend_section = fetch_content(backend_file_name)
except Exception as e:
sys.exit(f"Failed to extract backendSection: {e}")
backend_section = replace_star(backend_section)
backend_section = replace_num(backend_section)
try:
doc_filename = loc
doc_section = fetch_content(doc_filename)
except Exception as e:
sys.exit(f"Failed to extract documentation section: {e}")
doc_section=replace_dash(doc_section)

try:
ui_filename = "jaeger-ui/RELEASE.md"
ui_section = fetch_content(ui_filename)
except Exception as e:
sys.exit(f"Failed to extract UI section: {e}")

ui_section=replace_dash(ui_section)
ui_section=replace_num(ui_section)

#Concrete version
v1_pattern = r'(?:X\.Y\.Z|1\.[0-9]+\.[0-9]+|1\.x\.x)'
ui_section, backend_section, doc_section = replace_version(ui_section, backend_section, doc_section, v1_pattern, v1)
v2_pattern = r'2.x.x'
ui_section, backend_section, doc_section = replace_version(ui_section, backend_section, doc_section, v2_pattern, v2)

print("# UI Release")
print(ui_section)
print("# Backend Release")
print(backend_section)
print("# Doc Release")
print(doc_section)

if __name__ == "__main__":
main()
74 changes: 74 additions & 0 deletions scripts/release/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/usr/bin/env bash

# Copyright (c) 2025 The Jaeger Authors.
# SPDX-License-Identifier: Apache-2.0

#Requires bash version to be >=4. Will add alternative for lower versions
set -euo pipefail

dry_run=false

while getopts "d" opt; do
case "${opt}" in
d)
dry_run=true
;;
*)
echo "Usage: $0 [-d]"
exit 1
;;
esac
done
if ! current_version_v1=$(make "echo-v1"); then
echo "Error: Failed to fetch current version from make echo-v1."
exit 1
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}"

IFS='.' read -r major minor patch <<< "$clean_version"

minor=$((minor + 1))
patch=0
suggested_version="${major}.${minor}.${patch}"
echo "Current v1 version: ${current_version_v1}"
read -r -e -p "New version: v" -i "${suggested_version}" user_version_v1

if ! current_version_v2=$(make "echo-v2"); then
echo "Error: Failed to fetch current version from make echo-v2."
exit 1
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}"

IFS='.' read -r major minor patch <<< "$clean_version"

minor=$((minor + 1))
patch=0
suggested_version="${major}.${minor}.${patch}"
echo "Current v2 version: ${current_version_v2}"
read -r -e -p "New version: v" -i "${suggested_version}" user_version_v2

new_version="v${user_version_v1} / v${user_version_v2}"
echo "Using new version: ${new_version}"



TMPFILE=$(mktemp "/tmp/DOC_RELEASE.XXXXXX")
wget -O "$TMPFILE" https://raw.githubusercontent.com/jaegertracing/documentation/main/RELEASE.md

issue_body=$(python scripts/utils/formatter.py "${TMPFILE}" "${user_version_v1}" "${user_version_v2}")

if $dry_run; then
echo "${issue_body}"
else
gh issue create --title "Prepare Jaeger Release ${new_version}" --body "$issue_body"
fi

rm "${TMPFILE}"

exit 1;


0 comments on commit ef4c955

Please sign in to comment.