Skip to content

fix(oidc): roll back aborted transaction after pending-publisher conflict#20074

Open
Fyko wants to merge 1 commit into
pypi:mainfrom
Fyko:worktree-fix-pending-publisher-txn-rollback
Open

fix(oidc): roll back aborted transaction after pending-publisher conflict#20074
Fyko wants to merge 1 commit into
pypi:mainfrom
Fyko:worktree-fix-pending-publisher-txn-rollback

Conversation

@Fyko
Copy link
Copy Markdown

@Fyko Fyko commented May 14, 2026

What

Rolls back the aborted transaction in the except UniqueViolation handler for pending trusted publishers, in both the account- and org-scoped views.

Why

Registering a second pending publisher that points at the same repo/owner/workflow/environment as an existing one (under a different project name) fails the table's unique constraint on INSERT. #19972 added a handler to surface that conflict but never rolled back the now-aborted transaction, so the next DB access (rendering the user's pending publishers, or the end-of-request commit) blew up with PendingRollbackError and the user got a generic 500/503.

Fixes #20006

…lict

The `except UniqueViolation` handler for pending trusted publishers
never rolled back the aborted transaction, so the next DB access raised
PendingRollbackError and the user got a 500/503 instead of the intended
error message. Roll back inside the handler, in both the account- and
organization-scoped views.

Fixes pypi#20006
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

500 error when adding second Pending Trusted Publisher to a single account

1 participant