From 9c973d2b24567dde055c45261119baba1bef4e1f Mon Sep 17 00:00:00 2001 From: peterstone2017 <12449837+YunchuWang@users.noreply.github.com> Date: Thu, 23 Oct 2025 09:29:10 -0700 Subject: [PATCH] Release version updated to v1.16.2 and update changelog --- CHANGELOG.md | 5 ++++ eng/targets/Release.props | 2 +- generate_changelog.py | 58 +++++++++++++++++++++++++-------------- 3 files changed, 44 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 083e9c7a..0689d461 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ # Changelog +## v1.16.2 +- Generate changelog script + update changelog for v1.16.1 by wangbill ([#486](https://github.com/microsoft/durabletask-dotnet/pull/486)) +- Remove unnecessary project reference to grpc.azuremanagedbackend in azureblobpayloads.csproj by wangbill ([#485](https://github.com/microsoft/durabletask-dotnet/pull/485)) +- Large payload azure blob externalization support by wangbill ([#468](https://github.com/microsoft/durabletask-dotnet/pull/468)) + ## v1.16.1 - Include exception properties in failure details when orchestration throws directly by Naiyuan Tian ([#482](https://github.com/microsoft/durabletask-dotnet/pull/482)) - Set low priority for scheduled runs by Daniel Castro ([#477](https://github.com/microsoft/durabletask-dotnet/pull/477)) diff --git a/eng/targets/Release.props b/eng/targets/Release.props index 8bbd3785..d4adbf24 100644 --- a/eng/targets/Release.props +++ b/eng/targets/Release.props @@ -17,7 +17,7 @@ - 1.16.1 + 1.16.2 diff --git a/generate_changelog.py b/generate_changelog.py index 83ee8c06..8442a848 100644 --- a/generate_changelog.py +++ b/generate_changelog.py @@ -1,37 +1,55 @@ import subprocess import re import argparse +import sys -def get_git_log(tag): - # try to find previous tag; fall back to the second-latest tag if needed +def run_cmd(cmd): + """Run shell command and return stdout as string.""" try: - prev_tag = subprocess.check_output( - "git tag --sort=-creatordate", shell=True, text=True - ).strip().split("\n") - # take the tag immediately before the given one - if tag in prev_tag: - idx = prev_tag.index(tag) - previous = prev_tag[idx + 1] if idx + 1 < len(prev_tag) else None - else: - previous = prev_tag[1] if len(prev_tag) > 1 else None - except Exception: - previous = None + return subprocess.check_output(cmd, shell=True, text=True, encoding="utf-8", errors="ignore").strip() + except subprocess.CalledProcessError as e: + return "" + +def get_latest_tag(): + tags = run_cmd("git tag --sort=-creatordate").split("\n") + return tags[0] if tags and tags[0] else None + +def branch_exists(branch): + result = run_cmd(f"git rev-parse --verify {branch}") + return bool(result) + +def tag_exists(tag): + result = run_cmd(f"git rev-parse --verify refs/tags/{tag}") + return bool(result) - format_str = "%h||%s||%an" - if previous: - cmd = f'git log {previous}..{tag} --pretty=format:"{format_str}"' +def get_git_log(tag): + """Generate git log range depending on tag availability.""" + tags = [t for t in run_cmd("git tag --sort=-creatordate").split("\n") if t] + latest_tag = tags[0] if tags else None + + if tag_exists(tag): + # Tag exists: find the one before it + if tag in tags: + idx = tags.index(tag) + previous = tags[idx + 1] if idx + 1 < len(tags) else None + else: + previous = tags[1] if len(tags) > 1 else None + cmd = f'git log {previous}..{tag} --pretty=format:"%h||%s||%an"' if previous else f'git log {tag} --pretty=format:"%h||%s||%an" -n 50' else: - # fallback: just commits reachable from tag - cmd = f'git log {tag} --pretty=format:"{format_str}" -n 50' + # Tag does not exist -> generate diff between latest tag and main + print(f"[WARN] Tag '{tag}' not found, generating changelog between latest tag '{latest_tag}' and 'main'") + if not latest_tag: + cmd = f'git log main --pretty=format:"%h||%s||%an" -n 50' + else: + cmd = f'git log {latest_tag}..main --pretty=format:"%h||%s||%an"' print(f"[DEBUG] Running: {cmd}") - output = subprocess.check_output(cmd, shell=True, text=True, encoding="utf-8", errors="ignore") + output = run_cmd(cmd) return [line.strip() for line in output.split("\n") if line.strip()] def extract_pr_info(message): pr_match = re.search(r"(?:#|PR\s*)(\d+)", message) pr_number = pr_match.group(1) if pr_match else None - # Strip out PR refs and noise clean = re.sub(r"\(?#\d+\)?|Merge pull request.*|from.*|PR\s*\d+", "", message) clean = clean.strip().capitalize() return clean, pr_number