Skip to content

fix: resolve WebUI assets on collection deep links - #53939

Open
gaoxizhi wants to merge 1 commit into
milvus-io:masterfrom
gaoxizhi:codex/fix-webui-assets-review
Open

gaoxizhi wants to merge 1 commit into
milvus-io:masterfrom
gaoxizhi:codex/fix-webui-assets-review

Conversation

@gaoxizhi

@gaoxizhi gaoxizhi commented Oct 1, 2026

Copy link
Copy Markdown

Fixes #53670

Problem

Refreshing or directly opening a WebUI collection detail URL resolves relative JavaScript and CSS asset URLs beneath the collection path and returns 404s.

Changes

  • Inject the WebUI mount path and window.basename into the SPA fallback response from the Go HTTP server.
  • Leave the generated WebUI bundle unchanged, so a future bundle refresh does not overwrite the fix.
  • Inject the base element at the start of <head>, preserving the existing stylesheet loading behavior.
  • Add automated coverage for the root page, collection deep links, and reverse-proxy-prefixed mount paths.

Validation

LOCAL_STORAGE_SIZE=1 go test -tags dynamic,test -gcflags='all=-N -l' -count=1 ./internal/http -run 'TestServeWebUIIndexResolvesAssetsFromMountPath|TestRegisterWebUIHandler|TestHandleNotFound' passed.

Inject the WebUI base path into the SPA shell when serving the HTML fallback. Keep the generated bundle and render-blocking stylesheet unchanged, and cover root, deep-link, and proxy-prefixed paths.

Fixes milvus-io#53670

Signed-off-by: gaoxizhi <gx_zone@163.com>
@sre-ci-robot sre-ci-robot added the size/L Denotes a PR that changes 100-499 lines. label Oct 1, 2026
@sre-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign zhuwenxing after the PR has been reviewed.
You can assign the PR to them by writing /assign @zhuwenxing in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mergify mergify Bot added dco-passed DCO check passed. kind/bug Issues or changes related a bug labels Oct 1, 2026
@sre-ci-robot

Copy link
Copy Markdown
Contributor

[ci-v2-notice]
Notice: New ci-v2 system is enabled for this PR.

To rerun ci-v2 checks, comment with:

  • /ci-rerun-code-check // for ci-v2/code-check
  • /ci-rerun-code-check-macos // for Code Checker MacOS (GitHub Actions)
  • /ci-rerun-build // for ci-v2/build
  • /ci-rerun-build-all // for ci-v2/build-all (multi-arch builds)
  • /ci-rerun-buildenv // for ci-v2/build-env (build milvus-env builder images; update .env after the new tag is ready)
  • /ci-rerun-ut-integration // for ci-v2/ut-integration, will rerun ci-v2/build
  • /ci-rerun-ut-go // for ci-v2/ut-go, will rerun ci-v2/build
  • /ci-rerun-ut-cpp // for ci-v2/ut-cpp
  • /ci-rerun-ut // for all ci-v2/ut-integration, ci-v2/ut-go, ci-v2/ut-cpp, will rerun ci-v2/build
  • /ci-rerun-e2e-default // for ci-v2/e2e-default
  • /ci-rerun-e2e-amd // for ci-v2/e2e-amd (e2e pool dispatcher)
  • /ci-rerun-e2e-dist-wp // for ci-v2/e2e-dist-wp (Tencent distributed woodpecker-service boundary)
  • /ci-rerun-build-ut-cov // for ci-v2/build-ut-cov (build + unit tests in one pipeline)
  • /ci-rerun-build-ut-cov-tcus // force TC-US build-ut-cov; respects Portal limit, never falls back to AWS
  • /ci-rerun-gosdk // for ci-v2/go-sdk (Go SDK E2E tests, ARM)
  • /ci-rerun-gosdk-std // for ci-v2/go-sdk-std (Go SDK E2E, standalone)
  • /ci-rerun-gosdk-dist-wp // for ci-v2/go-sdk-dist-wp (Go SDK E2E, distributed + Woodpecker service)

If you have any questions or requests, please contact @zhikunyao.

@sre-ci-robot

Copy link
Copy Markdown
Contributor

✅ CI Loop Results 3f43597

Stage Result Duration Tests
✅ Build SUCCESS 17.4min -
✅ Code-Check SUCCESS 11.3min -
✅ UT-Integration SUCCESS 39.5min -
✅ UT-GO SUCCESS 30.5min -
✅ UT-CPP-Cov SUCCESS 63.7min 9706 total, 9706 passed, 0 failed

Total: 111min | Pipeline | Artifacts

Overall Coverage: 77.0%
Diff Coverage: Go 69.2% (36 hit, 16 miss, 52 measurable lines, 14 unmeasured)
Diff Coverage HTML: view changed lines
Total Patch Coverage: 69.2% (36/52 measurable lines, 14 unmeasured)

@mergify mergify Bot added the ci-passed label Oct 1, 2026
@gaoxizhi

gaoxizhi commented Oct 2, 2026

Copy link
Copy Markdown
Author

Hi @czs007 @yanliang567, could you please review this PR when you have a chance? The Go server now injects the WebUI base path into the SPA fallback, preserving the generated bundle and stylesheet loading behavior. Regression coverage, CI, and DCO checks have passed. Thank you!

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

Labels

ci-passed dco-passed DCO check passed. kind/bug Issues or changes related a bug size/L Denotes a PR that changes 100-499 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: WebUI collection detail pages fail to load assets on refresh or direct navigation

2 participants