Skip to content

Commit

Permalink
Disallow an archived team from having current members (#1130)
Browse files Browse the repository at this point in the history
* Disallow an archived team from having current members

    [ERROR rust_team::validate] validation error: archived team 'docs' must not have current members; please move members to that team's alumni
    [ERROR rust_team::validate] validation error: archived team 'ecosystem' must not have current members; please move members to that team's alumni
    [ERROR rust_team::validate] validation error: archived team 'ides' must not have current members; please move members to that team's alumni
    [ERROR rust_team::validate] validation error: archived team 'interim-leadership-chat' must not have current members; please move members to that team's alumni
    [ERROR rust_team::validate] validation error: archived team 'production' must not have current members; please move members to that team's alumni
    [ERROR rust_team::validate] validation error: archived team 'project-foundation' must not have current members; please move members to that team's alumni
    [ERROR rust_team::validate] validation error: archived team 'wg-meta' must not have current members; please move members to that team's alumni
    [ERROR rust_team::validate] validation error: archived team 'wg-net' must not have current members; please move members to that team's alumni
    [ERROR rust_team::validate] validation error: archived team 'wg-net-async' must not have current members; please move members to that team's alumni
    [ERROR rust_team::validate] validation error: archived team 'wg-net-embedded' must not have current members; please move members to that team's alumni
    [ERROR rust_team::validate] validation error: archived team 'wg-net-web' must not have current members; please move members to that team's alumni
    [ERROR rust_team::validate] validation error: archived team 'wg-nll' must not have current members; please move members to that team's alumni
    [ERROR rust_team::validate] validation error: archived team 'wg-rustfix' must not have current members; please move members to that team's alumni
    [ERROR rust_team::validate] validation error: archived team 'wg-traits' must not have current members; please move members to that team's alumni
    [ERROR rust_team::validate] validation error: archived team 'wg-unsafe-code-guidelines' must not have current members; please move members to that team's alumni
    [ERROR rust_team] 15 validation errors found

* Fix archived team validation errors

* Simplify aggregation of alumni by disregarding archived team current members
  • Loading branch information
dtolnay authored Nov 30, 2023
1 parent 51365b9 commit 322c548
Show file tree
Hide file tree
Showing 17 changed files with 76 additions and 62 deletions.
15 changes: 3 additions & 12 deletions src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,18 +280,9 @@ impl Team {
.teams()
.chain(data.archived_teams())
.flat_map(|t| t.alumni())
.map(|a| a.as_str());
let mut members_of_archived_teams = HashSet::new();

for t in data.archived_teams() {
members_of_archived_teams.extend(t.members(data)?);
}

members.extend(
alumni
.chain(members_of_archived_teams)
.filter(|person| !active_members.contains(person)),
)
.map(|a| a.as_str())
.filter(|person| !active_members.contains(person));
members.extend(alumni);
}
Ok(members)
}
Expand Down
10 changes: 10 additions & 0 deletions src/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ static CHECKS: &[Check<fn(&Data, &mut Vec<String>)>] = checks![
validate_team_leads,
validate_team_members,
validate_alumni,
validate_archived_teams,
validate_inactive_members,
validate_list_email_addresses,
validate_list_extra_people,
Expand Down Expand Up @@ -266,6 +267,15 @@ fn validate_alumni(data: &Data, errors: &mut Vec<String>) {
});
}

fn validate_archived_teams(data: &Data, errors: &mut Vec<String>) {
wrapper(data.archived_teams(), errors, |team, _| {
if !team.members(data)?.is_empty() {
bail!("archived team '{}' must not have current members; please move members to that team's alumni", team.name());
}
Ok(())
})
}

