lightning: remove web interface component by D3Hunter · Pull Request #67984 · pingcap/tidb · GitHub
Skip to content

lightning: remove web interface component#67984

Open
D3Hunter wants to merge 3 commits intopingcap:masterfrom
D3Hunter:remove-lightning-web
Open

lightning: remove web interface component#67984
D3Hunter wants to merge 3 commits intopingcap:masterfrom
D3Hunter:remove-lightning-web

Conversation

@D3Hunter
Copy link
Copy Markdown
Contributor

@D3Hunter D3Hunter commented Apr 23, 2026

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 plus IMPORT INTO SQL 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.

  • Remove lightning/web/ and generated web resources under lightning/pkg/web.
  • Stop registering the /web/ static-file handler and the root redirect to /web/ from the Lightning HTTP server.
  • Keep the existing HTTP APIs for task submission, progress JSON, pause/resume, log level, metrics, and pprof.
  • Move the remaining progress JSON state helpers from lightning/pkg/web to lightning/pkg/progress, then update Lightning server/importer references.
  • Remove the web build/generation Makefile targets and the unused github.com/shurcooL/httpgzip dependency.
  • Clean up related Bazel, license, ignore, and lint metadata.

Check List

Tests

  • Unit test
    • 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=1
    • go test -tags=intest,deadlock ./lightning/pkg/progress ./lightning/cmd/tidb-lightning -run '^$' -count=1
    • make lint
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility
    • The deprecated Lightning web UI and /web/ static route are removed. Users should use the Lightning CLI or IMPORT INTO instead.

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

Remove the TiDB Lightning web interface component. Use the TiDB Lightning CLI or IMPORT INTO SQL statement instead.

Summary by CodeRabbit

  • Chores
    • Removed web user interface and associated web server functionality previously served at the status address endpoint
    • Removed web-related dependencies and build infrastructure
    • Simplified progress reporting to internal mechanisms only

@ti-chi-bot ti-chi-bot Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 23, 2026
@tiprow
Copy link
Copy Markdown

tiprow Bot commented Apr 23, 2026

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

📝 Walkthrough

Walkthrough

This PR removes the TiDB Lightning web interface component, which has been unmaintained since v8.4.0. The changes eliminate the entire lightning/web/ directory (frontend code, build config, dependencies), migrate progress reporting from the web package to the progress package throughout the codebase, remove HTTP web server endpoints from the Lightning server, and clean up related build configuration and unused dependencies.

Changes

