Skip to content

Commit 25b5c87

Browse files
authored
Merge pull request #2043 from Kobzol/remove-discord-roles
Remove Discord roles and website Discord info
2 parents aaf9562 + a777f81 commit 25b5c87

32 files changed

+16
-206
lines changed

docs/toml-schema.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,6 @@ page = "lang"
133133
134134
# The GitHub repository where this team does their work.
135135
repo = "http://github.com/rust-lang/lang-team"
136-
# A link to access the team's Discord channel.
137-
discord-invite = "https://discord.gg/e6Q3cvu"
138-
# The name of the team's channel on Discord.
139-
discord-name = "#wg-rustup"
140136
# The name of the team's stream on Zulip.
141137
zulip-stream = "t-lang"
142138
# An alias for the team's matrix room.
@@ -239,13 +235,6 @@ extra-teams = [
239235
excluded-people = [
240236
"rylev",
241237
]
242-
243-
# Roles to define in Discord.
244-
[[discord-roles]]
245-
# The name of the role.
246-
name = "security"
247-
# The color for the role.
248-
color = "#e91e63"
249238
```
250239

251240
## Permissions

rust_team_data/src/v1.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pub struct Team {
2626
pub github: Option<TeamGitHub>,
2727
pub website_data: Option<TeamWebsite>,
2828
pub roles: Vec<MemberRole>,
29-
pub discord: Vec<TeamDiscord>,
3029
}
3130

3231
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
@@ -58,7 +57,6 @@ pub struct TeamWebsite {
5857
pub page: String,
5958
pub email: Option<String>,
6059
pub repo: Option<String>,
61-
pub discord: Option<DiscordInvite>,
6260
pub zulip_stream: Option<String>,
6361
pub matrix_room: Option<String>,
6462
pub weight: i64,
@@ -70,19 +68,6 @@ pub struct MemberRole {
7068
pub description: String,
7169
}
7270

73-
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
74-
pub struct TeamDiscord {
75-
pub name: String,
76-
pub members: Vec<u64>,
77-
pub color: Option<String>,
78-
}
79-
80-
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
81-
pub struct DiscordInvite {
82-
pub channel: String,
83-
pub url: String,
84-
}
85-
8671
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
8772
pub struct Teams {
8873
#[serde(flatten)]

src/schema.rs

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ pub(crate) struct Team {
192192
zulip_groups: Vec<RawZulipGroup>,
193193
#[serde(default)]
194194
zulip_streams: Vec<RawZulipStream>,
195-
discord_roles: Option<Vec<DiscordRole>>,
196195
}
197196

198197
impl Team {
@@ -258,10 +257,6 @@ impl Team {
258257
&self.roles
259258
}
260259

261-
pub(crate) fn discord_roles(&self) -> Option<&Vec<DiscordRole>> {
262-
self.discord_roles.as_ref()
263-
}
264-
265260
/// Exposed only for validation.
266261
pub(crate) fn raw_people(&self) -> &TeamPeople {
267262
&self.people
@@ -509,15 +504,6 @@ impl Team {
509504
Ok(result)
510505
}
511506

512-
pub(crate) fn discord_ids(&self, data: &Data) -> Result<Vec<u64>, Error> {
513-
Ok(self
514-
.members(data)?
515-
.iter()
516-
.flat_map(|name| data.person(name).map(|p| p.discord_id()))
517-
.flatten()
518-
.collect())
519-
}
520-
521507
pub(crate) fn is_alumni_team(&self) -> bool {
522508
self.people.include_all_alumni
523509
}
@@ -537,23 +523,6 @@ impl Team {
537523
}
538524
}
539525

540-
#[derive(serde_derive::Deserialize, Debug)]
541-
#[serde(rename_all = "kebab-case", deny_unknown_fields)]
542-
pub(crate) struct DiscordRole {
543-
name: String,
544-
color: Option<String>,
545-
}
546-
547-
impl DiscordRole {
548-
pub(crate) fn name(&self) -> &str {
549-
&self.name
550-
}
551-
552-
pub(crate) fn color(&self) -> Option<&str> {
553-
self.color.as_ref().map(|s| &s[..])
554-
}
555-
}
556-
557526
#[derive(Eq, PartialEq)]
558527
pub(crate) struct GitHubTeam<'a> {
559528
pub(crate) org: &'a str,
@@ -639,11 +608,6 @@ pub(crate) struct RfcbotData {
639608
pub(crate) exclude_members: Vec<String>,
640609
}
641610

642-
pub(crate) struct DiscordInvite<'a> {
643-
pub(crate) url: &'a str,
644-
pub(crate) channel: &'a str,
645-
}
646-
647611
#[derive(serde_derive::Deserialize, Debug)]
648612
#[serde(rename_all = "kebab-case", deny_unknown_fields)]
649613
pub(crate) struct WebsiteData {
@@ -652,8 +616,6 @@ pub(crate) struct WebsiteData {
652616
page: Option<String>,
653617
email: Option<String>,
654618
repo: Option<String>,
655-
discord_invite: Option<String>,
656-
discord_name: Option<String>,
657619
matrix_room: Option<String>,
658620
zulip_stream: Option<String>,
659621
#[serde(default)]
@@ -685,17 +647,6 @@ impl WebsiteData {
685647
self.repo.as_deref()
686648
}
687649

688-
pub(crate) fn discord(&self) -> Option<DiscordInvite<'_>> {
689-
if let (Some(url), Some(channel)) = (&self.discord_invite, &self.discord_name) {
690-
Some(DiscordInvite {
691-
url: url.as_ref(),
692-
channel: channel.as_ref(),
693-
})
694-
} else {
695-
None
696-
}
697-
}
698-
699650
pub(crate) fn zulip_stream(&self) -> Option<&str> {
700651
self.zulip_stream.as_deref()
701652
}

src/static_api.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,6 @@ fn convert_teams<'a>(
482482
let mut github_teams = team.github_teams(data)?;
483483
github_teams.sort();
484484

485-
let mut member_discord_ids = team.discord_ids(data)?;
486-
member_discord_ids.sort();
487-
488485
let team_data = v1::Team {
489486
name: team.name().into(),
490487
kind: match team.kind() {
@@ -514,10 +511,6 @@ fn convert_teams<'a>(
514511
page: ws.page().unwrap_or_else(|| team.name()).into(),
515512
email: ws.email().map(|e| e.into()),
516513
repo: ws.repo().map(|e| e.into()),
517-
discord: ws.discord().map(|i| v1::DiscordInvite {
518-
channel: i.channel.into(),
519-
url: i.url.into(),
520-
}),
521514
zulip_stream: ws.zulip_stream().map(|s| s.into()),
522515
matrix_room: ws.matrix_room().map(|s| s.into()),
523516
weight: ws.weight(),
@@ -530,19 +523,6 @@ fn convert_teams<'a>(
530523
description: role.description.clone(),
531524
})
532525
.collect(),
533-
discord: team
534-
.discord_roles()
535-
.map(|roles| {
536-
roles
537-
.iter()
538-
.map(|role| v1::TeamDiscord {
539-
name: role.name().into(),
540-
color: role.color().map(String::from),
541-
members: member_discord_ids.clone(),
542-
})
543-
.collect()
544-
})
545-
.unwrap_or_else(Vec::new),
546526
};
547527
team_map.insert(team.name().into(), team_data);
548528
}

src/validate.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ static CHECKS: &[Check<fn(&Data, &mut Vec<String>)>] = checks![
4444
validate_github_teams,
4545
validate_zulip_stream_name,
4646
validate_subteam_of_required,
47-
validate_discord_team_members_have_discord_ids,
4847
validate_unique_zulip_groups,
4948
validate_zulip_group_ids,
5049
validate_zulip_group_extra_people,
@@ -657,28 +656,6 @@ fn validate_subteam_of_required(data: &Data, errors: &mut Vec<String>) {
657656
})
658657
}
659658

660-
fn validate_discord_team_members_have_discord_ids(data: &Data, errors: &mut Vec<String>) {
661-
wrapper(data.teams(), errors, |team, _| {
662-
if team.discord_roles().is_some() && team.name() != "all" {
663-
let team_members = team.members(data)?;
664-
if team_members.len() != team.discord_ids(data)?.len() {
665-
let missing_discord_id = team_members
666-
.into_iter()
667-
.filter(|name| data.person(name).map(|p| p.discord_id()) == Some(None))
668-
.collect::<Vec<_>>();
669-
670-
bail!(
671-
"the following members of the \"{}\" team do not have discord_ids: {}",
672-
team.name(),
673-
missing_discord_id.join(", "),
674-
);
675-
}
676-
}
677-
678-
Ok(())
679-
});
680-
}
681-
682659
/// Ensure every member of a team that has a Zulip group has a Zulip id
683660
fn validate_zulip_users(data: &Data, zulip: &ZulipApi, errors: &mut Vec<String>) {
684661
let by_id = match zulip.get_users(false) {

sync-team/src/github/tests/test_utils.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ impl From<TeamData> for v1::Team {
265265
github: (!gh_teams.is_empty()).then_some(TeamGitHub { teams: gh_teams }),
266266
website_data: None,
267267
roles: vec![],
268-
discord: vec![],
269268
}
270269
}
271270
}

teams/all.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,3 @@ include-team-members = false
2828
extra-emails = [
2929
3030
]
31-
32-
[[discord-roles]]
33-
name = "WGs and Teams"

teams/archive/community-content.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ alumni = [
1616
name = "Content team"
1717
description = "Collecting and developing community content"
1818
repo = "https://github.com/rust-community/content-team"
19-
discord-invite = "https://discord.gg/b7a22kw"
20-
discord-name = "#content-team"
2119

2220
[[github]]
2321
orgs = ["rust-lang"]

teams/archive/wg-net-async.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,3 @@ alumni = ["cramertj", "MajorBreakfast"]
1010
[website]
1111
name = "Async foundations working group"
1212
description = "Stabilizing and documenting the async features of Rust"
13-
discord-invite = "https://discord.gg/JebCvj5"
14-
discord-name = "#wg-net-async"

teams/archive/wg-net-embedded.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,3 @@ alumni = [
1313
[website]
1414
name = "Embedded networking working group"
1515
description = "Supporting IoT development with Rust"
16-
discord-invite = "https://discord.gg/wUQwRea"
17-
discord-name = "#wg-net-embedded"

0 commit comments

Comments
 (0)