Skip to content

feat: add a Download Analytics status page to the admin dashboard - #2337

Merged
netomi merged 2 commits into
mainfrom
feat/analytics-status-page
Oct 15, 2026
Merged

netomi merged 2 commits into
mainfrom
feat/analytics-status-page

Conversation

@netomi

@netomi netomi commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Stacked on #2336, which adds the availability check this page reports on; the base of this PR is that branch, so the diff shows only the page. Once #2336 merges, this PR should be retargeted to main.

An outage of the analytics database is deliberately invisible to registry users: the registry keeps serving. That also makes it easy to miss for an operator, who only sees it in the logs and in the openvsx_analytics_pending_files gauge. This adds a read-only page under Maintenance that shows it.

Server

  • AnalyticsAvailability.status() returns the current verdict, since when it holds, and the time and error of the last probe. The error is the root cause of the last failed probe, capped at 300 characters, and is absent once a probe succeeded.
  • GET /admin/analytics/status returns enabled, available, since, lastProbe, lastError, pendingFiles and failedFiles. It requires view_reports, the permission of the existing Analytics > Statistics page. It stays mapped when analytics is disabled and reports enabled: false, so the page can say it is off.

Web UI

A "Download Analytics" page in the Maintenance group: an Available or Unavailable chip, the since and last-checked times, the last error, and the pending and failed file counts. It shows a warning when the database is unreachable and an info note when analytics is off. It refreshes itself every 15 seconds and has a Refresh button.

The change is in two commits, server first, then the web UI.

Test plan

  • AnalyticsStatusAPITest (available, unreachable with its reason, disabled, forbidden) and two new AnalyticsAvailabilityTest cases pass; spotlessCheck passes
  • Web UI: 5 new tests for the page; yarn lint, yarn tsc and the full yarn test pass (527 tests)
  • Not checked: the page was not opened in a browser, so the layout is untested, and the endpoint was not exercised end to end with real authentication (it sits under /admin/**)

🤖 Generated with Claude Code

@netomi
netomi added this pull request to stack #2338 October 15, 2026 08:04
@cstamas
cstamas requested a balanced review from Copilot October 15, 2026 08:26

Copilot AI left a comment

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.

🟢 Approval recommended

Static review supports approval, with only a non-blocking suggestion to cover automatic polling in tests.

1 open finding
What changed in this PR

Adds an operator-facing Download Analytics page using the availability tracking introduced in #2336.

Changes:

  • Exposes a permission-protected status endpoint with probe details and ingestion counts.
  • Adds a dashboard page with automatic and manual refresh.
  • Adds server and UI tests and changelog entries.
File Description
webui/​test/​unit/​pages/​admin-dashboard/​analytics-status.spec.tsx Tests status displays and manual refresh.
webui/​src/​pages/​admin-dashboard/​analytics-status/​use-analytics-status.ts Fetches status with 15-second polling.
webui/​src/​pages/​admin-dashboard/​analytics-status/​analytics-status.tsx Displays availability and ingestion counts.
webui/​src/​pages/​admin-dashboard/​admin-dashboard.tsx Adds permission-guarded navigation and page.
webui/​src/​pages/​admin-dashboard/​admin-dashboard-routes.ts Defines the page route.
webui/​src/​extension-registry-types.ts Defines the status response type.
webui/​src/​extension-registry-service.ts Adds the status API client.
webui/​CHANGELOG.md Documents the dashboard page.
server/​src/​test/​java/​org/​eclipse/​openvsx/​analytics/​AnalyticsStatusAPITest.java Tests endpoint responses and permission checks.
server/​src/​test/​java/​org/​eclipse/​openvsx/​analytics/​AnalyticsAvailabilityTest.java Tests probe metadata and state timestamps.
server/​src/​main/​java/​org/​eclipse/​openvsx/​json/​AnalyticsStatusJson.java Defines the status response payload.
server/​src/​main/​java/​org/​eclipse/​openvsx/​analytics/​AnalyticsStatusAPI.java Exposes the protected status endpoint.
server/​src/​main/​java/​org/​eclipse/​openvsx/​analytics/​AnalyticsAvailability.java Tracks timestamps and probe errors.
server/​CHANGELOG.md Documents the status endpoint.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

return useQuery({
queryKey: analyticsStatusQueryKey,
queryFn: ({ signal }) => service.admin.getAnalyticsStatus(controllerFromSignal(signal)),
refetchInterval: REFRESH_INTERVAL_MS
Base automatically changed from fix/analytics-outage-resilience to main October 15, 2026 09:51
netomi and others added 2 commits October 15, 2026 09:53
Keep the time and error of the last probe and since when the current state
has held, and expose them with the counts of log files that wait for
analytics or failed ingestion on GET /admin/analytics/status. The endpoint
needs the view_reports permission and stays mapped when analytics is
disabled, so that it can say so.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Show under Maintenance whether the analytics database is reachable, since
when and why not, and how many log files wait for it. The page refreshes
itself, and says so when analytics is turned off.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@netomi
netomi force-pushed the feat/analytics-status-page branch from 109fc4d to 24fa65a Compare October 15, 2026 09:54
@netomi
netomi merged commit bcfe3ba into main Oct 15, 2026
5 checks passed
@netomi
netomi deleted the feat/analytics-status-page branch October 15, 2026 10:00
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