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

use roles for compiler team maintainers #1609

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
14 changes: 7 additions & 7 deletions src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,18 +308,14 @@ impl Team {
let alumni = data
.teams()
.chain(data.archived_teams())
.flat_map(|t| t.alumni())
.map(|a| a.as_str())
.flat_map(|t| t.explicit_alumni())
.map(|a| a.github.as_str())
.filter(|person| !active_members.contains(person));
members.extend(alumni);
}
Ok(members)
}

pub(crate) fn alumni(&self) -> &[String] {
self.people.alumni.as_ref().map_or(&[], Vec::as_slice)
}

pub(crate) fn raw_lists(&self) -> &[TeamList] {
&self.lists
}
Expand Down Expand Up @@ -478,6 +474,10 @@ impl Team {
&self.people.members
}

pub(crate) fn explicit_alumni(&self) -> &[TeamMember] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand the explicit_alumni naming (as opposed to just alumni). Can you explain why that's preferable?

self.people.alumni.as_ref().map_or(&[], Vec::as_slice)
}

pub(crate) fn contains_person(&self, data: &Data, person: &Person) -> Result<bool, Error> {
let members = self.members(data)?;
Ok(members.contains(person.github()))
Expand Down Expand Up @@ -525,7 +525,7 @@ impl std::cmp::Ord for GitHubTeam<'_> {
pub(crate) struct TeamPeople {
pub leads: Vec<String>,
pub members: Vec<TeamMember>,
pub alumni: Option<Vec<String>>,
pub alumni: Option<Vec<TeamMember>>,
#[serde(default)]
pub included_teams: Vec<String>,
#[serde(default = "default_false")]
Expand Down
14 changes: 10 additions & 4 deletions src/static_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ impl<'a> Generator<'a> {
for member in team.explicit_members().iter().cloned() {
website_roles.insert(member.github, member.roles);
}
for alum in team.explicit_alumni().iter().cloned() {
website_roles.insert(alum.github, alum.roles);
}

let leads = team.leads();
let mut members = Vec::new();
Expand All @@ -156,14 +159,17 @@ impl<'a> Generator<'a> {
members.sort_by_key(|member| !member.is_lead);

let mut alumni = Vec::new();
for github_name in team.alumni() {
if let Some(person) = self.data.person(github_name) {
for alum in team.explicit_alumni() {
if let Some(person) = self.data.person(&alum.github) {
alumni.push(v1::TeamMember {
name: person.name().into(),
github: github_name.to_string(),
github: alum.github.to_string(),
github_id: person.github_id(),
is_lead: false,
roles: Vec::new(),
roles: website_roles
.get(alum.github.as_str())
.cloned()
.unwrap_or_default(),
});
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ fn validate_inactive_members(data: &Data, errors: &mut Vec<String>) {
for member in members {
referenced_members.insert(member);
}
for person in team.alumni() {
referenced_members.insert(person);
for person in team.explicit_alumni() {
referenced_members.insert(person.github.as_str());
}
for list in team.raw_lists() {
for person in &list.extra_people {
Expand Down
51 changes: 0 additions & 51 deletions teams/compiler-maintainers.toml

This file was deleted.

72 changes: 38 additions & 34 deletions teams/compiler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,79 +8,83 @@ members = [
"apiraino",
"b-naber",
"bjorn3",
"BoxyUwU",
{ github = "BoxyUwU", roles = ["compiler-maintainer"] },
"camelid",
"chenyukang",
{ github = "chenyukang", roles = ["compiler-maintainer"] },
"ChrisDenton",
"cjgillot",
"compiler-errors",
{ github = "cjgillot", roles = ["compiler-maintainer"] },
{ github = "compiler-errors", roles = ["compiler-maintainer"] },
"cuviper",
"davidtwco",
{ github = "davidtwco", roles = ["compiler-maintainer"] },
"DianQK",
"durin42",
"eholk",
"est31",
"estebank",
"fee1-dead",
{ github = "estebank", roles = ["compiler-maintainer"] },
{ github = "fee1-dead", roles = ["compiler-maintainer"] },
"flodiebold",
"fmease",
"jackh726",
{ github = "jackh726", roles = ["compiler-maintainer"] },
"jieyouxu",
"jswrenn",
"lcnr",
"lqd",
{ github = "lcnr", roles = ["compiler-maintainer"] },
{ github = "lqd", roles = ["compiler-maintainer"] },
"lukas-code",
"m-ou-se",
"Mark-Simulacrum",
"matthewjasper",
"Nadrieril",
"nagisa",
{ github = "Mark-Simulacrum", roles = ["compiler-maintainer"] },
{ github = "matthewjasper", roles = ["compiler-maintainer"] },
{ github = "Nadrieril", roles = ["compiler-maintainer"] },
{ github = "nagisa", roles = ["compiler-maintainer"] },
"nikic",
"nikomatsakis",
"Noratrieb",
"nnethercote",
"oli-obk",
"petrochenkov",
"pnkfelix",
{ github = "nnethercote", roles = ["compiler-maintainer"] },
{ github = "oli-obk", roles = ["compiler-maintainer"] },
{ github = "petrochenkov", roles = ["compiler-maintainer"] },
{ github = "pnkfelix", roles = ["compiler-maintainer"] },
"RalfJung",
"rcvalle",
"saethlin",
{ github = "saethlin", roles = ["compiler-maintainer"] },
"scottmcm",
"SparrowLii",
"spastorino",
{ github = "SparrowLii", roles = ["compiler-maintainer"] },
{ github = "spastorino", roles = ["compiler-maintainer"] },
"TaKO8Ki",
"tgross35",
"the8472",
"tmandry",
"tmiasko",
"Urgau",
"WaffleLapkin",
"wesleywiser",
{ github = "wesleywiser", roles = ["compiler-maintainer"] },
"workingjubilee",
"Zalathar",
]
alumni = [
"Aaron1011",
"Aatch",
"arielb1",
"bkoropoff",
{ github = "Aaron1011", roles = ["compiler-maintainer"] },
{ github = "Aatch", roles = ["compiler-maintainer"] },
{ github = "arielb1", roles = ["compiler-maintainer"] },
{ github = "bkoropoff", roles = ["compiler-maintainer"] },
"Centril",
"cramertj",
"dotdash",
{ github = "cramertj", roles = ["compiler-maintainer"] },
{ github = "dotdash", roles = ["compiler-maintainer"] },
"ecstatic-morse",
"eddyb",
"jseyfried",
{ github = "eddyb", roles = ["compiler-maintainer"] },
{ github = "jseyfried", roles = ["compiler-maintainer"] },
"LeSeulArtichaut",
"matklad",
"michaelwoerister",
"nrc",
{ github = "michaelwoerister", roles = ["compiler-maintainer"] },
{ github = "nrc", roles = ["compiler-maintainer"] },
"scalexm",
"varkor",
{ github = "varkor", roles = ["compiler-maintainer"] },
"Xanewok",
"zackmdavis",
"Zoxc",
{ github = "Zoxc", roles = ["compiler-maintainer"] }
]

[[roles]]
id = "compiler-maintainer"
description = "Maintainer"

[permissions]
perf = true
crater = true
Expand Down