Skip to content

Commit b2bc0fa

Browse files
committed
Do not invite rust-lang-owner to be an owner
It doesn't make sense, it already has to be an owner, otherwise it couldn't access these crates.
1 parent 061c994 commit b2bc0fa

File tree

2 files changed

+6
-23
lines changed

2 files changed

+6
-23
lines changed

sync-team/src/crates_io/api.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,6 @@ pub(crate) struct CratesIoOwner {
322322
}
323323

324324
impl CratesIoOwner {
325-
pub(crate) fn user(login: String) -> Self {
326-
Self {
327-
login,
328-
kind: OwnerKind::User,
329-
}
330-
}
331-
332325
pub(crate) fn team(org: String, name: String) -> Self {
333326
Self {
334327
login: format!("github:{org}:{name}"),

sync-team/src/crates_io/mod.rs

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ use secrecy::SecretString;
99
use std::collections::{BTreeMap, HashSet};
1010
use std::fmt::{Display, Formatter};
1111

12-
/// Special account that should own our managed crates.
13-
const RUST_LANG_OWNER_ACCOUNT: &str = "rust-lang-owner";
14-
1512
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
1613
struct CrateName(String);
1714

@@ -161,14 +158,6 @@ impl SyncCratesIo {
161158
.list_crate_owners(&krate.0)
162159
.with_context(|| anyhow::anyhow!("Cannot list crate owners of {krate}"))?;
163160

164-
let mut owners_to_add = vec![];
165-
166-
let rust_lang_owner = CratesIoOwner::user(RUST_LANG_OWNER_ACCOUNT.to_string());
167-
// Make sure that `rust-lang-owner` is an owner of each managed crate
168-
if !owners.contains(&rust_lang_owner) {
169-
owners_to_add.push(rust_lang_owner);
170-
}
171-
172161
// Sync team owners
173162
let existing_teams: HashSet<CratesIoOwner> = owners
174163
.iter()
@@ -183,13 +172,14 @@ impl SyncCratesIo {
183172
.iter()
184173
.map(|team| CratesIoOwner::team(team.org.clone(), team.name.clone()))
185174
.collect();
186-
let teams_to_add = target_teams.difference(&existing_teams).cloned();
187-
owners_to_add.extend(teams_to_add);
188-
189-
if !owners_to_add.is_empty() {
175+
let teams_to_add = target_teams
176+
.difference(&existing_teams)
177+
.cloned()
178+
.collect::<Vec<_>>();
179+
if !teams_to_add.is_empty() {
190180
crate_diffs.push(CrateDiff::AddOwners {
191181
krate: krate.to_string(),
192-
owners: owners_to_add,
182+
owners: teams_to_add,
193183
});
194184
}
195185

0 commit comments

Comments
 (0)