8000 Fix local server by hartikainen · Pull Request #1511 · google/xmc · GitHub
[go: up one dir, main page]

Skip to content

Fix local server - #1511

Open
hartikainen wants to merge 2 commits into
mainfrom
kristian/fix-local-server
Open

hartikainen wants to merge 2 commits into
mainfrom
kristian/fix-local-server

Conversation

@hartikainen
@hartikainen hartikainen commented Oct 31, 2026 •
Copy link
Copy Markdown
Collaborator

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 /experiments and /dashboards mock 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

  • The server matches authentication endpoints exactly after removing query strings and trailing slashes, while preserving the existing auth aliases.
  • Mock resource APIs stay under /v1, and page URLs continue to use the SPA fallback.
  • The server serves the local authentication-check script and returns consistent GET/HEAD headers, including the health response length.
  • Regression tests cover page navigation, route boundaries, slash/query variants, and HEAD responses.

Assumptions

None.

Verification & Testing

  • All 35 local-server tests pass through Bazel.
  • Ruff lint and formatting checks pass.
  • The included dependency changes pass normal installation, the production build, and all 690 Angular unit tests.
  • The full local repository hook remains limited by missing Go lint, license, and Helm tools.

Related Issues / Bugs

Related to #1510 and #1512.

TAG=agy
CONV=01a192b8-9265-7a22-978a-4de88b3b05e2

@github-actions
github-actions Bot requested a review from andrzejfudro October 31, 2026 16:14
@gemini-code-assist gemini-code-assist Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread test/local/ui/server_local.py Resolved
@hartikainen
hartikainen force-pushed the kristian/fix-local-server branch from 2d32c1f to 688284e Compare October 31, 2026 16:46
hartikainen added a commit that referenced this pull request Oct 31, 2026
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)
@hartikainen
hartikainen force-pushed the kristian/fix-local-server branch 2 times, most recently from 93aa984 to 6c66bf0 Compare November 1, 2026 20:17
@AntonTyb
AntonTyb requested review from AntonTyb and removed request for andrzejfudro November 2, 2026 07:05
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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

wasn't this part of a parallel PR?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ah, you're right. I was supposed to stack these but forgot.

@AntonTyb AntonTyb left a comment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

changes from another PR present

@hartikainen
hartikainen commented Nov 2, 2026 •
Copy link
Copy Markdown
Collaborator Author

These are already included in #1512.

Edit: nevermind, not everything is.

@hartikainen hartikainen closed this Nov 2, 2026
@hartikainen hartikainen reopened this Nov 2, 2026
@github-actions
github-actions Bot requested a review from AntonTyb November 2, 2026 22:23
@hartikainen
hartikainen force-pushed the kristian/fix-local-server branch from 6c66bf0 to 495cee0 Compare November 2, 2026 22:24
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.
@hartikainen
hartikainen force-pushed the kristian/fix-local-server branch from 495cee0 to ab9d219 Compare November 2, 2026 22:24
@hartikainen
Copy link
Copy Markdown
Collaborator Author

@AntonTyb this should be ready for review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0