Skip to content

controllers/owners: split owner remove query to remove by username and remove by team name - #14596

Open
moskirathe wants to merge 5 commits into
rust-lang:mainfrom
moskirathe:main
Open

controllers/owners: split owner remove query to remove by username and remove by team name#14596
moskirathe wants to merge 5 commits into
rust-lang:mainfrom
moskirathe:main

Conversation

@moskirathe

Copy link
Copy Markdown
Contributor

This PR is a partial extraction from #14213.

It splits the owner_remove query to owner_remove_by_username and owner_remove_by_team_name. This will allow us to change the behaviour of ower_remove_by_username so that we can compare usernames names using the canon_username function (which also normalizes hyphen to underscore), but keep comparing team names using lower - github allows separate team names that only differ by underscore and hyphens to exist.

Tests:
Owner remove is now routed through Login:parse, which rejects malformed logins before any DB lookup happens. Login::parse currently treats any login containing : as a team login and hands it to GitHubTeamLogin::parse, which rejects malformed ones with a bad_request.

Previously remove_owners passed the raw string straight to krate.owner_remove, which did the lookup, matched nothing (stored logins never contain :), and returned OwnerRemoveError::not_found(login).

So the tests, which assert the old fall-through behavior, now get a parse error instead.

@moskirathe moskirathe changed the title controllers/owners: split owner_remove query to owner_remove_by_username and owner_remove_by_team_name controllers/owners: split owner remove query to remove by username and remove by team name Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants