fix(oidc): roll back aborted transaction after pending-publisher conflict#20074
Open
Fyko wants to merge 1 commit into
Open
fix(oidc): roll back aborted transaction after pending-publisher conflict#20074Fyko wants to merge 1 commit into
Fyko wants to merge 1 commit into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Rolls back the aborted transaction in the
except UniqueViolationhandler 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
PendingRollbackErrorand the user got a generic 500/503.Fixes #20006