From b08b2d26e637a6fb9318cd28dc1cd0f5f40ca555 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Wed, 4 Sep 2019 18:19:19 +0200 Subject: teams/compiler-contributors: include compiler members on github --- docs/toml-schema.md | 2 ++ src/schema.rs | 13 ++++++++++++- teams/compiler-contributors.toml | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/toml-schema.md b/docs/toml-schema.md index cc723e6..ee69908 100644 --- a/docs/toml-schema.md +++ b/docs/toml-schema.md @@ -50,6 +50,8 @@ members = [ [github] team-name = "overlords-team" # The name of the GitHub team (optional) orgs = ["rust-lang"] # Organizations to create the team in (required) +# Include members of these Rust teams in this GitHub team (optional) +extra-teams = ["bots-nursery"] # Define the mailing lists used by the team # It's optional, and there can be more than one diff --git a/src/schema.rs b/src/schema.rs index a95cced..0a25332 100644 --- a/src/schema.rs +++ b/src/schema.rs @@ -222,11 +222,20 @@ impl Team { pub(crate) fn github_teams<'a>(&'a self, data: &Data) -> Result>, Error> { if let Some(github) = &self.github { - let members = self + let mut members = self .members(data)? .iter() .filter_map(|name| data.person(name).map(|p| p.github_id())) .collect::>(); + for team in &github.extra_teams { + members.extend( + data.team(team) + .ok_or_else(|| failure::err_msg(format!("missing team {}", team)))? + .members(data)? + .iter() + .filter_map(|name| data.person(name).map(|p| p.github_id())), + ); + } let name = github .team_name .as_ref() @@ -284,6 +293,8 @@ struct TeamPeople { struct GitHubData { team_name: Option, orgs: Vec, + #[serde(default)] + extra_teams: Vec, } #[derive(serde_derive::Deserialize, Debug)] diff --git a/teams/compiler-contributors.toml b/teams/compiler-contributors.toml index 0383030..4c6c673 100644 --- a/teams/compiler-contributors.toml +++ b/teams/compiler-contributors.toml @@ -26,6 +26,7 @@ bors.rust.review = true [github] orgs = ["rust-lang", "rust-lang-nursery"] +extra-teams = ["compiler"] [website] name = "Compiler team contributors" -- cgit v1.2.3