ref: make superuser creation more multi-user friendly#9019
ref: make superuser creation more multi-user friendly#9019jordanrfrazier merged 9 commits intomainfrom
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes update logic for including tool arguments in Changes
Sequence Diagram(s)sequenceDiagram
participant Worker1 as Worker 1
participant Worker2 as Worker 2
participant DB as Database
Worker1->>DB: Attempt to create superuser
DB-->>Worker1: Success (committed)
Worker2->>DB: Attempt to create superuser (concurrent)
DB-->>Worker2: IntegrityError on commit
Worker2->>DB: Rollback transaction
Worker2->>DB: Query for existing user
DB-->>Worker2: User found
Worker2-->>Worker2: Return existing user
Possibly related PRs
Suggested labels
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
| kwargs = {} | ||
| for arg in tool_args: | ||
| value = getattr(self, arg.name, None) | ||
| if value: |
There was a problem hiding this comment.
This also fixes a bunch of python falsy cases
Codecov ReportAttention: Patch coverage is
❌ Your project status has failed because the head coverage (51.79%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #9019 +/- ##
==========================================
+ Coverage 51.76% 51.79% +0.02%
==========================================
Files 632 632
Lines 43294 43297 +3
Branches 125 125
==========================================
+ Hits 22413 22426 +13
+ Misses 20831 20821 -10
Partials 50 50
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
* Fix superuser creationg race condition * remove now unnecessary race condition check * Add tests * [autofix.ci] apply automated fixes * ruff * [autofix.ci] apply automated fixes * clean up tests * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Fix superuser creationg race condition * remove now unnecessary race condition check * Add tests * [autofix.ci] apply automated fixes * ruff * [autofix.ci] apply automated fixes * clean up tests * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Fix superuser creationg race condition * remove now unnecessary race condition check * Add tests * [autofix.ci] apply automated fixes * ruff * [autofix.ci] apply automated fixes * clean up tests * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Refactors the existing super user creation function a bit more protective against race conditions by moving the try catch into the database calls.
Summary by CodeRabbit
Bug Fixes
Tests