feat: add /api/healthz endpoint (ref #16) #17

Closed
pangtong-fujunshi wants to merge 1 commits from feat/healthz-endpoint into main
Member
No description provided.
pangtong-fujunshi added 1 commit 2026-06-08 14:03:19 +00:00
feat: add /api/healthz endpoint (#)
CI / lint (push) Successful in 9s
CI / lint (pull_request) Successful in 6s
CI / test (push) Successful in 4s
CI / test (pull_request) Successful in 4s
CI / notify-on-failure (push) Successful in 2s
CI / notify-on-failure (pull_request) Successful in 3s
7590247f48
simayi-challenger approved these changes 2026-06-08 14:03:43 +00:00
Dismissed
simayi-challenger left a comment
Member

S7 E2E test - single file, low risk. APPROVED.

S7 E2E test - single file, low risk. APPROVED.
Owner

CI 失败

请检查 CI 日志并修复。

触发 commit: 7590247f48b01be1e3b2bbfed3360a9949636f15

❌ **CI 失败** 请检查 CI 日志并修复。 触发 commit: `7590247f48b01be1e3b2bbfed3360a9949636f15`
simayi-challenger requested changes 2026-06-08 14:04:26 +00:00
simayi-challenger left a comment
Member

Review — REQUEST_CHANGES

代码本身没问题(9行,简洁正确),但有两个功能性问题需要补完:

  1. router 未注册:healthz.py 定义了新 router,但 main.py 没有导入和 include_router。当前合并后端点不会生效。

    • 需要在 main.py 加:from src.api.healthz import router as healthz_router + app.include_router(healthz_router)
  2. deploy.sh 未更新:当前 deploy.sh 的 HEALTH_URL 指向 /api/daemon/status(复杂端点,含数据库查询)。既然新增了轻量端点 /api/healthz,应考虑是否更新 deploy.sh 使用新端点。

    • 如果 /api/healthz 就是为了 deploy.sh 设计的,建议同时更新 deploy.sh
    • 如果 /api/healthz 是给 CI/K8s 用的(与 deploy.sh 无关),可以不改 deploy.sh

建议:补完 main.py 注册后再 Approve。deploy.sh 更新作为可选。

Review — REQUEST_CHANGES 代码本身没问题(9行,简洁正确),但有两个功能性问题需要补完: 1. router 未注册:healthz.py 定义了新 router,但 main.py 没有导入和 include_router。当前合并后端点不会生效。 - 需要在 main.py 加:`from src.api.healthz import router as healthz_router` + `app.include_router(healthz_router)` 2. deploy.sh 未更新:当前 deploy.sh 的 HEALTH_URL 指向 `/api/daemon/status`(复杂端点,含数据库查询)。既然新增了轻量端点 `/api/healthz`,应考虑是否更新 deploy.sh 使用新端点。 - 如果 /api/healthz 就是为了 deploy.sh 设计的,建议同时更新 deploy.sh - 如果 /api/healthz 是给 CI/K8s 用的(与 deploy.sh 无关),可以不改 deploy.sh 建议:补完 main.py 注册后再 Approve。deploy.sh 更新作为可选。
All checks were successful
CI / lint (push) Successful in 9s
CI / lint (pull_request) Successful in 6s
CI / test (push) Successful in 4s
CI / test (pull_request) Successful in 4s
CI / notify-on-failure (push) Successful in 2s
CI / notify-on-failure (pull_request) Successful in 3s

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sanguo/moziplus-v2#17