Skip to content

fix: align HTTP readiness with health-core contract - #754

Merged
kang-heewon merged 1 commit into
trunkfrom
fix/702-health-contract
Jun 14, 2026
Merged

fix: align HTTP readiness with health-core contract#754
kang-heewon merged 1 commit into
trunkfrom
fix/702-health-contract

Conversation

@kang-heewon

Copy link
Copy Markdown
Member

Summary

Fixes #702.

@croco/transports-http readiness now uses the canonical @croco/health-core aggregate contract. /ready and /health/ready return { status: \"up\" | \"down\", results: [...] }, and HTTP 200/503 status codes are derived from that core up/down status.

변경 사항

  • Delegate HealthCheckRegistry.check() directly to HealthCheckService.check(), removing the transport-local ok/error aggregate vocabulary, checks serializer, and timeout error normalization.
  • Keep the HTTP name-based registration adapter while exposing HealthCheckRegistryResult and HealthCheckOptions as public transport symbols backed by health-core types.
  • Align readiness endpoint tests, README operational endpoint docs, generated API docs, and a major changeset with the breaking readiness body-shape change.

Verification

  • pnpm test --filter=@croco/health-core - passed, 21 tests.
  • pnpm test --filter=@croco/transports-http - passed, 111 tests.
  • pnpm typecheck --filter=@croco/transports-http --filter=@croco/health-core - passed.
  • pnpm --filter @croco/docs build - passed.
  • pnpm check - passed.
  • pnpm changeset-required:check - passed.
  • git diff --check origin/trunk...HEAD - passed.
  • pnpm test - passed, 197 tasks.
  • pnpm typecheck - passed, 196 tasks.
  • Pre-push hook test and typecheck passed from cache.

Self-review

  • Correctness: readiness endpoints now return the same aggregate status vocabulary and result array as @croco/health-core; endpoint tests cover healthy, empty, failed, timeout, and duplicate-registration paths.
  • API/release: this intentionally changes the public readiness JSON body from { status: \"ok\" | \"error\", checks: ... } to { status: \"up\" | \"down\", results: [...] }, so the changeset is marked major and the docs call out the new contract.
  • Maintainability: the duplicate transport serializer and timeout normalization path are removed; timeout/check execution remains owned by HealthCheckService.

Risk

Consumers parsing /ready or /health/ready response bodies must migrate to the health-core shape. Liveness endpoints stay on { status: \"ok\" }.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kang-heewon, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 25 minutes and 23 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 75ca8884-f127-4fee-bd21-53a6f53f6f93

📥 Commits

Reviewing files that changed from the base of the PR and between 6c0bfda and bc37e4c.

📒 Files selected for processing (11)
  • .changeset/http-health-core-contract.md
  • packages/docs/src/content/docs/api/transports-http/src/classes/HealthCheckRegistry.md
  • packages/docs/src/content/docs/api/transports-http/src/interfaces/HealthCheckOptions.md
  • packages/docs/src/content/docs/api/transports-http/src/interfaces/HealthCheckRegistryResult.md
  • packages/docs/src/content/docs/api/transports-http/src/interfaces/HealthCheckResult.md
  • packages/docs/src/content/docs/api/transports-http/src/type-aliases/HealthCheckStatus.md
  • packages/transports-http/README.md
  • packages/transports-http/src/index.ts
  • packages/transports-http/src/libs/CrocoApp.ts
  • packages/transports-http/src/libs/HealthCheckRegistry.ts
  • packages/transports-http/src/tests/HealthCheck.spec.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/702-health-contract

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.

@github-actions

Copy link
Copy Markdown

📊 Benchmark Results

❌ Some benchmarks failed

Benchmark p75 Threshold Baseline vs Baseline Status
CrocoApp benchmarks 3.3μs - - - ⚠️
EventBusConfig.start (10 handlers) 1.7μs - 9.0μs -81.5%
EventPublisher.publishNow single event 1.7μs - - - ⚠️
DefaultHandlerResolver.resolve × 10 0.1μs - 0.2μs -65.5%
Container.get singleton (cold) 1.1μs - 0.5μs +114.2%
Container.register × 50 components 12.3μs - 8.0μs +53.6%
Container.validate (50 components) 30.0μs - 25.0μs +19.9%
Container.get singleton (warm) 0.4μs - 0.3μs +32.3%
TelemetryRuntime benchmarks 2.0μs - 2.0μs +0.8%

Updated: 2026-06-14T22:21:19.486Z · Commit: ada72c5

@kang-heewon
kang-heewon merged commit c0c7215 into trunk Jun 14, 2026
7 of 8 checks passed
@kang-heewon
kang-heewon deleted the fix/702-health-contract branch June 14, 2026 22:30
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] health-core와 transports-http의 헬스체크 계약이 서로 다름

1 participant