lightning: remove web interface component#67984
lightning: remove web interface component#67984D3Hunter wants to merge 3 commits intopingcap:masterfrom
Conversation
📝 WalkthroughWalkthroughThis PR removes the TiDB Lightning web interface component, which has been unmaintained since v8.4.0. The changes eliminate the entire Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@go.mod`:
- Line 355: The go.mod change promoted gopkg.in/natefinch/lumberjack.v2 from
indirect to direct but there are no new direct imports — it only appears in
goleak.IgnoreTopFunction test strings; verify whether this promotion was
intentional: if unintended, run go mod tidy to revert the dependency back to
indirect (or remove the explicit require entry), and if intentional, add a clear
direct import/use of lumberjack in the appropriate package (or add a comment in
go.mod explaining why it must be a direct dependency) so the change is explicit
and reproducible; reference gopkg.in/natefinch/lumberjack.v2 and occurrences in
goleak.IgnoreTopFunction to locate the relevant traces.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 16f23df3-fe9d-45ad-bf53-0cc828098158
⛔ Files ignored due to path filters (5)
go.sumis excluded by!**/*.sumlightning/web/docs/InfoPage.pngis excluded by!**/*.pnglightning/web/docs/ProgressPage.pngis excluded by!**/*.pnglightning/web/docs/TableProgressPage.pngis excluded by!**/*.pnglightning/web/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (45)
.github/licenserc.ymlDEPS.bzlMakefilebr/.gitignorebuild/nogo_config.jsongo.modlightning/.gitignorelightning/cmd/tidb-lightning/BUILD.bazellightning/cmd/tidb-lightning/main.golightning/pkg/importer/BUILD.bazellightning/pkg/importer/import.golightning/pkg/importer/table_import.golightning/pkg/importer/table_import_test.golightning/pkg/progress/BUILD.bazellightning/pkg/progress/progress.golightning/pkg/server/BUILD.bazellightning/pkg/server/lightning.golightning/pkg/server/lightning_server_serial_test.golightning/pkg/web/res.golightning/pkg/web/res_vfsdata.golightning/tidb-lightning.tomllightning/web/README.mdlightning/web/docs/api.yamllightning/web/package.jsonlightning/web/public/index.htmllightning/web/src/ChunksProgressPanel.tsxlightning/web/src/DottedProgress.tsxlightning/web/src/EnginesProgressPanel.tsxlightning/web/src/ErrorButton.tsxlightning/web/src/InfoButton.tsxlightning/web/src/InfoPage.tsxlightning/web/src/MoveTaskButton.tsxlightning/web/src/PauseButton.tsxlightning/web/src/ProgressPage.tsxlightning/web/src/RefreshButton.tsxlightning/web/src/TableProgressCard.tsxlightning/web/src/TableProgressPage.tsxlightning/web/src/TaskButton.tsxlightning/web/src/TitleBar.tsxlightning/web/src/TitleLink.tsxlightning/web/src/api.tslightning/web/src/index.tsxlightning/web/src/json-bigint.d.tslightning/web/tsconfig.jsonlightning/web/webpack.config.js
💤 Files with no reviewable changes (30)
- br/.gitignore
- lightning/.gitignore
- build/nogo_config.json
- lightning/web/src/PauseButton.tsx
- lightning/web/package.json
- lightning/web/src/EnginesProgressPanel.tsx
- lightning/web/README.md
- lightning/web/src/DottedProgress.tsx
- lightning/web/src/TitleLink.tsx
- .github/licenserc.yml
- lightning/web/src/ChunksProgressPanel.tsx
- lightning/web/webpack.config.js
- lightning/web/src/ErrorButton.tsx
- lightning/web/docs/api.yaml
- lightning/web/src/TaskButton.tsx
- lightning/web/src/TitleBar.tsx
- lightning/web/src/json-bigint.d.ts
- lightning/web/src/RefreshButton.tsx
- lightning/web/src/TableProgressPage.tsx
- lightning/web/src/TableProgressCard.tsx
- lightning/pkg/web/res.go
- lightning/web/src/ProgressPage.tsx
- lightning/web/public/index.html
- lightning/web/src/InfoButton.tsx
- lightning/web/src/MoveTaskButton.tsx
- lightning/web/src/InfoPage.tsx
- lightning/web/tsconfig.json
- lightning/web/src/index.tsx
- lightning/web/src/api.ts
- DEPS.bzl
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #67984 +/- ##
================================================
+ Coverage 77.7953% 79.3797% +1.5843%
================================================
Files 1984 1993 +9
Lines 549728 551332 +1604
================================================
+ Hits 427663 437646 +9983
+ Misses 121145 112242 -8903
- Partials 920 1444 +524
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/retest |
|
@D3Hunter: PRs from untrusted users cannot be marked as trusted with DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/retest |
|
@D3Hunter: PRs from untrusted users cannot be marked as trusted with DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
🔍 Starting code review for this PR... |
ingress-bot
left a comment
There was a problem hiding this comment.
This review was generated by AI and should be verified by a human reviewer.
Manual follow-up is recommended before merge.
Summary
- Total findings: 5
- Inline comments: 5
- Summary-only findings (no inline anchor): 0
Findings (highest risk first)
⚠️ [Major] (2)
- Removed
/and/web/routes now fall through to generic 404 without a pinned compatibility response (lightning/pkg/server/lightning.go:254, lightning/pkg/server/lightning_server_serial_test.go:75) - HTTP control API contract was removed while endpoints remain active (lightning/web/docs/api.yaml:1, lightning/pkg/server/lightning.go:246)
🟡 [Minor] (3)
lightning/pkg/webimport path is removed without a versioned compatibility shim (lightning/pkg/progress/progress.go:15)status-addrcomment still implies task submission withoutserver-modegating (lightning/tidb-lightning.toml:5, lightning/pkg/server/lightning.go:785)- UI removal deleted migration rationale and workaround guidance (lightning/web/README.md:1, lightning/README.md:5)
| @@ -254,17 +252,6 @@ func (l *Lightning) goServe(statusAddr string, realAddrWriter io.Writer) error { | |||
| mux.HandleFunc("/resume", httpHandleWrapper(l.handleResume)) | |||
There was a problem hiding this comment.
⚠️ [Major] Removed / and /web/ routes now fall through to generic 404 without a pinned compatibility response
Impact
Upgrading to this binary changes the previous / to /web/ flow into an unstructured 404 page not found response. Existing operational links and automation that still use these paths now fail with no actionable migration signal.
Scope
lightning/pkg/server/lightning.go:254—(*Lightning).goServelightning/pkg/server/lightning_server_serial_test.go:75—TestRunServer
Evidence
(*Lightning).goServe removes both mux.Handle("/", http.RedirectHandler("/web/", ...)) and the /web/ static file-server block, and no replacement handler is registered for either path. lightning_server_serial_test.go only exercises /tasks APIs, so the changed root/web behavior has no deterministic regression coverage.
Change request
Add explicit compatibility handlers for / and /web/ that return a stable, actionable deprecation response (for example 410 Gone plus migration guidance to supported APIs). Add serial HTTP tests that assert status code and response body for these paths so repeated runs and future refactors preserve the same contract.
| @@ -1,521 +0,0 @@ | |||
| openapi: 3.0.2 | |||
There was a problem hiding this comment.
⚠️ [Major] HTTP control API contract was removed while endpoints remain active
Impact
This change deletes the only in-repo OpenAPI contract for Lightning's HTTP control API while the same endpoints remain reachable on status-addr.
Operators and integrators lose authoritative request/response and error-shape documentation for task queue and runtime control operations.
Scope
lightning/web/docs/api.yaml:1lightning/pkg/server/lightning.go:246—(*Lightning).goServe
Evidence
The diff deletes lightning/web/docs/api.yaml, including documented paths for /tasks, /progress/task, /progress/table, /pause, /resume, and /loglevel. In goServe, the mux still registers these handlers (/tasks*, /progress/*, /pause, /resume, /loglevel) so the interface remains live without a maintained schema.
Change request
Add replacement API contract documentation for the still-supported HTTP endpoints under a maintained docs location. Include parameters, response payload shapes, and non-200 behavior such as 501 when server-mode is disabled.
| // limitations under the License. | ||
|
|
||
| package web | ||
| package progress |
There was a problem hiding this comment.
🟡 [Minor] lightning/pkg/web import path is removed without a versioned compatibility shim
Impact
Downstream code importing github.com/pingcap/tidb/lightning/pkg/web stops compiling immediately after upgrade because the package path is removed. This forces lockstep dependency updates and removes a safe transition window for staged upgrades of consumers embedding Lightning components.
Scope
lightning/pkg/progress/progress.go:15—package progress
Evidence
The diff renames lightning/pkg/web/progress.go to lightning/pkg/progress/progress.go and changes package web to package progress. The remaining lightning/pkg/web files are deleted and no forwarding package is introduced to preserve the previous import path.
Change request
Add a temporary deprecated forwarding package at lightning/pkg/web that re-exports the progress APIs, then remove it in a later release after a documented deprecation window. This preserves upgrade compatibility for external consumers while still moving internal code to lightning/pkg/progress.
| # Listening address for the HTTP server (set to empty string to disable). | ||
| # The server is responsible for the web interface, submitting import tasks, | ||
| # serving Prometheus metrics and exposing debug profiling data. | ||
| # The server is responsible for submitting import tasks, serving Prometheus |
There was a problem hiding this comment.
🟡 [Minor] status-addr comment still implies task submission without server-mode gating
Impact
The updated status-addr comment says the HTTP server is responsible for submitting import tasks, but task submission is rejected when server-mode is disabled.
This wording blurs a key mode gate and can mislead operators configuring status endpoints in one-shot runs.
Scope
lightning/tidb-lightning.toml:5lightning/pkg/server/lightning.go:785—(*Lightning).handlePostTask
Evidence
tidb-lightning.toml describes status-addr as responsible for task submission. In handlePostTask, the if l.taskCfgs == nil path returns http.StatusNotImplemented with "server-mode not enabled", so submission is explicitly mode-gated.
Change request
Adjust the status-addr comment to separate always-available status/metrics/debug endpoints from mode-gated task queue APIs. State explicitly that POST /tasks requires server-mode = true.
| @@ -1,103 +0,0 @@ | |||
| TiDB Lightning Web Interface | |||
There was a problem hiding this comment.
🟡 [Minor] UI removal deleted migration rationale and workaround guidance
Impact
Removing lightning/web/README.md also removes the deprecation/removal timeline and explicit migration guidance that pointed users to CLI and IMPORT INTO alternatives.
Users who depended on the old /web/ behavior lose in-repo context explaining the change and where to move workflows.
Scope
lightning/web/README.md:1lightning/README.md:5
Evidence
The deleted lightning/web/README.md contained a warning with deprecation/removal versions and direct fallback links to tidb-lightning and IMPORT INTO. The surviving lightning/README.md has general product links but no explicit note about web UI removal, expected behavior change, or migration path.
Change request
Carry a short migration note in a maintained location such as lightning/README.md or release-facing docs. Include the removed capability, expected HTTP/UI behavior change, and the recommended replacement workflows.
| google.golang.org/protobuf v1.36.10 | ||
| gopkg.in/inf.v0 v0.9.1 // indirect | ||
| gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect | ||
| gopkg.in/natefinch/lumberjack.v2 v2.2.1 |
There was a problem hiding this comment.
This looks like an unrelated go mod tidy side effect.
There was a problem hiding this comment.
that's what go mod tidy changed
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: OliverS929 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |

What problem does this PR solve?
Issue Number: close #67697
Problem Summary:
The Lightning web interface under
lightning/web/is no longer maintained. The web UI build has been broken since v8.4.0, and the supported Lightning CLI plusIMPORT INTOSQL statement cover the import workflows with better automation support.What changed and how does it work?
This PR removes the obsolete Lightning web interface component and the generated embedded static assets used to serve it.
lightning/web/and generated web resources underlightning/pkg/web./web/static-file handler and the root redirect to/web/from the Lightning HTTP server.lightning/pkg/webtolightning/pkg/progress, then update Lightning server/importer references.github.com/shurcooL/httpgzipdependency.Check List
Tests
make bazel_prepare./tools/check/failpoint-go-test.sh lightning/pkg/server -run 'TestRunServer|TestGetDeleteTask|TestHTTPAPIOutsideServerMode' -count=1./tools/check/failpoint-go-test.sh lightning/pkg/importer -run 'TestTableRestoreSuite/(TestTableRestoreMetrics|TestSaveStatusCheckpoint)' -count=1go test -tags=intest,deadlock ./lightning/pkg/progress ./lightning/cmd/tidb-lightning -run '^$' -count=1make lintSide effects
/web/static route are removed. Users should use the Lightning CLI orIMPORT INTOinstead.Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Summary by CodeRabbit