fix: reject unsafe health and diagnostics timeouts - #1744
Conversation
|
Warning Review limit reached
Next review available in: 59 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (28)
📝 WalkthroughWalkthroughdiagnostics-core와 health-core가 기본 및 provider/indicator별 타임아웃을 검증합니다. 잘못된 값은 안정적인 Changes타임아웃 검증 구현
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant DiagnosticsCollector
participant HealthCheckService
participant Problem
participant setTimeout
Client->>DiagnosticsCollector: 기본 또는 provider timeout 설정
DiagnosticsCollector->>Problem: 잘못된 값이면 InvalidDiagnosticsTimeoutProblem 생성
Client->>HealthCheckService: 기본 또는 indicator timeout 설정
HealthCheckService->>Problem: 잘못된 값이면 InvalidHealthCheckTimeoutProblem 생성
DiagnosticsCollector->>setTimeout: 검증된 timeout 전달
HealthCheckService->>setTimeout: 검증된 timeout 전달
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
⚔️ Resolve merge conflicts 💡
🧪 Generate unit tests (beta)
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. Comment |
📊 Benchmark Results✅ All benchmarks passed
Updated: 2026-08-05T04:12:38.914Z · Commit: 34b3365 |
e55c3be to
30443ec
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.changeset/safe-health-timeouts.md:
- Around line 2-3: Update the changeset entries for `@croco/diagnostics-core` and
`@croco/health-core` from patch to minor, preserving the existing package list and
changeset structure.
In `@packages/health-core/src/libs/HealthCheckService.ts`:
- Around line 18-22: Update the timeout documentation for
HealthCheckServiceOptions in packages/health-core/src/libs/HealthCheckService.ts
lines 18-22 and the corresponding public API documentation in
packages/health-core/src/index.ts line 48 to state that invalid values throw
InvalidHealthCheckTimeoutProblem during service setup or indicator registration.
Ensure the wording matches the behavior of register and registerReadiness.
🪄 Autofix
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: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 2ce16477-14f4-439a-a968-c19bffc01f32
⛔ Files ignored due to path filters (2)
packages/problems-core/src/generated/problem-code-registry.tsis excluded by!**/generated/**pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (28)
.changeset/safe-health-timeouts.mddocs/problem-code-registry.jsonpackages/diagnostics-core/README.mdpackages/diagnostics-core/src/index.tspackages/diagnostics-core/src/libs/DiagnosticsCollector.tspackages/diagnostics-core/src/libs/problems/DiagnosticsProblems.tspackages/diagnostics-core/src/libs/types.tspackages/diagnostics-core/src/tests/DiagnosticsIntegration.spec.tspackages/docs/src/content/docs/api/diagnostics-core/src/classes/InvalidDiagnosticsTimeoutProblem.mdpackages/docs/src/content/docs/api/diagnostics-core/src/type-aliases/DiagnosticsCollectorOptions.mdpackages/docs/src/content/docs/api/diagnostics-core/src/type-aliases/DiagnosticsProviderOptions.mdpackages/docs/src/content/docs/api/diagnostics-core/src/type-aliases/DiagnosticsTimeoutSource.mdpackages/docs/src/content/docs/api/diagnostics-core/src/variables/MAX_DIAGNOSTICS_TIMEOUT_MS.mdpackages/docs/src/content/docs/api/health-core/src/classes/InvalidHealthCheckTimeoutProblem.mdpackages/docs/src/content/docs/api/health-core/src/type-aliases/HealthCheckServiceOptions.mdpackages/docs/src/content/docs/api/health-core/src/type-aliases/HealthCheckTimeoutSource.mdpackages/docs/src/content/docs/api/health-core/src/variables/MAX_HEALTH_CHECK_TIMEOUT_MS.mdpackages/docs/src/content/docs/api/problems-core/src/classes/Problem.mdpackages/docs/src/content/docs/api/problems-core/src/variables/CROCO_PROBLEM_CODE_REGISTRY.mdpackages/docs/src/content/docs/en/reference/problem-recovery-cookbook.mdpackages/health-core/README.mdpackages/health-core/package.jsonpackages/health-core/src/index.tspackages/health-core/src/libs/HealthCheckService.tspackages/health-core/src/libs/problems/HealthProblems.tspackages/health-core/src/tests/HealthCheckService.spec.tspackages/health-core/vitest.config.tspublic-api-surface.snapshot.json
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/health-core/src/index.ts (1)
82-82: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
HealthCheckTimeoutSource를 마지막 type export 블록으로 이동하세요.현재 Line 82의 type export 뒤에 Line 175-182의 type export가 이어집니다.
index.ts의 type export를 파일 마지막에 모아 barrel export 그룹을 일관되게 유지하세요.As per coding guidelines,
index.ts에서는 barrel export를 카테고리별로 그룹화하고 type export를 마지막에 배치해야 합니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/health-core/src/index.ts` at line 82, Move the HealthCheckTimeoutSource type export from its current position near the top of index.ts to the final type-export block around the existing exports near lines 175–182. Preserve the export itself and keep index.ts barrel exports grouped by category with all type exports last.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@packages/health-core/src/index.ts`:
- Line 82: Move the HealthCheckTimeoutSource type export from its current
position near the top of index.ts to the final type-export block around the
existing exports near lines 175–182. Preserve the export itself and keep
index.ts barrel exports grouped by category with all type exports last.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 9edf7566-27ca-4bae-bd00-ed4ef21a5670
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
.changeset/safe-health-timeouts.mdpackages/docs/src/content/docs/api/health-core/src/type-aliases/HealthCheckServiceOptions.mdpackages/health-core/src/index.tspackages/health-core/src/libs/HealthCheckService.tspnpm-workspace.yaml
5f2ec06 to
46b22fc
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
public-api-surface.snapshot.json (1)
29091-29095: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
SagaOutboxStatus를 타입 전용 export로 이동하세요.
./libs/saga/types에서SagaOutboxStatus는export type으로만 선언되어 런타임namedexport가 아닙니다. 스냅샷의exportKind: "named"는 실제 public API 선언과 불일치하므로typeExports에서 관리해 주세요.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@public-api-surface.snapshot.json` around lines 29091 - 29095, SagaOutboxStatus 항목을 런타임 named export 목록에서 제거하고 타입 전용 export를 나타내는 typeExports로 이동하세요. 이름과 source("./libs/saga/types")는 유지해 실제 public API 선언과 일치시키세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/diagnostics-core/src/index.ts`:
- Line 20: Move the DiagnosticsTimeoutSource type export in
packages/diagnostics-core/src/index.ts to the final type-export block, after all
other exports. Apply the same ordering change to HealthCheckTimeoutSource in
packages/health-core/src/index.ts at lines 78-82; both type exports must be last
in their respective barrel entrypoints.
---
Outside diff comments:
In `@public-api-surface.snapshot.json`:
- Around line 29091-29095: SagaOutboxStatus 항목을 런타임 named export 목록에서 제거하고 타입 전용
export를 나타내는 typeExports로 이동하세요. 이름과 source("./libs/saga/types")는 유지해 실제 public
API 선언과 일치시키세요.
🪄 Autofix
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: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: b23f3c79-9579-4cbc-a810-c3fead3295f9
⛔ Files ignored due to path filters (2)
packages/problems-core/src/generated/problem-code-registry.tsis excluded by!**/generated/**pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (28)
.changeset/safe-health-timeouts.mddocs/problem-code-registry.jsonpackages/diagnostics-core/README.mdpackages/diagnostics-core/src/index.tspackages/diagnostics-core/src/libs/DiagnosticsCollector.tspackages/diagnostics-core/src/libs/problems/DiagnosticsProblems.tspackages/diagnostics-core/src/libs/types.tspackages/diagnostics-core/src/tests/DiagnosticsIntegration.spec.tspackages/docs/src/content/docs/api/diagnostics-core/src/classes/InvalidDiagnosticsTimeoutProblem.mdpackages/docs/src/content/docs/api/diagnostics-core/src/type-aliases/DiagnosticsCollectorOptions.mdpackages/docs/src/content/docs/api/diagnostics-core/src/type-aliases/DiagnosticsProviderOptions.mdpackages/docs/src/content/docs/api/diagnostics-core/src/type-aliases/DiagnosticsTimeoutSource.mdpackages/docs/src/content/docs/api/diagnostics-core/src/variables/MAX_DIAGNOSTICS_TIMEOUT_MS.mdpackages/docs/src/content/docs/api/health-core/src/classes/InvalidHealthCheckTimeoutProblem.mdpackages/docs/src/content/docs/api/health-core/src/type-aliases/HealthCheckServiceOptions.mdpackages/docs/src/content/docs/api/health-core/src/type-aliases/HealthCheckTimeoutSource.mdpackages/docs/src/content/docs/api/health-core/src/variables/MAX_HEALTH_CHECK_TIMEOUT_MS.mdpackages/docs/src/content/docs/api/problems-core/src/classes/Problem.mdpackages/docs/src/content/docs/api/problems-core/src/variables/CROCO_PROBLEM_CODE_REGISTRY.mdpackages/docs/src/content/docs/en/reference/problem-recovery-cookbook.mdpackages/health-core/README.mdpackages/health-core/package.jsonpackages/health-core/src/index.tspackages/health-core/src/libs/HealthCheckService.tspackages/health-core/src/libs/problems/HealthProblems.tspackages/health-core/src/tests/HealthCheckService.spec.tspackages/health-core/vitest.config.tspublic-api-surface.snapshot.json
46b22fc to
11dfa90
Compare
|
@coderabbitai resolve |
✅ Action performedComments resolved and changes approved. |
11dfa90 to
ab64aa1
Compare
ab64aa1 to
0475804
Compare
Outcome
Verification
pnpm --filter @croco/health-core test(44 passed)pnpm --filter @croco/diagnostics-core test(34 passed)pnpm check(24 passed, 1 not applicable before commit)pnpm docs:api:checkconfirms the new diagnostics references match generation. Its remaining drift is the same unrelated protocols, testing, and transport drift reproduced on the exact base commit31636bb.Review gates
Fixes #1686
Summary by CodeRabbit
새 기능
문서