fix: reject duplicate diagnostics provider names - #749
Conversation
|
Warning Review limit reached
More reviews will be available in 34 minutes and 27 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 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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
✨ 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❌ Some benchmarks failed
Updated: 2026-06-14T22:12:22.111Z · Commit: b2f2b26 |
Fixes #700.
Summary
@croco/diagnostics-corenow treats diagnostics provider names as unique within aDiagnosticsCollector. Re-registering the same provider instance remains idempotent, while registering a different provider with an existing name throwsDuplicateDiagnosticsProviderProblembefore the original provider can be overwritten.변경 사항
DiagnosticsCollector.registerProvider().DuplicateDiagnosticsProviderProblemusing the existing Croco Problem pattern.@croco/diagnostics-core.Verification
pnpm vitest run src/tests/DiagnosticsIntegration.spec.ts --reporter verbosefirst failed before implementation withexpected function to throw an error, but it did not.pnpm --filter @croco/diagnostics-core test- 1 file, 8 tests passed.pnpm --filter @croco/diagnostics-core typecheck- passed.pnpm --filter @croco/diagnostics-core build- passed.pnpm --filter @croco/diagnostics-core lint- 0 warnings/errors.node scripts/normalize-packages.mjs --check- passed.pnpm check- passed package manifest, docs catalog, circular dependency, oxlint, and oxfmt checks.CI=1 pnpm exec changeset status --since origin/trunk- passed with patch bump for@croco/diagnostics-coreand dependents.git diff --cached --check- passed before commit.oxfmtandoxlintpassed.pnpm test197/197 tasks passed; fullpnpm typecheck196/196 tasks passed.Self-review
@croco/problems-corepackage used by other Croco packages, no secrets or environment assumptions changed, and a patch changeset covers the publishable behavior.DiagnosticsCollector, one focused Problem class, package metadata, focused tests, docs, and release metadata. Independent review found no actionable issues.Risk
Low. Consumers that accidentally registered two different providers with the same name will now fail fast instead of silently using the later provider. That is the intended behavior for #700.