/// Ensure every person is part of at least one team (active or archived)
fn validate_inactive_members(data: &Data, errors: &mut Vec<String>) {
let mut referenced_members = HashSet::new();
Expand Down
5 changes: 3 additions & 2 deletions teams/archive/docs.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name = "docs"

[people]
leads = ["steveklabnik"]
members = [
leads = []
members = []
alumni = [
"steveklabnik",
"GuillaumeGomez",
"rylev",
Expand Down
3 changes: 2 additions & 1 deletion teams/archive/ecosystem.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name = "ecosystem"

[people]
leads = []
members = [
members = []
alumni = [
"KodrAus",
"withoutboats",
"sfackler",
Expand Down
15 changes: 7 additions & 8 deletions teams/archive/ides.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ name = "ides"
subteam-of = "devtools"

[people]
leads = ["Xanewok"]
members = [
leads = []
members = []
alumni = [
"LucasBullen",
"Xanewok",
"alexheretic",
"autozimu",
"jasonwilliams",
"LucasBullen",
"vlad20012",
"Xanewok",
]
alumni = [
"nrc",
"matklad",
"nrc",
"vlad20012",
]

[[github]]
Expand Down
3 changes: 2 additions & 1 deletion teams/archive/interim-leadership-chat.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ name = "interim-leadership-chat"

[people]
leads = []
members = [
members = []
alumni = [
"badboy",
"cuviper",
"jtgeibel",
Expand Down
5 changes: 3 additions & 2 deletions teams/archive/production.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name = "production"

[people]
leads = ["aidanhs"]
members = [
leads = []
members = []
alumni = [
"aidanhs",
"aturon",
"celaus",
Expand Down
16 changes: 6 additions & 10 deletions teams/archive/project-foundation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,17 @@ kind = "project-group"
subteam-of = "core"

[people]
leads = [
"ashleygwilliams",
"nikomatsakis",
]
members = [
"ashleygwilliams",
"nikomatsakis",
"pietroalbini",
"skade",
]
leads = []
members = []
alumni = [
"Manishearth",
"ashleygwilliams",
"joshtriplett",
"nellshamrell",
"nikomatsakis",
"pietroalbini",
"rylev",
"skade",
]

[website]
Expand Down
5 changes: 3 additions & 2 deletions teams/archive/wg-meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ subteam-of = "compiler"
kind = "working-group"

[people]
leads = ["nikomatsakis", "davidtwco", "spastorino"]
members = ["nikomatsakis", "davidtwco", "spastorino"]
leads = []
members = []
alumni = ["nikomatsakis", "davidtwco", "spastorino"]

[website]
name = "Meta working group"
Expand Down
5 changes: 3 additions & 2 deletions teams/archive/wg-net-async.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ subteam-of = "wg-net"
kind = "working-group"

[people]
leads = ["cramertj", "MajorBreakfast"]
members = ["cramertj", "MajorBreakfast"]
leads = []
members = []
alumni = ["cramertj", "MajorBreakfast"]

[website]
name = "Async foundations working group"
Expand Down
5 changes: 3 additions & 2 deletions teams/archive/wg-net-embedded.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ subteam-of = "wg-net"
kind = "working-group"

[people]
leads = ["Nemo157", "levex"]
members = [
leads = []
members = []
alumni = [
"Nemo157",
"levex",
]
Expand Down
5 changes: 3 additions & 2 deletions teams/archive/wg-net-web.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ subteam-of = "wg-net"
kind = "working-group"

[people]
leads = ["aturon", "yoshuawuyts"]
members = ["aturon", "yoshuawuyts"]
leads = []
members = []
alumni = ["aturon", "yoshuawuyts"]

[website]
name = "Web foundations working group"
Expand Down
5 changes: 3 additions & 2 deletions teams/archive/wg-net.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name = "wg-net"
kind = "working-group"

[people]
leads = ["withoutboats", "cramertj"]
members = [
leads = []
members = []
alumni = [
"withoutboats",
"cramertj",
]
Expand Down
5 changes: 3 additions & 2 deletions teams/archive/wg-nll.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ subteam-of = "compiler"
kind = "working-group"

[people]
leads = ["nikomatsakis", "pnkfelix"]
members = ["nikomatsakis", "pnkfelix", "davidtwco", "spastorino", "matthewjasper", "lqd"]
leads = []
members = []
alumni = ["nikomatsakis", "pnkfelix", "davidtwco", "spastorino", "matthewjasper", "lqd"]

[website]
name = "Non-Lexical Lifetimes (NLL) working group"
Expand Down
3 changes: 2 additions & 1 deletion teams/archive/wg-rustfix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ kind = "working-group"

[people]
leads = []
members = [
members = []
alumni = [
"Manishearth",
"estebank",
"killercup",
Expand Down
19 changes: 9 additions & 10 deletions teams/archive/wg-traits.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,8 @@ subteam-of = "compiler"
kind = "working-group"

[people]
leads = ["nikomatsakis", "jackh726"]
members = [
"Aaron1011",
"jackh726",
"lcnr",
"matthewjasper",
"nikomatsakis",
"oli-obk",
"spastorino",
]
leads = []
members = []
alumni = [
"AzureMarker",
"basil-cow",
Expand All @@ -26,6 +18,13 @@ alumni = [
"tmandry",
"yaahc",
"zaharidichev",
"Aaron1011",
"jackh726",
"lcnr",
"matthewjasper",
"nikomatsakis",
"oli-obk",
"spastorino",
]

[website]
Expand Down
14 changes: 11 additions & 3 deletions teams/archive/wg-unsafe-code-guidelines.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@ subteam-of = "lang"
kind = "working-group"

[people]
leads = ["nikomatsakis", "RalfJung"]
members = ["nikomatsakis", "RalfJung", "comex", "digama0", "JakobDegen", "CAD97"]
alumni = ["avadacatavra"]
leads = []
members = []
alumni = [
"avadacatavra",
"nikomatsakis",
"RalfJung",
"comex",
"digama0",
"JakobDegen",
"CAD97",
]

[website]
name = "Unsafe Code Guidelines (UCG) working group"
Expand Down

0 comments on commit 322c548

Please sign in to comment.