Repository navigation
Fix local server - #1511
Fix local server#1511hartikainen wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the local UI server's routing logic to strip query parameters and trailing slashes, properly handles HEAD requests by suppressing response bodies, and adds a mock auth-check endpoint. It also introduces comprehensive unit tests to validate these routing and HTTP method behaviors. The review feedback suggests extracting and cleaning the path at the very beginning of the GET handler to improve robustness and adding a Content-Length header to the health check response.
2d32c1f to
688284e
Compare
Normalize query strings and trailing slashes before matching mock GET routes, and include the health response length for GET and HEAD. Cover slash and query variants without weakening exact auth-route checks. Comment link: #1511 (comment)
93aa984 to
6c66bf0
Compare
| if: steps.scope.outputs.run_ui == 'true' | ||
| shell: bash | ||
| run: npm ci --legacy-peer-deps --prefer-offline --no-audit | ||
| run: npm ci --prefer-offline --no-audit |
There was a problem hiding this comment.
wasn't this part of a parallel PR?
There was a problem hiding this comment.
Ah, you're right. I was supposed to stack these but forgot.
There was a problem hiding this comment.
changes from another PR present
|
These are already included in #1512. Edit: nevermind, not everything is. |
6c66bf0 to
495cee0
Compare
Fixes #1510.
Serve queue quota, jobs, submission queues, and predictability in the local preview. Include borrowed quota, two GPU models, three authors, and 24 jobs so filtering, sorting, and pagination can be exercised.
495cee0 to
ab9d219
Compare
|
@AntonTyb this should be ready for review. |
Summary
This PR fixes local UI authentication and keeps browser page navigation separate from mock API routes. GET and HEAD use the same routing, with response bodies suppressed for HEAD.
Motivation & Context
The UI requests
/api/user, which previously fell through to HTML. The unprefixed/experimentsand/dashboardsmock routes also intercepted browser navigation, and the local server did not serve the authentication-check script requested during UI initialization.Both PRs target
main, so this branch currently includes the dependency changes from #1512 before the local-server changes.Key Changes
/v1, and page URLs continue to use the SPA fallback.Assumptions
None.
Verification & Testing
Related Issues / Bugs
Related to #1510 and #1512.
TAG=agy
CONV=01a192b8-9265-7a22-978a-4de88b3b05e2