Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Feb 12, 2024
Merged
Changes from 4 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
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 between git revision [{0}](https://dashboard.internetcomputer.org/release/{0}) and [{1}](https://dashboard.internetcomputer.org/release/{1})</p>\n".format(
first_commit, last_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
Loading