Skip to content

Add health dashboard route#20

Closed
shengtenghou4-star wants to merge 1 commit into
ubiquity:mainfrom
shengtenghou4-star:health-dashboard
Closed

Add health dashboard route#20
shengtenghou4-star wants to merge 1 commit into
ubiquity:mainfrom
shengtenghou4-star:health-dashboard

Conversation

@shengtenghou4-star

Copy link
Copy Markdown

Summary

  • add a first-party health.ubq.fi dashboard route to the Worker router
  • probe configured app and plugin hosts against their resolved upstream Deno URLs
  • expose both an HTML dashboard and machine-readable /api/health plus /__health/checks JSON
  • allow deployments to override checked targets and probe timeout with env vars
  • cover the route and JSON API with Bun tests

Validation

  • npm run type-check
  • npx bun test
  • git diff --check

Resolves #3
/claim #3

@ubiquity-os

ubiquity-os Bot commented May 12, 2026

Copy link
Copy Markdown

Warning

@shengtenghou4-star this pull request is linked to an issue that is already assigned to another user. Please link it to an open issue assigned to you or to an unassigned open issue.

@ubiquity-os ubiquity-os Bot closed this May 12, 2026
@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a health-check dashboard feature accessible at health.ubq.fi. The implementation collects uptime status from service and plugin upstreams by probing their HTTP endpoints concurrently, calculates overall health state (ok/degraded), and serves the data as an HTML dashboard or via two JSON endpoints (/api/health and /__health/checks). The worker router is extended to detect dashboard requests and delegate to the health handler, wrapping responses with router revision headers. Test coverage validates both the HTML dashboard response and JSON endpoint behavior.

🚥 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 title accurately captures the primary change: adding a health dashboard route to the Worker router.
Description check ✅ Passed The description clearly relates to the changeset, detailing the health dashboard implementation, environment configuration, endpoints, and test coverage.
Linked Issues check ✅ Passed The PR fulfills issue #3 requirements: provides health.ubq.fi dashboard, surfaces health checks from tests, and implements status reporting via JSON and HTML endpoints.
Out of Scope Changes check ✅ Passed All changes directly support the health dashboard objective—no out-of-scope modifications detected across the three modified files.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9523ceb3-1e92-4d27-8ba2-23cf02c21cc6

📥 Commits

Reviewing files that changed from the base of the PR and between df2137b and 63f58d7.

📒 Files selected for processing (3)
  • src/health-dashboard.ts
  • src/worker.ts
  • tests/worker-routing.test.ts

Comment thread src/health-dashboard.ts
Comment on lines +120 to +121
ok: response.status < 500,
status: response.status,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use a stricter health predicate for upstream responses.

Line 120 marks any <500 as healthy, so 404/401 are reported as healthy. That can hide broken routes in the dashboard.

Suggested fix
-      ok: response.status < 500,
+      ok: response.status >= 200 && response.status < 400,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ok: response.status < 500,
status: response.status,
ok: response.status >= 200 && response.status < 400,
status: response.status,

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.

Health Dashboard

1 participant