Skip to content
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
2 changes: 1 addition & 1 deletion eng/targets/Release.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</PropertyGroup>

<PropertyGroup>
<VersionPrefix>1.16.1</VersionPrefix>
<VersionPrefix>1.16.2</VersionPrefix>
<VersionSuffix></VersionSuffix>
</PropertyGroup>

Expand Down
58 changes: 38 additions & 20 deletions generate_changelog.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading