Repository navigation
fix(dashboard): prefer public endpoint URLs - #7547
diegosouzapw merged 4 commits into
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
465a985 to
46d452a
Compare
|
Thanks for this — verified the fix locally in an isolated worktree: npm run lint clean on the touched files, check:dashboard-typecheck passes with zero new TS debt (the pre-existing CopyHandler errors in EndpointPageClient.tsx match the frozen baseline exactly), and your vitest suite is green (useDisplayBaseUrl.test.tsx and EndpointPageClient.test.tsx fully pass; the one ApiEndpointsTab.test.tsx failure I saw is a pre-existing, unrelated base-red I reproduced on release/v3.8.49 without your changes — and your curl-path assertion fix actually resolves a second pre-existing broken assertion as a side effect, nice catch). The public/local URL separation and the onboarding internal-port fix both look correct and well-scoped. One gap worth closing if you have a moment: onboarding/page.tsx changed production behavior (removing the apiPort-based URL construction) but doesn't get a direct component test — it's covered indirectly through the shared resolveDisplayBaseUrl/isPublicDisplayBaseUrl tests, which is probably enough, but a small render assertion on OnboardingWizard would make the fix self-evidently regression-proof. Not blocking merge from my side. Separately (not this PR's problem, just flagging): the endpoint/tests and shared/hooks/tests vitest files — old and new — aren't actually reached by any CI script today (test:vitest only runs vitest.mcp.config.ts, and test:vitest:ui's path filter restricts it to tests/unit/ui). Worth a follow-up issue on the CI wiring itself. |
Decompose isPrivateIpv4 and isPublicDisplayBaseUrl (both over the ESLint complexity gate of 15) into small named predicates. Behavior is unchanged: - isPrivateIpv4 now checks a PRIVATE_IPV4_RANGES table (RFC1918 + special-use ranges) through isInIpv4Range instead of one long chain of ||/&& comparisons. - isPublicDisplayBaseUrl now delegates to isSupportedProtocol, isLoopbackHostname, isMulticastDnsHostname and isNonPublicIpv6 (itself split into isIpv6LoopbackOrUnspecified / isIpv6UniqueLocal / isIpv6LinkLocal), preserving the isIpv6 gate so hostnames that merely start with "fc"/"fd" (e.g. fdroid.example.com) are not misclassified as IPv6 unique-local addresses. Adds IPv4 range-boundary and IPv6-gate regression tests; all existing assertions are unchanged. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
a7dba3b
into
cheaper-inference:release/v3.8.49
|
Thanks @nguyenha935! Merged into release/v3.8.49 — validated in the combined merge-train. The display-URL predicates were split into named helpers to clear the complexity gate, with boundary tests added. |
* fix(dashboard): prefer public endpoint URLs * docs: add changelog fragment for cheaper-inference#7547 * test(dashboard): cover onboarding public endpoint * refactor(hooks): split display-URL predicates below complexity gate Decompose isPrivateIpv4 and isPublicDisplayBaseUrl (both over the ESLint complexity gate of 15) into small named predicates. Behavior is unchanged: - isPrivateIpv4 now checks a PRIVATE_IPV4_RANGES table (RFC1918 + special-use ranges) through isInIpv4Range instead of one long chain of ||/&& comparisons. - isPublicDisplayBaseUrl now delegates to isSupportedProtocol, isLoopbackHostname, isMulticastDnsHostname and isNonPublicIpv6 (itself split into isIpv6LoopbackOrUnspecified / isIpv6UniqueLocal / isIpv6LinkLocal), preserving the isIpv6 gate so hostnames that merely start with "fc"/"fd" (e.g. fdroid.example.com) are not misclassified as IPv6 unique-local addresses. Adds IPv4 range-boundary and IPv6-gate regression tests; all existing assertions are unchanged. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: nguyenha935 <208228297+nguyenha935@users.noreply.github.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
* fix(dashboard): prefer public endpoint URLs * docs: add changelog fragment for cheaper-inference#7547 * test(dashboard): cover onboarding public endpoint * refactor(hooks): split display-URL predicates below complexity gate Decompose isPrivateIpv4 and isPublicDisplayBaseUrl (both over the ESLint complexity gate of 15) into small named predicates. Behavior is unchanged: - isPrivateIpv4 now checks a PRIVATE_IPV4_RANGES table (RFC1918 + special-use ranges) through isInIpv4Range instead of one long chain of ||/&& comparisons. - isPublicDisplayBaseUrl now delegates to isSupportedProtocol, isLoopbackHostname, isMulticastDnsHostname and isNonPublicIpv6 (itself split into isIpv6LoopbackOrUnspecified / isIpv6UniqueLocal / isIpv6LinkLocal), preserving the isIpv6 gate so hostnames that merely start with "fc"/"fd" (e.g. fdroid.example.com) are not misclassified as IPv6 unique-local addresses. Adds IPv4 range-boundary and IPv6-gate regression tests; all existing assertions are unchanged. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: nguyenha935 <208228297+nguyenha935@users.noreply.github.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Summary
Tests
Notes
This only changes display and copyable configuration URLs. Internal server-to-server resolution and OAuth redirect URI handling remain unchanged.