forked from jaegertracing/jaeger
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a template/checklist for Jaeger release (jaegertracing#6691)
## 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
1 parent
14d4bb4
commit ef4c955
Showing
3 changed files
with
177 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
||
|