refactor(onboard): extract dashboard access helpers#3307
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This reverts commit c79cf0d.
…rd-dashboard-access
…rd-dashboard-access
…rd-dashboard-access
cjagwani
left a comment
There was a problem hiding this comment.
clean 1:1 extraction, behavior parity holds through the wrappers. lgtm once #3306 lands.
couple of nits, none blocking:
getDashboardForwardStartCommandthrows ifopenshellShellCommandisn't passed but the type marks it optional viaParameters<...>. the onboard.ts wrapper always injects it so prod is fine, but the type lies about the runtime contract. either make the field required on the options type or import it directly in the module.- inside
printDashboard(onboard.ts:9710) there's a local var nameddashboardAccessthat shadows the new module import. not a bug today but a footgun. rename the local to something likeaccessEntries. getWslHostAddressnow bails to null ifrunCaptureisn't injected — fine in practice since the wrapper injects it, but worth a jsdoc note so external callers don't get confused.- test gaps: no coverage for the throw path or the
fetchGatewayAuthTokeninjection path. easy to add later.
approving as part of the stack — feel free to address in a follow-up.
…rd-dashboard-access
5f6db8a
into
refactor/onboard-gateway-bootstrap
Summary
Extract dashboard access URL and guidance helpers out of the large onboarding module. This continues the onboarding cleanup stack by isolating dashboard chain resolution, URL/token handling, WSL host detection, and guidance text generation.
Changes
src/lib/onboard/dashboard-access.tsfor dashboard forward target/port resolution, start command generation, authenticated URL construction, display redaction, WSL host lookup, access entries, and guidance lines.src/lib/onboard.tsto delegate dashboard access helpers through wrappers that preserve existing defaults and exports.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com