From 260a5c06d9fb856dc0f65d97ba83d76bd4aaa945 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 22 Jan 2019 16:53:19 +0100 Subject: add static api and fix website data --- Cargo.lock | 50 +++++++++++++------ Cargo.toml | 7 +++ README.md | 1 + people/MajorBreakfast.toml | 3 ++ people/Nemo157.toml | 3 ++ people/levex.toml | 3 ++ people/yoshuawuyts.toml | 3 ++ rust_team_data/Cargo.toml | 9 ++++ rust_team_data/src/lib.rs | 1 + rust_team_data/src/v1.rs | 50 +++++++++++++++++++ src/main.rs | 9 ++++ src/schema.rs | 54 ++++++++++++++++++++- src/static_api.rs | 93 ++++++++++++++++++++++++++++++++++++ src/validate.rs | 14 +++++- teams/alumni.toml | 1 + teams/cargo.toml | 1 + teams/clippy.toml | 1 + teams/community-content.toml | 1 + teams/community-events.toml | 1 + teams/community-rustbridge.toml | 1 + teams/community-survey.toml | 1 + teams/community.toml | 4 +- teams/core.toml | 3 +- teams/devtools.toml | 1 + teams/docs.toml | 1 + teams/ides.toml | 1 + teams/infra.toml | 1 + teams/lang-shepherds.toml | 4 -- teams/libs.toml | 1 + teams/mods.toml | 1 + teams/operations.toml | 9 ++++ teams/reference.toml | 1 + teams/release.toml | 1 + teams/rustdoc.toml | 1 + teams/wg-bindgen.toml | 1 + teams/wg-cli.toml | 13 +++++ teams/wg-codegen.toml | 1 + teams/wg-compiler-nll.toml | 1 + teams/wg-compiler-performance.toml | 11 +++++ teams/wg-debugging.toml | 1 + teams/wg-embedded.toml | 5 ++ teams/wg-grammar.toml | 1 + teams/wg-net-async.toml | 13 +++++ teams/wg-net-embedded.toml | 16 +++++++ teams/wg-net-web.toml | 13 +++++ teams/wg-net.toml | 19 ++++++-- teams/wg-rustfmt.toml | 1 + teams/wg-rustup.toml | 1 + teams/wg-traits.toml | 1 + teams/wg-unsafe-code-guidelines.toml | 1 + teams/wg-wasm.toml | 13 +++-- 51 files changed, 416 insertions(+), 32 deletions(-) create mode 100644 people/MajorBreakfast.toml create mode 100644 people/Nemo157.toml create mode 100644 people/levex.toml create mode 100644 people/yoshuawuyts.toml create mode 100644 rust_team_data/Cargo.toml create mode 100644 rust_team_data/src/lib.rs create mode 100644 rust_team_data/src/v1.rs create mode 100644 src/static_api.rs create mode 100644 teams/operations.toml create mode 100644 teams/wg-cli.toml create mode 100644 teams/wg-compiler-performance.toml create mode 100644 teams/wg-net-async.toml create mode 100644 teams/wg-net-embedded.toml create mode 100644 teams/wg-net-web.toml diff --git a/Cargo.lock b/Cargo.lock index 1157ffb..9d27312 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -130,7 +130,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.17 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -150,6 +150,14 @@ dependencies = [ "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "indexmap" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "itoa" version = "0.4.3" @@ -288,15 +296,25 @@ dependencies = [ "curl 0.4.18 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "rust_team_data 1.0.0", + "serde 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "structopt 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rust_team_data" +version = "1.0.0" +dependencies = [ + "indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rustc-demangle" version = "0.1.9" @@ -318,17 +336,20 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.80" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde_derive 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "serde_derive" -version = "1.0.80" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.17 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -338,7 +359,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -374,12 +395,12 @@ dependencies = [ "heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.17 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "syn" -version = "0.15.17" +version = "0.15.26" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", @@ -394,7 +415,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.17 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -437,7 +458,7 @@ name = "toml" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -543,6 +564,7 @@ dependencies = [ "checksum failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "64c2d913fe8ed3b6c6518eedf4538255b989945c14c2a7d5cbff62a5e2120596" "checksum heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea04fa3ead4e05e51a7c806fc07271fdbde4e246a6c6d1efd52e72230b771b82" "checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e" +"checksum indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7e81a7c05f79578dbc15793d8b619db9ba32b4577003ef3af1a91c416798c58d" "checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca488b89a5657b0a2ecd45b95609b3e848cf1755da332a0da46e2b2b1cb371a7" @@ -563,14 +585,14 @@ dependencies = [ "checksum rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "bcfe5b13211b4d78e5c2cadfebd7769197d95c639c35a50057eb4c05de811395" "checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7" "checksum schannel 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "0e1a231dc10abf6749cfa5d7767f25888d484201accbd919b66ab5413c502d56" -"checksum serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)" = "15c141fc7027dd265a47c090bf864cf62b42c4d228bbcf4e51a0c9e2b0d3f7ef" -"checksum serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)" = "225de307c6302bec3898c51ca302fc94a7a1697ef0845fcee6448f33c032249c" +"checksum serde 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)" = "534b8b91a95e0f71bca3ed5824752d558da048d4248c91af873b63bd60519752" +"checksum serde_derive 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)" = "a915306b0f1ac5607797697148c223bedeaa36bcc2e28a01441cd638cc6567b4" "checksum serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)" = "43344e7ce05d0d8280c5940cabb4964bea626aa58b1ec0e8c73fa2a8512a38ce" "checksum socket2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c4d11a52082057d87cb5caa31ad812f4504b97ab44732cd8359df2e9ff9f48e7" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" "checksum structopt 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "41c4a2479a078509940d82773d90ff824a8c89533ab3b59cd3ce8b0c0e369c02" "checksum structopt-derive 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "5352090cfae7a2c85e1a31146268b53396106c88ca5d6ccee2e3fae83b6e35c2" -"checksum syn 0.15.17 (registry+https://github.com/rust-lang/crates.io-index)" = "3391038ebc3e4ab24eb028cb0ef2f2dc4ba0cbf72ee895ed6a6fad730640b5bc" +"checksum syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)" = "f92e629aa1d9c827b2bb8297046c1ccffc57c99b947a680d3ccff1f136a3bee9" "checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" "checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" diff --git a/Cargo.toml b/Cargo.toml index 7d15d7b..2518886 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,3 +15,10 @@ log = "0.4" env_logger = { version = "0.5", default-features = false } structopt = "0.2.13" regex = "1.0.6" +rust_team_data = { path = "rust_team_data" } +indexmap = "1.0.2" + +[workspace] +members = [ + "rust_team_data" +] diff --git a/README.md b/README.md index b860b37..31e4c33 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ directory. The structure of the file is this: ```toml name = "overlords" # Name of the team, used for GitHub (required) +subteam-of = "gods" # Name of the parent team of this team (optional) # Include all the members of the listed teams as members of this team (optional) inherit = [ "kings", diff --git a/people/MajorBreakfast.toml b/people/MajorBreakfast.toml new file mode 100644 index 0000000..36e0ed8 --- /dev/null +++ b/people/MajorBreakfast.toml @@ -0,0 +1,3 @@ +name = "Josef Brandl" +github = "MajorBreakfast" +email = "mail@josefbrandl.de" diff --git a/people/Nemo157.toml b/people/Nemo157.toml new file mode 100644 index 0000000..555bf75 --- /dev/null +++ b/people/Nemo157.toml @@ -0,0 +1,3 @@ +name = "Wim" +github = "Nemo157" +email = "wim@nemo157.com" diff --git a/people/levex.toml b/people/levex.toml new file mode 100644 index 0000000..6817f2d --- /dev/null +++ b/people/levex.toml @@ -0,0 +1,3 @@ +name = "Levente Kurusa" +github = "levex" +email = "lkurusa@kernelstuff.org" diff --git a/people/yoshuawuyts.toml b/people/yoshuawuyts.toml new file mode 100644 index 0000000..97d4fdf --- /dev/null +++ b/people/yoshuawuyts.toml @@ -0,0 +1,3 @@ +name = "Yoshua Wuyts" +github = "yoshuawuyts" +email = "yoshuawuyts@gmail.com" diff --git a/rust_team_data/Cargo.toml b/rust_team_data/Cargo.toml new file mode 100644 index 0000000..296c8d5 --- /dev/null +++ b/rust_team_data/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "rust_team_data" +version = "1.0.0" +authors = ["Pietro Albini "] +edition = "2018" + +[dependencies] +serde = { version = "1.0.85", features = ["derive"] } +indexmap = { version = "1.0.2", features = ["serde-1"] } diff --git a/rust_team_data/src/lib.rs b/rust_team_data/src/lib.rs new file mode 100644 index 0000000..a3a6d96 --- /dev/null +++ b/rust_team_data/src/lib.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/rust_team_data/src/v1.rs b/rust_team_data/src/v1.rs new file mode 100644 index 0000000..8ea29ee --- /dev/null +++ b/rust_team_data/src/v1.rs @@ -0,0 +1,50 @@ +use serde::{Serialize, Deserialize}; +use indexmap::IndexMap; + +pub static BASE_URL: &str = "http://localhost:8000/build/v1"; + +#[derive(Debug, Clone, Copy, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum TeamKind { + Team, + WorkingGroup, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct Team { + pub name: String, + pub kind: TeamKind, + pub subteam_of: Option, + pub members: Vec, + pub website_data: Option, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct TeamMember { + pub name: String, + pub github: String, + pub is_lead: bool, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct TeamWebsite { + pub name: String, + pub description: String, + pub page: String, + pub email: Option, + pub repo: Option, + pub discord: Option, + pub weight: i64, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct DiscordInvite { + pub channel: String, + pub url: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct Teams { + #[serde(flatten)] + pub teams: IndexMap, +} diff --git a/src/main.rs b/src/main.rs index 540c038..fb8f16c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,9 +2,11 @@ mod data; mod schema; mod sync; mod validate; +mod static_api; use crate::data::Data; use failure::{err_msg, Error}; +use std::path::PathBuf; use structopt::StructOpt; #[derive(structopt::StructOpt)] @@ -14,6 +16,8 @@ enum Cli { Check, #[structopt(name = "sync", help = "synchronize the configuration")] Sync, + #[structopt(name = "static-api", help = "generate the static API")] + StaticApi { dest: String }, #[structopt(name = "dump-team", help = "print the members of a team")] DumpTeam { name: String }, #[structopt(name = "dump-list", help = "print all the emails in a list")] @@ -41,6 +45,11 @@ fn run() -> Result<(), Error> { Cli::Sync => { sync::lists::run(&data)?; } + Cli::StaticApi { ref dest } => { + let dest = PathBuf::from(dest); + let generator = crate::static_api::Generator::new(&dest, &data)?; + generator.generate()?; + } Cli::DumpTeam { ref name } => { let team = data.team(name).ok_or_else(|| err_msg("unknown team"))?; diff --git a/src/schema.rs b/src/schema.rs index f527827..bbd577c 100644 --- a/src/schema.rs +++ b/src/schema.rs @@ -48,7 +48,6 @@ pub(crate) struct Person { } impl Person { - #[allow(unused)] pub(crate) fn name(&self) -> &str { &self.name } @@ -88,11 +87,12 @@ impl Person { } #[derive(serde_derive::Deserialize, Debug)] -#[serde(deny_unknown_fields)] +#[serde(deny_unknown_fields, rename_all = "kebab-case")] pub(crate) struct Team { name: String, #[serde(default = "default_false")] wg: bool, + subteam_of: Option, #[serde(default)] children: Vec, people: TeamPeople, @@ -110,10 +110,18 @@ impl Team { self.wg } + pub(crate) fn subteam_of(&self) -> Option<&str> { + self.subteam_of.as_ref().map(|s| s.as_str()) + } + pub(crate) fn leads(&self) -> HashSet<&str> { self.people.leads.iter().map(|s| s.as_str()).collect() } + pub(crate) fn website_data(&self) -> Option<&WebsiteData> { + self.website.as_ref() + } + pub(crate) fn members<'a>(&'a self, data: &'a Data) -> Result, Error> { let mut members: HashSet<_> = self.people.members.iter().map(|s| s.as_str()).collect(); for subteam in &self.children { @@ -196,15 +204,57 @@ struct TeamPeople { include_wg_leads: bool, } +pub(crate) struct DiscordInvite<'a> { + pub(crate) url: &'a str, + pub(crate) channel: &'a str, +} + #[derive(serde_derive::Deserialize, Debug)] #[serde(rename_all = "kebab-case", deny_unknown_fields)] pub(crate) struct WebsiteData { name: String, description: String, + page: Option, email: Option, repo: Option, discord_invite: Option, discord_name: Option, + #[serde(default)] + weight: i64, +} + +impl WebsiteData { + pub(crate) fn name(&self) -> &str { + &self.name + } + + pub(crate) fn description(&self) -> &str { + &self.description + } + + pub(crate) fn weight(&self) -> i64 { + self.weight + } + + pub(crate) fn page(&self) -> Option<&str> { + self.page.as_ref().map(|s| s.as_str()) + } + + pub(crate) fn email(&self) -> Option<&str> { + self.email.as_ref().map(|s| s.as_str()) + } + + pub(crate) fn repo(&self) -> Option<&str> { + self.repo.as_ref().map(|s| s.as_str()) + } + + pub(crate) fn discord(&self) -> Option { + if let (Some(url), Some(channel)) = (&self.discord_invite, &self.discord_name) { + Some(DiscordInvite { url: url.as_ref(), channel: channel.as_ref() }) + } else { + None + } + } } #[derive(serde_derive::Deserialize, Debug)] diff --git a/src/static_api.rs b/src/static_api.rs new file mode 100644 index 0000000..1beea23 --- /dev/null +++ b/src/static_api.rs @@ -0,0 +1,93 @@ +use crate::data::Data; +use rust_team_data::v1; +use failure::Error; +use log::info; +use std::path::Path; +use indexmap::IndexMap; + +pub(crate) struct Generator<'a> { + dest: &'a Path, + data: &'a Data, +} + +impl<'a> Generator<'a> { + pub(crate) fn new(dest: &'a Path, data: &'a Data) -> Result, Error> { + if dest.is_dir() { + std::fs::remove_dir_all(&dest)?; + } + std::fs::create_dir_all(&dest)?; + + Ok(Generator { dest, data }) + } + + pub(crate) fn generate(&self) -> Result<(), Error> { + self.generate_teams()?; + Ok(()) + } + + fn generate_teams(&self) -> Result<(), Error> { + let mut teams = IndexMap::new(); + + for team in self.data.teams() { + let leads = team.leads(); + let mut members = Vec::new(); + for github_name in &team.members(&self.data)? { + if let Some(person) = self.data.person(github_name) { + members.push(v1::TeamMember { + name: person.name().into(), + github: (*github_name).into(), + is_lead: leads.contains(github_name), + }); + } + } + members.sort_by_key(|member| member.github.to_lowercase()); + members.sort_by_key(|member| !member.is_lead); + + let team_data = v1::Team { + name: team.name().into(), + kind: if team.is_wg() { + v1::TeamKind::WorkingGroup + } else { + v1::TeamKind::Team + }, + subteam_of: team.subteam_of().map(|st| st.into()), + members, + website_data: team.website_data().map(|ws| v1::TeamWebsite { + name: ws.name().into(), + description: ws.description().into(), + page: ws.page().unwrap_or(team.name()).into(), + email: ws.email().map(|e| e.into()), + repo: ws.repo().map(|e| e.into()), + discord: ws.discord().map(|i| v1::DiscordInvite { + channel: i.channel.into(), + url: i.url.into(), + }), + weight: ws.weight(), + }), + }; + + self.add(&format!("v1/teams/{}.json", team.name()), &team_data)?; + teams.insert(team.name().into(), team_data); + } + + teams.sort_keys(); + self.add( + "v1/teams.json", + &v1::Teams { teams }, + )?; + Ok(()) + } + + fn add(&self, path: &str, obj: &T) -> Result<(), Error> { + info!("writing API object {}...", path); + let dest = self.dest.join(path); + if let Some(parent) = dest.parent() { + if !parent.exists() { + std::fs::create_dir_all(parent)?; + } + } + let json = serde_json::to_string_pretty(obj)?; + std::fs::write(&dest, json.as_bytes())?; + Ok(()) + } +} diff --git a/src/validate.rs b/src/validate.rs index c9c66a5..8b3208e 100644 --- a/src/validate.rs +++ b/src/validate.rs @@ -1,6 +1,6 @@ use crate::data::Data; -use failure::{bail, Error}; use crate::schema::Email; +use failure::{bail, ensure, Error}; use regex::Regex; use std::collections::HashSet; @@ -8,6 +8,7 @@ pub(crate) fn validate(data: &Data) -> Result<(), Error> { let mut errors = Vec::new(); validate_wg_names(data, &mut errors); + validate_subteam_of(data, &mut errors); validate_team_leads(data, &mut errors); validate_team_members(data, &mut errors); validate_inactive_members(data, &mut errors); @@ -44,6 +45,17 @@ fn validate_wg_names(data: &Data, errors: &mut Vec) { }); } +/// Ensure `subteam-of` points to an existing team +fn validate_subteam_of(data: &Data, errors: &mut Vec) { + let team_names: HashSet<_> = data.teams().map(|t| t.name()).collect(); + wrapper(data.teams(), errors, |team, _| { + if let Some(subteam_of) = team.subteam_of() { + ensure!(team_names.contains(subteam_of), "team `{}` doesn't exist", subteam_of); + } + Ok(()) + }); +} + /// Ensure team leaders are part of the teams they lead fn validate_team_leads(data: &Data, errors: &mut Vec) { wrapper(data.teams(), errors, |team, errors| { diff --git a/teams/alumni.toml b/teams/alumni.toml index aa53c22..89d0467 100644 --- a/teams/alumni.toml +++ b/teams/alumni.toml @@ -23,3 +23,4 @@ members = [ [website] name = "Rust team alumni" description = "enjoying a leisurely retirement" +weight = -1000 diff --git a/teams/cargo.toml b/teams/cargo.toml index c852b6d..00dc04a 100644 --- a/teams/cargo.toml +++ b/teams/cargo.toml @@ -1,4 +1,5 @@ name = "cargo" +subteam-of = "devtools" [people] leads = ["nrc"] diff --git a/teams/clippy.toml b/teams/clippy.toml index 2a3f5f4..6efb4ab 100644 --- a/teams/clippy.toml +++ b/teams/clippy.toml @@ -1,4 +1,5 @@ name = "clippy" +subteam-of = "devtools" [people] leads = ["manishearth", "oli-obk"] diff --git a/teams/community-content.toml b/teams/community-content.toml index 215ab46..ecc259f 100644 --- a/teams/community-content.toml +++ b/teams/community-content.toml @@ -1,4 +1,5 @@ name = "community-content" +subteam-of = "community" [people] leads = [] diff --git a/teams/community-events.toml b/teams/community-events.toml index 5a5afe5..a22ed99 100644 --- a/teams/community-events.toml +++ b/teams/community-events.toml @@ -1,4 +1,5 @@ name = "community-events" +subteam-of = "community" [people] leads = ["skade"] diff --git a/teams/community-rustbridge.toml b/teams/community-rustbridge.toml index 2612119..acb7924 100644 --- a/teams/community-rustbridge.toml +++ b/teams/community-rustbridge.toml @@ -1,4 +1,5 @@ name = "community-rustbridge" +subteam-of = "community" [people] leads = ["oe"] diff --git a/teams/community-survey.toml b/teams/community-survey.toml index f0fd2fe..adc6323 100644 --- a/teams/community-survey.toml +++ b/teams/community-survey.toml @@ -1,4 +1,5 @@ name = "community-survey" +subteam-of = "community" [people] leads = ["jturner"] diff --git a/teams/community.toml b/teams/community.toml index 92c95ae..13ad3dc 100644 --- a/teams/community.toml +++ b/teams/community.toml @@ -15,11 +15,11 @@ members = [ [website] name = "Community team" -description = "coordination and supporting events, content creation, the RustBridge program, and the survey" +description = "Coordination and supporting events, content creation, the RustBridge program, and the survey." email = "community@rust-lang.org" repo = "https://github.com/rust-community/team" discord-invite = "https://discord.gg/KskHZGT" -discord-name = "#general" +discord-name = "#community-team" [[lists]] address = "community@rust-lang.org" diff --git a/teams/core.toml b/teams/core.toml index 9ad0d8b..d9f8157 100644 --- a/teams/core.toml +++ b/teams/core.toml @@ -17,8 +17,9 @@ members = [ [website] name = "Core team" -description = "overall direction of the project, subteam leadership, cross-cutting concerns" +description = "Direction of the project, subteam leadership, cross-cutting concerns." email = "core@rust-lang.org" +weight = 1000 [[lists]] address = "core@rust-lang.org" diff --git a/teams/devtools.toml b/teams/devtools.toml index c3c576c..4b88773 100644 --- a/teams/devtools.toml +++ b/teams/devtools.toml @@ -5,6 +5,7 @@ leads = [] members = [] [website] +page = "dev-tools" name = "Dev tools team" description = "Rust developer tools" repo = "https://github.com/rust-dev-tools/dev-tools-team" diff --git a/teams/docs.toml b/teams/docs.toml index 66bfdcc..8e61994 100644 --- a/teams/docs.toml +++ b/teams/docs.toml @@ -10,6 +10,7 @@ members = [ ] [website] +page = "documentation" name = "Documentation team" description = "ensuring Rust has fantastic documentation" diff --git a/teams/ides.toml b/teams/ides.toml index 057d6d1..5f4c978 100644 --- a/teams/ides.toml +++ b/teams/ides.toml @@ -1,4 +1,5 @@ name = "ides" +subteam-of = "devtools" [people] leads = ["nrc", "Xanewok"] diff --git a/teams/infra.toml b/teams/infra.toml index 57e67ba..47cda71 100644 --- a/teams/infra.toml +++ b/teams/infra.toml @@ -1,4 +1,5 @@ name = "infra" +subteam-of = "operations" [people] leads = ["aidanhs"] diff --git a/teams/lang-shepherds.toml b/teams/lang-shepherds.toml index f3291fe..9a81f10 100644 --- a/teams/lang-shepherds.toml +++ b/teams/lang-shepherds.toml @@ -7,7 +7,3 @@ members = [ "whitequark", "rpjohnst", ] - -[website] -name = "Language team shepherds" -description = "helping guide language RFCs to completion, assisting the language team with its work" diff --git a/teams/libs.toml b/teams/libs.toml index af39ed3..47dcad9 100644 --- a/teams/libs.toml +++ b/teams/libs.toml @@ -15,6 +15,7 @@ members = [ ] [website] +page = "library" name = "Library team" description = "the Rust standard library, rust-lang crates, conventions, and ecosystem support" diff --git a/teams/mods.toml b/teams/mods.toml index f006316..94bfaa4 100644 --- a/teams/mods.toml +++ b/teams/mods.toml @@ -12,6 +12,7 @@ members = [ ] [website] +page = "moderation" name = "Moderation team" description = "helping uphold the code of conduct" email = "rust-mods@rust-lang.org" diff --git a/teams/operations.toml b/teams/operations.toml new file mode 100644 index 0000000..1dad77d --- /dev/null +++ b/teams/operations.toml @@ -0,0 +1,9 @@ +name = "operations" + +[people] +leads = [] +members = [] + +[website] +name = "Operations team" +description = "Handling releases, bots, infra, and more." diff --git a/teams/reference.toml b/teams/reference.toml index 2731a7b..23b950f 100644 --- a/teams/reference.toml +++ b/teams/reference.toml @@ -1,4 +1,5 @@ name = "reference" +subteam-of = "docs" [people] leads = ["Havvy"] diff --git a/teams/release.toml b/teams/release.toml index b6b0520..4351df4 100644 --- a/teams/release.toml +++ b/teams/release.toml @@ -1,4 +1,5 @@ name = "release" +subteam-of = "operations" [people] leads = ["Mark-Simulacrum"] diff --git a/teams/rustdoc.toml b/teams/rustdoc.toml index 73728b3..b0c83c5 100644 --- a/teams/rustdoc.toml +++ b/teams/rustdoc.toml @@ -1,4 +1,5 @@ name = "rustdoc" +subteam-of = "devtools" [people] leads = ["QuietMisdreavus"] diff --git a/teams/wg-bindgen.toml b/teams/wg-bindgen.toml index 7502059..a84588e 100644 --- a/teams/wg-bindgen.toml +++ b/teams/wg-bindgen.toml @@ -1,4 +1,5 @@ name = "wg-bindgen" +subteam-of = "devtools" wg = true [people] diff --git a/teams/wg-cli.toml b/teams/wg-cli.toml new file mode 100644 index 0000000..76df650 --- /dev/null +++ b/teams/wg-cli.toml @@ -0,0 +1,13 @@ +name = "wg-cli" +wg = true + +[people] +leads = ["killercup"] +members = ["killercup"] + +[website] +page = "cli" +name = "Command-line interfaces (CLI) working group" +description = "Focusing on the end-to-end experience of writing CLI apps, both large and small, in Rust." +discord-invite = "https://discord.gg/BXCBYX6" +discord-name = "#wg-cli" diff --git a/teams/wg-codegen.toml b/teams/wg-codegen.toml index 456b9b6..ec8ac8c 100644 --- a/teams/wg-codegen.toml +++ b/teams/wg-codegen.toml @@ -1,4 +1,5 @@ name = "wg-codegen" +subteam-of = "compiler" wg = true [people] diff --git a/teams/wg-compiler-nll.toml b/teams/wg-compiler-nll.toml index 26acd41..5e8d49d 100644 --- a/teams/wg-compiler-nll.toml +++ b/teams/wg-compiler-nll.toml @@ -1,4 +1,5 @@ name = "wg-compiler-nll" +subteam-of = "compiler" wg = true [people] diff --git a/teams/wg-compiler-performance.toml b/teams/wg-compiler-performance.toml new file mode 100644 index 0000000..0ca606c --- /dev/null +++ b/teams/wg-compiler-performance.toml @@ -0,0 +1,11 @@ +name = "wg-compiler-performance" +subteam-of = "compiler" +wg = true + +[people] +leads = ["nikomatsakis"] +members = ["nikomatsakis"] + +[website] +name = "Compiler Performance" +description = "Improving rustc compilation performance (build times)." diff --git a/teams/wg-debugging.toml b/teams/wg-debugging.toml index b8b9dad..21b0b88 100644 --- a/teams/wg-debugging.toml +++ b/teams/wg-debugging.toml @@ -1,4 +1,5 @@ name = "wg-debugging" +subteam-of = "devtools" wg = true [people] diff --git a/teams/wg-embedded.toml b/teams/wg-embedded.toml index c598070..bcf531d 100644 --- a/teams/wg-embedded.toml +++ b/teams/wg-embedded.toml @@ -33,6 +33,11 @@ members = [ "wizofe", ] +[website] +page = "embedded" +name = "Embedded devices working group" +description = "Focusing on the end-to-end experience of using Rust in resource-constrained environments and non-traditional platforms." + [[lists]] address = "embedded-wg@rust-lang.org" access-level = "everyone" diff --git a/teams/wg-grammar.toml b/teams/wg-grammar.toml index 2ea1d64..8de830e 100644 --- a/teams/wg-grammar.toml +++ b/teams/wg-grammar.toml @@ -1,4 +1,5 @@ name = "wg-grammar" +subteam-of = "lang" wg = true [people] diff --git a/teams/wg-net-async.toml b/teams/wg-net-async.toml new file mode 100644 index 0000000..7473847 --- /dev/null +++ b/teams/wg-net-async.toml @@ -0,0 +1,13 @@ +name = "wg-net-async" +subteam-of = "wg-net" +wg = true + +[people] +leads = ["cramertj", "MajorBreakfast"] +members = ["cramertj", "MajorBreakfast"] + +[website] +name = "Async foundations working group" +description = "Our goal is to bring async/await onto a path to stabilization and to provide documentation for asynchronous programming." +discord-invite = "https://discord.gg/JebCvj5" +discord-name = "#wg-net-async" diff --git a/teams/wg-net-embedded.toml b/teams/wg-net-embedded.toml new file mode 100644 index 0000000..51b83e8 --- /dev/null +++ b/teams/wg-net-embedded.toml @@ -0,0 +1,16 @@ +name = "wg-net-embedded" +subteam-of = "wg-net" +wg = true + +[people] +leads = ["Nemo157", "levex"] +members = [ + "Nemo157", + "levex", +] + +[website] +name = "Embedded networking group" +description = "Our goal is to support IoT development." +discord-invite = "https://discord.gg/wUQwRea" +discord-name = "#wg-net-embedded" diff --git a/teams/wg-net-web.toml b/teams/wg-net-web.toml new file mode 100644 index 0000000..a54700c --- /dev/null +++ b/teams/wg-net-web.toml @@ -0,0 +1,13 @@ +name = "wg-net-web" +subteam-of = "wg-net" +wg = true + +[people] +leads = ["aturon", "yoshuawuyts"] +members = ["aturon", "yoshuawuyts"] + +[website] +name = "Web foundations working group" +description = "Our goal is to improve web programming in Rust." +discord-invite = "https://discord.gg/NKHgJpq" +discord-name = "#wg-net-web" diff --git a/teams/wg-net.toml b/teams/wg-net.toml index 9a06ffd..e083f7a 100644 --- a/teams/wg-net.toml +++ b/teams/wg-net.toml @@ -6,18 +6,27 @@ leads = ["withoutboats", "cramertj"] members = [ "withoutboats", "cramertj", - "aturon", - "Mark-Simulacrum", - "aidanhs", - "sfackler", ] +[website] +page = "networking" +name = "Networking working group" +description = "Focusing on the end-to-end experience for both sync and async networking code, in coordination with the growing ecosystem in this space." +discord-invite = "https://discord.gg/ueak2ds" +discord-name = "#wg-net" + [[lists]] address = "net@rust-lang.org" access-level = "everyone" +extra-people = [ + "aturon", + "Mark-Simulacrum", + "aidanhs", + "sfackler", + "MajorBreakfast", +] extra-emails = [ "bob@cloudflare.com", - "mail@josefbrandl.de", "tinagma@gmail.com", "coleman.mcfarland@gmail.com", "dbarsky@amazon.com", diff --git a/teams/wg-rustfmt.toml b/teams/wg-rustfmt.toml index 92f84e7..9bcac6c 100644 --- a/teams/wg-rustfmt.toml +++ b/teams/wg-rustfmt.toml @@ -1,4 +1,5 @@ name = "wg-rustfmt" +subteam-of = "devtools" wg = true [people] diff --git a/teams/wg-rustup.toml b/teams/wg-rustup.toml index 4c1d035..0c6cfed 100644 --- a/teams/wg-rustup.toml +++ b/teams/wg-rustup.toml @@ -1,4 +1,5 @@ name = "wg-rustup" +subteam-of = "devtools" wg = true [people] diff --git a/teams/wg-traits.toml b/teams/wg-traits.toml index f608fe1..0d8d5b2 100644 --- a/teams/wg-traits.toml +++ b/teams/wg-traits.toml @@ -1,4 +1,5 @@ name = "wg-traits" +subteam-of = "compiler" wg = true [people] diff --git a/teams/wg-unsafe-code-guidelines.toml b/teams/wg-unsafe-code-guidelines.toml index 0a89068..5ddf602 100644 --- a/teams/wg-unsafe-code-guidelines.toml +++ b/teams/wg-unsafe-code-guidelines.toml @@ -1,4 +1,5 @@ name = "wg-unsafe-code-guidelines" +subteam-of = "lang" wg = true [people] diff --git a/teams/wg-wasm.toml b/teams/wg-wasm.toml index 10e4e0e..eec4fd6 100644 --- a/teams/wg-wasm.toml +++ b/teams/wg-wasm.toml @@ -5,11 +5,18 @@ wg = true leads = ["fitzgen"] members = [ "fitzgen", - "alexcrichton", - "aturon", - "mgattozzi", ] [[lists]] address = "wasm@rust-lang.org" access-level = "everyone" +extra-people = [ + "alexcrichton", + "aturon", + "mgattozzi", +] + +[website] +page = "wasm" +name = "WebAssembly (WASM) working group" +description = "Focusing on the end-to-end experience of embedding Rust code in JS libraries and apps via WebAssembly." -- cgit v1.2.3