Skip to content

Fix(clone): allow port in DB_BASE_URL url#35511

Merged
wezell merged 1 commit intomainfrom
issue-35505-clone-script-not-respecting-port
Apr 29, 2026
Merged

Fix(clone): allow port in DB_BASE_URL url#35511
wezell merged 1 commit intomainfrom
issue-35505-clone-script-not-respecting-port

Conversation

@wezell
Copy link
Copy Markdown
Member

@wezell wezell commented Apr 29, 2026

This fixes issue #35505 and properly splits if there is a port specified
in the url

This PR fixes: #35505

This fixes issue #35505 and properly splits if there is a port specified
in the url
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 29, 2026

Claude finished @wezell's task in 59s —— View job


PR Review

  • Read changed file and diff
  • Analyze URL parsing logic for edge cases
  • Post review findings

The core fix is correct — the %%:* / ##*: / equality-check pattern for splitting host[:port] is sound and handles both the no-port and with-port cases properly. The -p "${DB_PORT}" is consistently added to all four psql calls.

Issues worth noting:

  1. DB_BASE_URL is parsed before it's validated.
    Lines 149–157 run unconditionally at script start. The if [ -z $DB_BASE_URL ] guard is at line 172 — well after parsing. If DB_BASE_URL is empty/unset, DB_HOST, DB_PORT, and DB_NAME all end up empty or at defaults, and psql gets called with -d "" (confusing error). Not introduced here, but the new parsing block is a good place to move the guard earlier.

  2. IPv6 hosts will break with the new parsing.
    For jdbc:postgresql://[::1]:5432/dbname, DB_HOSTPORT = [::1]:5432, and ${DB_HOSTPORT%%:*} strips from the first colon, giving DB_HOST="[". The old code (${DB_HOST%%/*}) was IPv6-safe. Probably not a real-world concern in Docker deployments, but worth a note.

  3. DB_NAME can include query parameters (pre-existing).
    jdbc:postgresql://host/dbname?ssl=trueDB_NAME="dbname?ssl=true" → psql fails. Not introduced here.

  4. Unquoted variable in validation (pre-existing).
    Line 172: if [ -z $DB_BASE_URL ] should be if [ -z "$DB_BASE_URL" ].

None of these are blockers for the stated fix. Items 2–4 are pre-existing; item 1 is a mild ordering concern. The fix does what it says.

@wezell wezell added this pull request to the merge queue Apr 29, 2026
Merged via the queue into main with commit 0205800 Apr 29, 2026
50 checks passed
@wezell wezell deleted the issue-35505-clone-script-not-respecting-port branch April 29, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Safe To Rollback Area : Backend PR changes Java/Maven backend code

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

clone script fails if postgres DB_BASE_URL includes a :port

2 participants