Skip to content

Commit 1c60a98

Browse files
committed
Recursively include all subteams of all kinds
This changes it so that the subteam flattening logic will look at all team kinds, not just "Team". This fixes it so that https://www.rust-lang.org/governance/teams/launching-pad will show all the sub-groups of embedded for example.
1 parent 1c24249 commit 1c60a98

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

src/teams.rs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -116,35 +116,27 @@ impl Data {
116116
let superteams: HashMap<_, _> = self
117117
.teams
118118
.iter()
119-
.filter(|team| matches!(team.kind, TeamKind::Team))
120119
.filter_map(|team| Some((team.name.clone(), team.subteam_of.clone()?)))
121120
.collect();
122121

123122
self.teams
124123
.into_iter()
125-
// The leadership-council page should show just the
126-
// leadership-council, not everything underneath it.
127-
.filter(|_| main_team.name != "leadership-council")
128124
.filter(|team| team.website_data.is_some())
129125
.filter(|team| {
130126
// For teams find not only direct subteams but also transitive ones.
131-
if let TeamKind::Team = team.kind {
132-
let mut team = &team.name;
127+
let mut team = &team.name;
133128

134-
// The graph of teams is guaranteed to be acyclic by the CI script of
135-
// the team repository. Therefore this loop has to terminate eventually.
136-
while let Some(superteam) = superteams.get(team) {
137-
if superteam == &main_team.name {
138-
return true;
139-
}
140-
141-
team = superteam;
129+
// The graph of teams is guaranteed to be acyclic by the CI script of
130+
// the team repository. Therefore this loop has to terminate eventually.
131+
while let Some(superteam) = superteams.get(team) {
132+
if superteam == &main_team.name {
133+
return true;
142134
}
143135

144-
return false;
136+
team = superteam;
145137
}
146138

147-
team.subteam_of.as_ref() == Some(&main_team.name)
139+
false
148140
})
149141
.for_each(|team| match team.kind {
150142
TeamKind::Team => raw_subteams.push(team),

0 commit comments

Comments
 (0)