summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2019-09-04 18:19:19 +0200
committerPietro Albini <pietro@pietroalbini.org>2019-09-04 18:19:19 +0200
commitb08b2d26e637a6fb9318cd28dc1cd0f5f40ca555 (patch)
treec9f12d5e4f83e1fb4082073807c21f0b449f8127
parenta4170ba3d5cd5c729162cfdbcfca3710a8c0d0de (diff)
teams/compiler-contributors: include compiler members on github
-rw-r--r--docs/toml-schema.md2
-rw-r--r--src/schema.rs13
-rw-r--r--teams/compiler-contributors.toml1
3 files changed, 15 insertions, 1 deletions
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<Vec<GitHubTeam<'a>>, 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::<Vec<_>>();
+ 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<String>,
orgs: Vec<String>,
+ #[serde(default)]
+ extra_teams: Vec<String>,
}
#[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"