Skip to content

Simplify owner handlers for username disambiguation - #14569

Merged
Turbo87 merged 7 commits into
rust-lang:mainfrom
Turbo87:owner-endpoints
Sep 2, 2026
Merged

Simplify owner handlers for username disambiguation#14569
Turbo87 merged 7 commits into
rust-lang:mainfrom
Turbo87:owner-endpoints

Conversation

@Turbo87

@Turbo87 Turbo87 commented Sep 2, 2026

Copy link
Copy Markdown
Member

Adding and removing owners follow different workflows, but modify_owners() combines them behind an add flag. Splitting them into their endpoint handlers makes each workflow easier to read and lets us change their username resolution independently for #14213. Small helpers keep permission checks and invitation email rendering out of the main flow.

Crate loading and permission checks also move before the transaction, so GitHub calls during permission checks no longer keep a transaction open. Ownership changes and the check that at least one individual owner remains stay in one transaction. The ten-entry limit now applies only to additions.

Related

The permission check uses the owner list loaded earlier. Another request
can change that list before this request changes any owners, even when
both steps happen inside the transaction. Moving the check does not
introduce that possibility.

All changes to owners and the check that at least one individual owner
remains still happen in one transaction. If any step fails, all changes
are undone.

The permission check can also call GitHub. The transaction now starts
after those calls finish.
Each handler owns its transaction and response. The ten-entry invitation
limit applies only to `add_owners()`.
@Turbo87 Turbo87 added the C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear label Sep 2, 2026
@Turbo87
Turbo87 merged commit c2a8915 into rust-lang:main Sep 2, 2026
12 checks passed
@Turbo87
Turbo87 deleted the owner-endpoints branch September 2, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants