Skip to content

Commit

Permalink
feat(release-notes): Show start and end commit in the release notes (#…
Browse files Browse the repository at this point in the history
…186)

* feat(release-notes): Show start and end commit in the release notes

* add newline

* fix python syntax

* Add a link to the release page on the public dashboard

* Only include the "since" git rev
  • Loading branch information
sasa-tomic committed Feb 12, 2024
1 parent 47edf24 commit 4adbc7d
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions scripts/release-notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def file_changes_for_commit(commit_hash, repo_dir):


def parse_codeowners(codeowners_path):
with open(codeowners_path) as f:
with open(codeowners_path, encoding="utf8") as f:
codeowners = f.readlines()
filtered = [line.strip() for line in codeowners]
filtered = [line for line in filtered if line and not line.startswith("#")]
Expand Down Expand Up @@ -317,7 +317,8 @@ def main():
print("WARNING: max commits limit reached, increase depth")
exit(1)

bazel_query = ["bazel",
bazel_query = [
"bazel",
"query",
"--universe_scope=//...",
"deps(//ic-os/guestos/envs/prod:update-img.tar.gz) union deps(//ic-os/setupos/envs/prod:disk-img.tar.gz)",
Expand All @@ -328,16 +329,17 @@ def main():
cwd=ic_repo_path,
text=True,
stdout=subprocess.PIPE,
check=False,
)
if p.returncode != 0:
print("Failure running Bazel through container. Attempting direct run.", file=sys.stderr)
p = subprocess.run(
bazel_query,
cwd=ic_repo_path,
text=True,
cwd=ic_repo_path,
text=True,
stdout=subprocess.PIPE,
check=True,
)
)
replica_packages = p.stdout.strip().splitlines()

replica_packages_filtered = [
Expand Down Expand Up @@ -383,7 +385,7 @@ def main():

teams = []
if ownership:
max_ownership = ownership[max(ownership, key=lambda x: ownership[x])]
max_ownership = max(ownership.items(), key=lambda changed_lines_per_team: changed_lines_per_team[1])[1]
# Since multiple teams can own a path in CODEOWNERS we have to handle what happens if two teams have max changes
for key, value in ownership.items():
if value >= max_ownership * MAX_OWNERSHIP_AREA:
Expand Down Expand Up @@ -436,6 +438,11 @@ def main():
rc_name, last_commit
)
)
output.write(
"<br><p>Change log since git revision [{0}](https://dashboard.internetcomputer.org/release/{0})</p>\n".format(
first_commit
)
)

for current_type in sorted(TYPE_PRETTY_MAP, key=lambda x: TYPE_PRETTY_MAP[x][1]):
if current_type not in change_infos:
Expand Down

0 comments on commit 4adbc7d

Please sign in to comment.