Skip to content

fix(cli): print usable startup URLs for wildcard and IPv6 hosts - #709

Merged
cevheri merged 4 commits into
libredb:mainfrom
mikevillari:fix/launcher-startup-url
Sep 9, 2026
Merged

fix(cli): print usable startup URLs for wildcard and IPv6 hosts#709
cevheri merged 4 commits into
libredb:mainfrom
mikevillari:fix/launcher-startup-url

Conversation

@mikevillari

@mikevillari mikevillari commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Description

The launcher prints unusable startup links for wildcard bind addresses: 0.0.0.0 is shown directly and :: produces http://:::3000. Format the displayed URL with a pure startupUrl helper while preserving the server bind settings and version-parsing log prefix.

Closes #670.

Changes

  • Map wildcard addresses to loopback in the displayed link and bracket other IPv6 addresses.
  • Share the default port constant with the help text.
  • Add 12 pure helper cases covering wildcard, IPv6, ordinary hosts and default ports.

Actual launcher output previously verified with --host 0.0.0.0 and an isolated cached stub payload:

Starting LibreDB Studio 0.15.0 on http://127.0.0.1:3000
BIND=0.0.0.0

Validation

  • Current revision: launcher helper suite 99 passed, 0 failed, 178 assertions. Focused helper coverage remains 100% lines.
  • Removed the three launcher subprocess tests as requested in review: the unit CI job uses an ambient Node 22 below the launcher's Node 24 floor. The pure case table remains; production code is unchanged by this revision.
  • Initial implementation passed the full local suite (14,728 tests), full 100% coverage gate, format/lint/type checks, and repository guards on Node 26.5.0/Bun 1.4.2. Those are prior-revision results; current full CI is running.
  • Previous-head CI passed lint/typecheck/build, browser E2E, PostgreSQL functional smoke and both Node engine smoke jobs. Its unit job failed on the three now-removed subprocess cases.

AI-assisted implementation and validation. The manual launcher fixture used a cached stub server, not a real Next.js server or downloaded release. No dependencies added; server bind settings and the startup version prefix are preserved.

@cevheri cevheri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI is red on the required Unit & Integration Tests job, and the three failures are all in the new launcher startup URL block.

Root cause: those cases spawn bin/studio.js with the runner's ambient node. That job has no actions/setup-node, the ubuntu-24.04 image ships Node 22.23.2, and the launcher correctly refuses anything below its Node 24 floor. So it exits 1 immediately, which is why each case dies in about 40ms, well before any download. Your Node 26 is why the same block is green locally.

Please drop that describe block. #670 asked for a pure case table and your 12 startupUrl cases are exactly that. I checked the consequences: bin/lib/launcher-utils.mjs stays at 100% lines without the subprocess block, and bin/studio.js never enters the lcov because it is spawned rather than imported, so the coverage gate is unaffected. The real --host 0.0.0.0 output you pasted in the PR body already covers the issue's evidence request.

Everything else is right: the helper rules match the spec, DEFAULT_PORT is shared with the help text, the Starting LibreDB Studio <version> prefix is byte-identical, and src/lib/startup-banner.ts is untouched. Fix the tests and this is ready to merge.

The missing setup-node in that job is our gap, not yours. I am tracking it separately.

@cevheri cevheri added the loop:needs-info Maintainer-loop task blocked on human-reviewed clarification label Sep 9, 2026
@mikevillari

Copy link
Copy Markdown
Contributor Author

Addressed in 39c9965: removed the launcher startup URL subprocess block and retained all 12 pure startupUrl cases. The launcher helper suite passes 99 tests / 178 assertions; focused launcher-utils.mjs line coverage remains 100%. Production code is unchanged. Updated the PR description to distinguish the final test scope and current validation from prior results. Full CI is running on the new head; I will check its result.

@mikevillari
mikevillari requested a review from cevheri September 9, 2026 14:23
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mikevillari

Copy link
Copy Markdown
Contributor Author

Final validation for 39c9965: the previously failing Unit & Integration Tests job now passes, including merged core/component coverage and the 100% line-coverage gate. Lint/typecheck/build, browser E2E and subpath E2E, PostgreSQL functional smoke, both Node engine smoke jobs, and channel/security checks also passed. Re-review is requested; no further source changes after this validated head.

@cevheri

cevheri commented Sep 9, 2026

Copy link
Copy Markdown
Member

That is exactly the change I asked for: 39c9965 removes the subprocess block and nothing else, and the PR is now 3 files, +40/-2. All 22 checks are green, including the unit job that was red.

I probed the case table rather than trusting the count. Four mutations of startupUrl, each caught by exactly one case: passing 0.0.0.0 through, dropping the [::] arm, bracketing an already-bracketed address, and port ?? DEFAULT_PORT in place of port ||, which the empty-string port case pins. Focused coverage of bin/lib/launcher-utils.mjs is 100% lines, so the helper is fully exercised by pure cases.

I also appreciated the revised description separating prior-revision results from this head. That distinction is what makes a validation section worth reading.

The three cases you removed were good tests aimed at the wrong runner. The gap is ours: that job never pins Node. Once it does I will bring them back from your commits and credit them there.

Merging shortly. Thanks for the quick turnaround.

@cevheri
cevheri merged commit 3dde4ce into libredb:main Sep 9, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

loop:needs-info Maintainer-loop task blocked on human-reviewed clarification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The npx launcher prints a start URL the browser cannot open when --host is 0.0.0.0 or ::

2 participants