Skip to content

Commit

Permalink
[ci] Roll out teams-tagging to everyone (apache#10739)
Browse files Browse the repository at this point in the history
* [ci] Roll out teams-tagging to everyone

This removes the check for opted-in users from apache#10317, making it so anyone can attach their names without having to also opt-in. Also included is a script to generate the list of owners from `CONTRIBUTING.md` which was used to update apache#10317.

* Cleanup after discussion

Co-authored-by: driazati <driazati@users.noreply.github.com>
  • Loading branch information
2 people authored and altanh committed Apr 28, 2022
1 parent 002e049 commit 17e7718
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions tests/scripts/github_tag_teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,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 @@ -212,9 +200,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 @@ -239,10 +224,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

0 comments on commit 17e7718

Please sign in to comment.