Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,30 @@ special-org-members = [
"rust-log-analyzer",
"rust-timer",
"rustbot",

# Ferrous systems employees who manage the github sponsors
# for rust-analyzer.
"MissHolmes",
"skade",
]

members-without-zulip-id = [
"Nashenas88",
"brotzeit",
"KannanPalani57",
"gdr-at-ms",
"arshiamufti",
"codesections",
"bnchi",
"retep998",
"eldruin",
"patchfx",
"kennykerr",
"xry111",
"reitermarkus",
"chris-morgan",
"nico-abram",
"opeolluwa",
"celaus",
"xiangzhai",
"mathk",
]
2 changes: 1 addition & 1 deletion docs/toml-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The file structure is this:
name = "John Doe" # Real name of the person (required)
github = "johndoe" # GitHub username of the person (required)
github-id = 123456 # GitHub ID of the person (required)
zulip-id = 123456 # Zulip ID of the person (optional)
zulip-id = 123456 # Zulip ID of the person (required)
discord-id = 123456 # Discord ID of the person (optional)
# You can also set `email = false` to explicitly disable the email for the user.
# This will, for example, avoid adding the person to the mailing lists.
Expand Down
5 changes: 5 additions & 0 deletions src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub(crate) struct Config {
permissions_bools: HashSet<String>,
// Use a BTreeSet for consistent ordering in tests
special_org_members: BTreeSet<String>,
members_without_zulip_id: BTreeSet<String>,
}

impl Config {
Expand All @@ -41,6 +42,10 @@ impl Config {
pub(crate) fn special_org_members(&self) -> &BTreeSet<String> {
&self.special_org_members
}

pub(crate) fn members_without_zulip_id(&self) -> &BTreeSet<String> {
&self.members_without_zulip_id
}
}

// This is an enum to allow two kinds of values for the email field:
Expand Down
24 changes: 24 additions & 0 deletions src/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ static CHECKS: &[Check<fn(&Data, &mut Vec<String>)>] = checks![
validate_zulip_group_extra_people,
validate_unique_zulip_streams,
validate_unique_zulip_user_ids,
validate_present_zulip_id,
validate_zulip_stream_ids,
validate_zulip_stream_extra_people,
validate_repos,
Expand Down Expand Up @@ -737,6 +738,29 @@ fn validate_unique_zulip_user_ids(data: &Data, errors: &mut Vec<String>) {
})
}

/// Ensure that every active member except a few remaining people on an allowlist have a Zulip ID.
fn validate_present_zulip_id(data: &Data, errors: &mut Vec<String>) {
wrapper(
data.active_members().unwrap().iter(),
errors,
|person, _| {
let person = data.person(person).expect("Person not found");
if person.zulip_id().is_none()
&& !data
.config()
.members_without_zulip_id()
.contains(person.github())
{
return Err(anyhow::anyhow!(
"User {} does not have a Zulip ID",
person.github()
));
}
Ok(())
},
)
}

/// Ensure team members in Zulip groups have a Zulip id
fn validate_zulip_group_ids(data: &Data, errors: &mut Vec<String>) {
wrapper(data.teams(), errors, |team, errors| {
Expand Down
Loading