Cohort / File(s) Summary
Web Interface Removal
lightning/web/*
Deletes entire web UI frontend: React components (ProgressPage, TableProgressPage, InfoPage, TaskButton, TitleBar, etc.), TypeScript types and API client (api.ts), build configuration (webpack.config.js, tsconfig.json, package.json), HTML entry point, and API documentation (api.yaml). Also deletes README and web asset serving file (res.go).
Progress Package Migration
lightning/cmd/tidb-lightning/main.go, lightning/pkg/importer/import.go, lightning/pkg/importer/table_import.go, lightning/pkg/importer/table_import_test.go, lightning/pkg/progress/*, lightning/pkg/server/lightning.go, lightning/pkg/server/lightning_server_serial_test.go
Replaces all progress reporting calls from web package to progress package. Updates package declaration in progress.go from package web to package progress. Removes HTTP web server endpoint handling and static file serving from Lightning server.
Build & Bazel Configuration
lightning/cmd/tidb-lightning/BUILD.bazel, lightning/pkg/importer/BUILD.bazel, lightning/pkg/progress/BUILD.bazel, lightning/pkg/server/BUILD.bazel
Updates Bazel targets to replace //lightning/pkg/web dependency with //lightning/pkg/progress. Removes @com_github_shurcool_httpgzip external dependency. Narrows lightning/pkg/progress library sources to only progress.go, excluding web resource files.
Dependency & Configuration Updates
DEPS.bzl, go.mod, Makefile, .github/licenserc.yml, build/nogo_config.json, br/.gitignore, lightning/.gitignore, lightning/tidb-lightning.toml
Removes github.com/shurcooL/httpgzip from Bazel and Go dependencies. Removes Makefile targets for web build (lightning_web, vfsgendev, build_lightning_for_web) and updates data_parsers dependencies. Removes web asset paths from gitignore and license/linter configuration. Updates configuration documentation to remove web UI reference.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

approved, lgtm

Suggested reviewers

  • lance6716

Poem

🐰 With a hop and a bound, the web is now gone,
Progress hops forth in a package new-born!
The UI retreats to digital history's keep,
While Lightning runs swiftly, no frontend to reap!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'lightning: remove web interface component' clearly and specifically summarizes the main change: removal of the Lightning web interface component.
Description check ✅ Passed The PR description is comprehensive and follows the template structure with issue number, problem summary, detailed change explanation, completed checklists, side effects, documentation notes, and release notes.
Linked Issues check ✅ Passed The PR fully addresses issue #67697 by removing the web interface component, stopping /web/ route registration, preserving HTTP APIs, and moving progress helpers to a new package.
Out of Scope Changes check ✅ Passed All changes are directly related to removing the Lightning web interface and its dependencies as specified in issue #67697; no out-of-scope changes detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5260244 and a1f61ec.

⛔ Files ignored due to path filters (5)
  • go.sum is excluded by !**/*.sum
  • lightning/web/docs/InfoPage.png is excluded by !**/*.png
  • lightning/web/docs/ProgressPage.png is excluded by !**/*.png
  • lightning/web/docs/TableProgressPage.png is excluded by !**/*.png
  • lightning/web/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (45)
  • .github/licenserc.yml
  • DEPS.bzl
  • Makefile
  • br/.gitignore
  • build/nogo_config.json
  • go.mod
  • lightning/.gitignore
  • lightning/cmd/tidb-lightning/BUILD.bazel
  • lightning/cmd/tidb-lightning/main.go
  • lightning/pkg/importer/BUILD.bazel
  • lightning/pkg/importer/import.go
  • lightning/pkg/importer/table_import.go
  • lightning/pkg/importer/table_import_test.go
  • lightning/pkg/progress/BUILD.bazel
  • lightning/pkg/progress/progress.go
  • lightning/pkg/server/BUILD.bazel
  • lightning/pkg/server/lightning.go
  • lightning/pkg/server/lightning_server_serial_test.go
  • lightning/pkg/web/res.go
  • lightning/pkg/web/res_vfsdata.go
  • lightning/tidb-lightning.toml
  • lightning/web/README.md
  • lightning/web/docs/api.yaml
  • lightning/web/package.json
  • lightning/web/public/index.html
  • lightning/web/src/ChunksProgressPanel.tsx
  • lightning/web/src/DottedProgress.tsx
  • lightning/web/src/EnginesProgressPanel.tsx
  • lightning/web/src/ErrorButton.tsx
  • lightning/web/src/InfoButton.tsx
  • lightning/web/src/InfoPage.tsx
  • lightning/web/src/MoveTaskButton.tsx
  • lightning/web/src/PauseButton.tsx
  • lightning/web/src/ProgressPage.tsx
  • lightning/web/src/RefreshButton.tsx
  • lightning/web/src/TableProgressCard.tsx
  • lightning/web/src/TableProgressPage.tsx
  • lightning/web/src/TaskButton.tsx
  • lightning/web/src/TitleBar.tsx
  • lightning/web/src/TitleLink.tsx
  • lightning/web/src/api.ts
  • lightning/web/src/index.tsx
  • lightning/web/src/json-bigint.d.ts
  • lightning/web/tsconfig.json
  • lightning/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

Comment thread go.mod
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

❌ Patch coverage is 71.42857% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.3797%. Comparing base (874ff37) to head (a1f61ec).
⚠️ Report is 16 commits behind head on master.

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     
Flag Coverage Δ
integration 46.8216% <71.4285%> (+7.0244%) ⬆️
unit 76.7369% <50.0000%> (+0.3826%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 60.4888% <ø> (ø)
parser ∅ <ø> (∅)
br 65.9764% <ø> (+2.9460%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@D3Hunter
Copy link
Copy Markdown
Contributor Author

/retest

@tiprow
Copy link
Copy Markdown

tiprow Bot commented Apr 23, 2026

@D3Hunter: PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test.

Details

In response to this:

/retest

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.

@D3Hunter
Copy link
Copy Markdown
Contributor Author

/retest

@tiprow
Copy link
Copy Markdown

tiprow Bot commented Apr 23, 2026

@D3Hunter: PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test.

Details

In response to this:

/retest

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.

@ingress-bot
Copy link
Copy Markdown

🔍 Starting code review for this PR...

Copy link
Copy Markdown

@ingress-bot ingress-bot left a comment

Choose a reason for hiding this comment

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

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)

  1. 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)
  2. HTTP control API contract was removed while endpoints remain active (lightning/web/docs/api.yaml:1, lightning/pkg/server/lightning.go:246)

🟡 [Minor] (3)

  1. lightning/pkg/web import path is removed without a versioned compatibility shim (lightning/pkg/progress/progress.go:15)
  2. status-addr comment still implies task submission without server-mode gating (lightning/tidb-lightning.toml:5, lightning/pkg/server/lightning.go:785)
  3. 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))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ [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).goServe
  • lightning/pkg/server/lightning_server_serial_test.go:75TestRunServer

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ [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:1
  • lightning/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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 [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:15package 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 [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:5
  • lightning/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.

Comment thread lightning/web/README.md
@@ -1,103 +0,0 @@
TiDB Lightning Web Interface
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 [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:1
  • lightning/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.

Comment thread go.mod
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks like an unrelated go mod tidy side effect.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

that's what go mod tidy changed

@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Apr 23, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Apr 23, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: OliverS929
Once this PR has been reviewed and has the lgtm label, please assign bornchanger, cfzjywxk, d3hunter, terry1purcell for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

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

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Apr 23, 2026

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

Labels

needs-1-more-lgtm Indicates a PR needs 1 more LGTM. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Lightning] Remove the web interface component

3 participants