From bb6e2f0cf293c564e7eb43cd0825b5f78aeeaa59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 24 Oct 2025 21:46:53 +0200 Subject: [PATCH 1/2] Make Zulip ID required --- config.toml | 3 ++- docs/toml-schema.md | 2 +- src/schema.rs | 5 +++++ src/validate.rs | 24 ++++++++++++++++++++++++ 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/config.toml b/config.toml index b6dce8d2d..16641132a 100644 --- a/config.toml +++ b/config.toml @@ -52,9 +52,10 @@ 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 = [] diff --git a/docs/toml-schema.md b/docs/toml-schema.md index 2eed2494e..f3798524d 100644 --- a/docs/toml-schema.md +++ b/docs/toml-schema.md @@ -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. diff --git a/src/schema.rs b/src/schema.rs index 0c3ee2a16..b5f317901 100644 --- a/src/schema.rs +++ b/src/schema.rs @@ -15,6 +15,7 @@ pub(crate) struct Config { permissions_bools: HashSet, // Use a BTreeSet for consistent ordering in tests special_org_members: BTreeSet, + members_without_zulip_id: BTreeSet, } impl Config { @@ -41,6 +42,10 @@ impl Config { pub(crate) fn special_org_members(&self) -> &BTreeSet { &self.special_org_members } + + pub(crate) fn members_without_zulip_id(&self) -> &BTreeSet { + &self.members_without_zulip_id + } } // This is an enum to allow two kinds of values for the email field: diff --git a/src/validate.rs b/src/validate.rs index 386a331da..e4378d2e9 100644 --- a/src/validate.rs +++ b/src/validate.rs @@ -50,6 +50,7 @@ static CHECKS: &[Check)>] = 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, @@ -737,6 +738,29 @@ fn validate_unique_zulip_user_ids(data: &Data, errors: &mut Vec) { }) } +/// 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) { + 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) { wrapper(data.teams(), errors, |team, errors| { From fe46ff4bae431b4269e9d1cc4ba4e2143faae790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 24 Oct 2025 21:56:29 +0200 Subject: [PATCH 2/2] Create allowlist of active Project members that do not have a Zulip ID --- config.toml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/config.toml b/config.toml index 16641132a..d346642d0 100644 --- a/config.toml +++ b/config.toml @@ -58,4 +58,24 @@ special-org-members = [ "skade", ] -members-without-zulip-id = [] +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", +]