fix: migrations: Fix database URL parsing in migrations CLI by URL-encoding credentials #1
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.
fix: migrations: Fix database URL parsing in migrations CLI by URL-encoding credentials
Passwords containing special characters (/, @, :, #, etc.) were breaking
database URL parsing in the migrations CLI, causing connection failures
with errors like "invalid literal for int() with base 10".
Added quote_plus() encoding for username and password when constructing
tenant database URLs, matching the pattern already used in
src/steward/postgres.py and src/dormant/deletion.py.
Note
Low Risk
Small, localized change to connection-string building; primary risk is behavior change for previously-working edge cases, but it should only improve correctness for special characters.
Overview
Fixes tenant DB URL construction in the migrations CLI by introducing
build_tenant_db_url()that URL-encodes usernames/passwords viaquote_plus, preventing failures when credentials contain special characters.All tenant operations (migrate/status/mark/reset, including parallel all-tenant runs) now use this helper instead of manual
postgresql://user:pass@host:port/dbstring interpolation.Written by Cursor Bugbot for commit f426478. This will update automatically on new commits. Configure here.