Skip to content

Commit

Permalink
Merge branch 'main' into only_enable_runtime_limits_during_js_exec
Browse files Browse the repository at this point in the history
  • Loading branch information
achamayou authored Oct 16, 2023
2 parents 7336af9 + 5a0e0e5 commit d1baad1
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .azure-pipelines-templates/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- script: |
set -ex
python3.8 ./scripts/extract-release-notes.py --target-git-version --append-mcr-images | tee $(Build.BinariesDirectory)/rel-notes.md
python3.8 ./scripts/extract-release-notes.py --target-git-version --append-mcr-images --describe-path-changes "./samples/constitution" | tee $(Build.BinariesDirectory)/rel-notes.md
displayName: Extract release notes
- script: |
Expand Down
35 changes: 35 additions & 0 deletions scripts/extract-release-notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ def main():
action="store_true",
default=False,
)
parser.add_argument(
"--describe-path-changes",
help="If true, add a note whenever the given path has changes between releases.",
action="append",
default=[],
)
args = parser.parse_args()

if args.target_git_version:
Expand Down Expand Up @@ -115,6 +121,34 @@ def main():
print("\n" + "-" * 80 + "\n")
print(f"# {version}")
print("\n".join(release_notes[version]).strip())

for path in args.describe_path_changes:
git_version = f"ccf-{version}"
prev_version = subprocess.run(
["git", "describe", "--tags", f"{git_version}^", "--abbrev=0"],
capture_output=True,
universal_newlines=True,
).stdout.strip()
diff = subprocess.run(
[
"git",
"diff",
"--exit-code",
prev_version,
git_version,
"--",
path,
],
capture_output=True,
universal_newlines=True,
)
if diff.returncode == 1:
# Insert a hyperlink to a GitHub compare page.
# This shows all changes between tags, not localised to the path, but seems to be the best we can do automatically.
print(
f"\n- **Note**: This release include changes to `{path}`, which may be viewed [here](https://github.com/Microsoft/CCF/compare/{prev_version}...{git_version}#files_bucket)"
)

if args.append_mcr_images:
print("\n**MCR Docker Images:** ", end="")
print(
Expand All @@ -125,6 +159,7 @@ def main():
]
)
)

else:
print("CHANGELOG is valid!")

Expand Down

0 comments on commit d1baad1

Please sign in to comment.