fix: reject invalid numeric reliability configuration - #1450
Conversation
|
Warning Review limit reached
Next review available in: 24 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. 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 (1)
📒 Files selected for processing (31)
📝 WalkthroughWalkthrough재시도 관련 숫자 옵션에 공통 검증을 도입하고, 잘못된 값은 상태 변경·콜백·sleep·Redis I/O 전에 Changes숫자 검증 계약과 오류 모델
실행 경로 검증
검증 테스트
Problem 및 문서 동기화
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant Retryable
participant NumericValidation
participant RetryInfrastructureProblem
participant StateOrIO
Caller->>Retryable: numeric retry configuration
Retryable->>NumericValidation: assertValidRetryNumber(...)
alt invalid configuration
NumericValidation->>RetryInfrastructureProblem: create ValidationError
RetryInfrastructureProblem-->>Caller: HTTP 422 Problem
else valid configuration
Retryable->>StateOrIO: access state, sleep, or Redis
end
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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-07-24T07:12:49.143Z · Commit: 3073e3c |
c5c0671 to
61b4948
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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/retry-core/README.md`:
- Around line 57-61: README의 숫자형 신뢰성 옵션 설명을 수정해 maxDelay, openDuration, circuit
breaker timeout이 최대값 이하의 1 이상 정수임을 명시하세요. 또한 양의 안전 정수 옵션 목록에 successThreshold를
추가하고, 기존의 reserve/delay 및 기타 검증 설명은 유지하세요.
In `@packages/retry-core/src/tests/NumericConfiguration.spec.ts`:
- Around line 215-218: Update the Redis I/O assertions in the affected
NumericConfiguration test to also verify that incr, del, eval, and scan were not
called, alongside the existing get, set, and expire checks. Ensure every Redis
mock method is covered so all Redis access paths are confirmed blocked.
- Around line 1-2: Initialize the DI Container before each test in
NumericConfiguration.spec.ts by adding the project-standard beforeEach reset
pattern alongside the existing Vitest imports and test setup. Ensure every test
starts with a clean container state without changing the test assertions or
configuration behavior.
🪄 Autofix (Beta)
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: c1caa7af-232a-4b45-b7e3-c35f2c6f69d1
⛔ Files ignored due to path filters (1)
packages/problems-core/src/generated/problem-code-registry.tsis excluded by!**/generated/**
📒 Files selected for processing (31)
.changeset/valid-retry-numeric-configuration.mddocs/problem-code-registry.jsonpackages/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/api/retry-core/src/classes/InvalidRetryConfigurationProblem.mdpackages/docs/src/content/docs/api/retry-core/src/interfaces/BackoffOptions.mdpackages/docs/src/content/docs/api/retry-core/src/interfaces/CircuitBreakerConfig.mdpackages/docs/src/content/docs/api/retry-core/src/interfaces/CircuitBreakerOptions.mdpackages/docs/src/content/docs/api/retry-core/src/interfaces/RetryPolicyOptions.mdpackages/docs/src/content/docs/api/retry-core/src/interfaces/RetryTemplateOptions.mdpackages/docs/src/content/docs/api/retry-core/src/interfaces/RetryableOptions.mdpackages/docs/src/content/docs/api/retry-core/src/interfaces/TimeoutGuardOptions.mdpackages/docs/src/content/docs/api/retry-core/src/type-aliases/RedisCircuitBreakerStoreOptions.mdpackages/docs/src/content/docs/api/retry-core/src/type-aliases/RetryNumericConstraint.mdpackages/docs/src/content/docs/en/reference/problem-recovery-cookbook.mdpackages/retry-core/README.mdpackages/retry-core/src/index.tspackages/retry-core/src/libs/BackoffPolicy.tspackages/retry-core/src/libs/CircuitBreaker.tspackages/retry-core/src/libs/LambdaTimeoutGuard.tspackages/retry-core/src/libs/RetryOrchestrator.tspackages/retry-core/src/libs/RetryPolicy.tspackages/retry-core/src/libs/RetryTemplate.tspackages/retry-core/src/libs/Retryable.tspackages/retry-core/src/libs/errors/RetryInfrastructureProblem.tspackages/retry-core/src/libs/errors/index.tspackages/retry-core/src/libs/numericValidation.tspackages/retry-core/src/libs/stores/RedisCircuitBreakerStore.tspackages/retry-core/src/tests/NumericConfiguration.spec.tspublic-api-surface.snapshot.jsontsconfig/contract-strict.baseline.json
💤 Files with no reviewable changes (1)
- tsconfig/contract-strict.baseline.json
c6a3b4e to
e46a2f3
Compare
e46a2f3 to
426509c
Compare
Outcome
Rejects invalid retry, circuit-breaker, Lambda deadline, and Redis TTL numeric configuration before resolver, state, callback, sleep, telemetry, or Redis side effects. Invalid values now produce the public
InvalidRetryConfigurationProblemwith stable, non-sensitive metadata.INVALID_RETRY_CONFIGURATIONis classified as a non-retryable validation failure (HTTP 422), and generated Problem/API contracts plus release changesets are updated.Fixes #1399
Verification
pnpm --filter @croco/retry-core test(266 tests)pnpm --filter @croco/retry-core typecheckpnpm --filter @croco/retry-core lintpnpm --filter @croco/retry-core buildpnpm problem-registry:check(446 codes)pnpm public-api:check(111 packages)pnpm changeset-required:check -- --base origin/trunk --head HEADpnpm testandpnpm typecheckacross the workspaceReview gates
@Retryableordering and API documentation gaps; final re-review approved.Residual risk
The API docs build completed all 112 tasks, but the local drift checker stability guard was repeatedly interrupted by concurrent generated-file formatting in the shared workspace. Generated retry and Problem API artifacts are included for CI verification.
Summary by CodeRabbit
ValidationError로 변경되며, HTTP 422로 반환됩니다.