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

[ci] Roll out teams-tagging to everyone #10739

Merged
merged 2 commits into from
Apr 6, 2022
Merged
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
19 changes: 0 additions & 19 deletions tests/scripts/github_tag_teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,6 @@ def fetch_issue(github: GitHubRepo, issue_number: int):
return r


def find_rollout_users(r: Dict[str, Any]):
issue = r["data"]["repository"]["issue"]
body = issue["body"]
for line in body.split("\n"):
line = line.strip()
if line.startswith("[temporary] opt-in: "):
line = line[len("[temporary] opt-in: ") :]
return find_ccs("cc " + line)

return []


def parse_teams(r: Dict[str, Any], issue_number: int) -> Dict[str, str]:
"""
Fetch an issue and parse out series of tagged people from the issue body
Expand Down Expand Up @@ -209,9 +197,6 @@ def gen_cc_line(users):

# Fetch the list of teams
teams = parse_teams(issue_data, issue_number=int(args.team_issue))
# When rolling out this tool it is limited to certain users, so find that list
rollout_users = find_rollout_users(issue_data)
print(f"[slow rollout] Limiting to opted-in users: {rollout_users}")

print(f"Found these teams in issue #{args.team_issue}\n{json.dumps(teams, indent=2)}")

Expand All @@ -236,10 +221,6 @@ def gen_cc_line(users):
tags = [t.lower() for t in tags]
print(f"Found tags: {tags}")

if author not in rollout_users:
print(f"Author {author} is not opted in, quitting")
exit(0)

# Update the PR or issue based on tags in the title and GitHub tags
to_cc = [teams.get(t, []) for t in tags]
to_cc = list(set(item for sublist in to_cc for item in sublist))
Expand Down