FIXES #15343 FIXES #15321:- fix(test-utils, link-modules): encode URL credentials and fix schema-qualified RENAME TO#15344
Conversation
…-qualified RENAME TO
- getDatabaseURL now wraps DB_USERNAME and DB_PASSWORD in encodeURIComponent so
passwords containing #, @, :, or / produce a valid URL instead of TypeError: Invalid URL
- MigrationsExecutionPlanner.renameOldTable emits an unqualified identifier after
RENAME TO, fixing PostgreSQL ERROR 42601 caused by a schema-qualified target
- adds unit tests for getDatabaseURL special-character encoding
- adds unit and integration tests for the rename SQL fix
FIXES medusajs#15343,FIXES medusajs#15321
🦋 Changeset detectedLatest commit: 73d7ccd The changes in this PR will be included in the next version bump. This PR includes changesets to release 78 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@Ultron03 is attempting to deploy a commit to the medusajs Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for your contribution, @Ultron03! 🎉 After an initial review, this PR looks good to us. Here's a summary: ✅ PR template is complete Fix 1 — URL credential encoding ( Fix 2 — Schema-qualified A team member will do a final review before this is merged. We appreciate your patience! Triggered by: new PR opened |
|
Thank you for the updated description, @Ultron03! The expanded explanation in the What, Why, How, and Testing sections accurately reflects the implementation. Nothing in the description update changes the earlier assessment — the fixes are correct, the changesets are properly formatted, and the tests cover the key scenarios. This PR retains Triggered by: PR description updated |
|
Thank you for the updated description, @Ultron03! The PR template is now thoroughly completed — the What, Why, How, and Testing sections are clear and detailed. Everything from the previous review still holds: ✅ PR template is complete The two fixes are minimal and correct:
A team member will do a final review before this is merged. We appreciate your patience! Triggered by: PR description updated |
|
Thank you for your contribution, @Ultron03! After reviewing the updated description and the code changes, this PR continues to look good to us. Here's a summary: ✅ PR template is complete Fix 1 — URL credential encoding ( Fix 2 — Schema-qualified A team member will do a final review before this is merged. We appreciate your patience! Triggered by: PR description updated |
|
Thank you for the updated description, @Ultron03! The prior review stands — this PR is well-scoped, correct, and test-covered. Quick re-confirmation after the description update: ✅ PR template is complete Fix 1 — URL credential encoding ( Fix 2 — Schema-qualified Integration test ( A team member will do a final review before this is merged. We appreciate your patience! Triggered by: PR description updated |
FIXES #15343,FIXES #15321
fix(test-utils, link-modules): encode URL credentials and fix schema-qualified RENAME TO
Summary
What — What changes are introduced in this PR?
Two bug fixes across two packages:
Why — Why are these changes relevant or necessary?
Node's WHATWG URL parser treats it as the fragment separator and silently strips everything after it from the authority, making integration tests fail immediately for any developer whose Postgres password contains it.
at or near ".". This caused db:sync-links to crash whenever a tracked link table needed to be renamed.
How — How have these changes been implemented?
object — not a URL — so it continues to use the raw values unchanged.
ALTER TABLE "schema"."old_name" RENAME TO "schema"."new_name";
to:
ALTER TABLE "schema"."old_name" RENAME TO "new_name";
Testing — How have these changes been tested, or how can the reviewer test the feature?
Unit tests added:
without throwing and that decodeURIComponent round-trips back to the original value.
tracking table correctly.
Integration test added:
produces a rename action (not a create) without throwing a PostgreSQL syntax error.
To reproduce the bugs manually before the fix:
Bug 1
DB_USERNAME=postgres DB_PASSWORD='pass#word' yarn test:integration
Bug 2
cd packages/modules/link-modules && yarn test:integration
Checklist
Please ensure the following before requesting a review:
yarn changesetand follow the prompts