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

Consolidate teams that get to review the GuestOS release notes into a… #422

Merged
merged 3 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
45 changes: 37 additions & 8 deletions release-controller/release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import subprocess
import sys
import time
import typing

from dataclasses import dataclass


REPLICA_TEAMS = set(
Expand All @@ -21,6 +24,35 @@
]
)


class Change(typing.TypedDict):
commit: str
team: str
type: str
scope: str
message: str
commiter: str
included: bool


@dataclass
class Team:
name: str
google_docs_handle: str
slack_id: str
send_announcement: bool


RELEASE_NOTES_REVIEWERS = [
Team("consensus", "@team-consensus", "SRJ3R849E", False),
Team("crypto", "@team-crypto", "SU7BZQ78E", False),
Team("execution", "@team-execution", "S01A577UL56", True),
Team("messaging", "@team-messaging", "S01SVC713PS", True),
Team("networking", "@team-networking", "SR6KC1DMZ", False),
Team("node", "@node-team", "S027838EY30", False),
Team("runtime", "@team-runtime", "S03BM6C0CJY", False),
]

TYPE_PRETTY_MAP = {
"feat": ("Features", 0),
"fix": ("Bugfixes", 1),
Expand Down Expand Up @@ -248,7 +280,7 @@ def release_notes(first_commit, last_commit, release_name) -> str:
jira_ticket_regex = r" *\b[A-Z]{2,}\d?-\d+\b:?" # <whitespace?><word boundary><uppercase letters><digit?><hyphen><digits><word boundary><colon?>
empty_brackets_regex = r" *\[ *\]:?" # Sometimes Jira tickets are in square brackets

change_infos = {}
change_infos: dict[str, list[Change]] = {}

ci_patterns = ["/**/*.lock", "/**/*.bzl"]

Expand Down Expand Up @@ -398,25 +430,22 @@ def release_notes(first_commit, last_commit, release_name) -> str:
}
)

reviewers_text = "\n".join([f"- {t.google_docs_handle}" for t in RELEASE_NOTES_REVIEWERS if t.send_announcement])

notes = """\
# Review checklist

<span style="color: red">Please cross-out your team once you finished the review</span>

- @team-consensus
- @team-crypto
- @team-execution
- @team-messaging
- @team-networking
- @node-team
- @team-runtime
{reviewers_text}

# Release Notes for [{rc_name}](https://github.com/dfinity/ic/tree/{rc_name}) ({last_commit})
Changelog since git revision [{first_commit}](https://dashboard.internetcomputer.org/release/{first_commit})
""".format(
rc_name=release_name,
last_commit=last_commit,
first_commit=first_commit,
reviewers_text=reviewers_text,
)

for current_type in sorted(TYPE_PRETTY_MAP, key=lambda x: TYPE_PRETTY_MAP[x][1]):
Expand Down
16 changes: 6 additions & 10 deletions release-controller/slack_announce.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@
from slack_sdk.http_retry.handler import RetryHandler
from slack_sdk.webhook import WebhookClient

teams = [
# "SRJ3R849E", # consensus
# "SU7BZQ78E", # crypto
"S01A577UL56", # execution
"S01SVC713PS", # messaging
# "SR6KC1DMZ", # networking
# "S027838EY30", # node team
# "S03BM6C0CJY", # runtime
]
from .release_notes import RELEASE_NOTES_REVIEWERS


def announce_release(slack_url, version_name, google_doc_url, tag_all_teams):
slack = WebhookClient(url=slack_url, retry_handlers=[RetryHandler(max_retry_count=2)])
notify_line = " ".join([f"<!subteam^{t}>" for t in teams]) if tag_all_teams else "everyone"
notify_line = (
" ".join([f"<!subteam^{t.slack_id}>" for t in RELEASE_NOTES_REVIEWERS if t.send_announcement])
if tag_all_teams
else "everyone"
)
slack.send(
text=f"""\
Hi {notify_line}!
Expand Down
Loading