fix: stabilize CLI diagnostic codes - #1109
Conversation
|
Warning Review limit reached
Next review available in: 19 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 Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (31)
📝 WalkthroughWalkthroughCLI 진단 코드를 ChangesCLI 진단 코드 CROCO_* 마이그레이션
추정 코드 리뷰 노력🎯 4 (Complex) | ⏱️ ~60 minutes 관련 PR
🚥 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❌ Some benchmarks failed Gate failures
Updated: 2026-06-30T07:08:33.150Z · Commit: 55275a6 |
5fee764 to
acf4eeb
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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/cli/src/commands/diCheck.ts`:
- Around line 208-217: The manifest parsing in diCheck is still exposing legacy
slash-form identifiers as the primary code; update the code path in diCheck to
normalize known legacy values before returning the diagnostic object. In the
record parsing logic, map any legacy manifest code found via
readOptionalString(record, "code") to the stable CROCO_* equivalent, and keep
the original value only in legacyCode so the returned object always surfaces the
stable code first.
In `@packages/cli/src/commands/jobs.ts`:
- Around line 119-133: `jobsHttpError` is using inconsistent categories between
`JobsHttpProblem` and `JOBS_HTTP_PROBLEM_REGISTRY_ENTRY`. Update
`JobsHttpProblem` and the registry entry so the same
`CLI_DIAGNOSTIC_CODES.jobsHttpError` maps to one stable `ProblemCategory`, or
split the 404 case into a separate diagnostic code and registry entry. Make sure
the symbols `JobsHttpProblem` and `JOBS_HTTP_PROBLEM_REGISTRY_ENTRY` stay
aligned so the problem registry indexes the correct category/status.
In `@packages/cli/src/libs/diagnosticCodes.ts`:
- Around line 53-55: `projectMapFrameworkManifestDiagnostic`와
`projectMapContractGraphDiagnostic`의 `legacyCode`에 와일드카드 문자열을 직접 넣는 방식이 문제입니다.
`withLegacyCode()`가 `extensions.legacyCode`를 그대로 직렬화하므로, `diagnosticCodes`에서
`project-map/...-*` 상수를 유지하지 말고 `withLegacyCode`/관련 helper 기준으로 감싼 원본 코드에서 구체적인
slash-form legacy alias를 생성하도록 분리하세요. `projectMapFrameworkManifestDiagnostic`,
`projectMapContractGraphDiagnostic`, and `withLegacyCode`를 찾아 이 두 케이스가 명시적
legacyCode를 보존하도록 수정하면 됩니다.
In `@scripts/problem-registry.mts`:
- Around line 798-810: 문제는 problem-registry.mts의 경로 필터링에서
normalizedCandidate.startsWith(rootDir + "/")를 사용해 Windows의 경로 구분자와 맞지 않는다는
점입니다. candidates를 검사하는 find 로직에서 resolve된 경로를 rootDir 기준으로 path.relative() 같은
정규화된 상대 경로 비교로 바꾸고, 상대 경로가 루트 밖으로 나가는 경우만 제외하도록 수정하세요. 이 변경은 sourceFilePath 계산과
관련된 candidate 필터링 전체에 적용해 OS 간 동작을 일관되게 유지해야 합니다.
🪄 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
Run ID: 061f9d7a-4567-4164-9ae6-0f7385354f77
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (26)
.changeset/stable-cli-diagnostic-codes.mddocs/problem-code-registry.jsondocs/troubleshooting/diagnostics.mdpackages/cli/package.jsonpackages/cli/src/commands/diCheck.tspackages/cli/src/commands/doctor.tspackages/cli/src/commands/generateUsageDashboard.tspackages/cli/src/commands/jobs.tspackages/cli/src/commands/projectMap.tspackages/cli/src/libs/diagnosticCodes.tspackages/cli/src/libs/ops.tspackages/cli/src/tests/diCheck.spec.tspackages/cli/src/tests/diagnosticCodes.spec.tspackages/cli/src/tests/doctor.spec.tspackages/cli/src/tests/generateUsageDashboard.spec.tspackages/cli/src/tests/jobs.spec.tspackages/cli/src/tests/opsStatus.spec.tspackages/cli/src/tests/projectMap.spec.tspackages/cli/vitest.config.tspackages/diagnostics-core/src/libs/DiagnosticCodes.tspackages/diagnostics-core/src/tests/DiagnosticCodes.spec.tspackages/docs/src/content/docs/en/reference/problem-recovery-cookbook.mdscripts/problem-registry.mtsscripts/strict-contract-typecheck.mtsscripts/tests/problem-registry.spec.tsscripts/tests/strict-contract-typecheck.spec.ts
acf4eeb to
66d0996
Compare
3f006fc to
5ca1480
Compare
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 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/cli/src/commands/diCheck.ts`:
- Around line 212-220: The `diCheck` normalization logic is still letting
unmapped slash-form diagnostics leak into the primary `code` via `stableCode ??
rawCode`, which breaks the stable `CROCO_*` surface; update the
`code`/`legacyCode` mapping in `diCheck.ts` so any `cli/...` or `doctor/...`
value without a known stable mapping becomes
`CLI_DIAGNOSTIC_CODES.diCheckDiagnosticUnknown` in `code`, while preserving the
original string only in `legacyCode` through the existing
`getStableCliDiagnosticCodeForLegacyCode`, `readOptionalString`, and
`CLI_LEGACY_DIAGNOSTIC_CODES` flow.
In `@packages/cli/src/commands/generateUsageDashboard.ts`:
- Around line 298-341: `UsageDashboardProblem.toJSON()` is rebuilding the
payload manually instead of extending the parent `Problem` serialization. Update
`UsageDashboardProblem` to call `super.toJSON()` and only append `legacyCode`,
so `instance`, `extensions`, and the parent’s `title`/`status` mapping remain
intact. Keep the existing `UsageDashboardProblem` and
`usageDashboardProblemMetadata` symbols in place only if still needed, but avoid
duplicating serialization logic in `toJSON()`.
In `@packages/cli/src/commands/projectMap.ts`:
- Around line 647-648: The static legacyCode strings in projectMap are
duplicated against CLI_LEGACY_DIAGNOSTIC_CODES, so update the remaining
diagnostics in projectMap to read from the shared legacy-code table instead of
hardcoding aliases. Reuse the same central lookup pattern already used for
dynamic cases, and apply it consistently across projectMapContractRouteConflict
and the other runtime-*, package-manifest-conflict, and manifest-* entries so
emitter and normalizer stay in sync.
In `@packages/cli/src/tests/diagnosticCodes.spec.ts`:
- Around line 39-53: The regression test in diagnosticCodes.spec.ts is too easy
to bypass because it only matches direct string literals in code assignments,
readonly code, and super calls. Strengthen the check in the existing test by
moving from the current regex scan to an AST-based analysis that traces actual
code values in CLI producers under commands and libs, so indirect patterns like
const/helper-returned slash-form codes are still detected. Use the current test
name and the primarySlashCodePattern/offenders logic as the place to update the
implementation.
In `@packages/diagnostics-core/src/libs/DiagnosticCodes.ts`:
- Around line 384-395: The shared legacy alias cli/jobs-http-error is being
reused by two stable diagnostics, which breaks the reverse lookup behavior in
LEGACY_TO_STABLE_DIAGNOSTIC_CODES. Update the diagnostic definitions around
CROCO_CLI_JOBS_004 and CROCO_CLI_JOBS_005 in DiagnosticCodes so each stable code
has its own unique legacy code, or remove the duplicate alias from one of them
if 404 should remain a separate stable diagnostic. Ensure
getStableCliDiagnosticCodeForLegacyCode can map each legacy code to exactly one
stable code.
In
`@packages/docs/src/content/docs/api/diagnostics-core/src/variables/CROCO_DIAGNOSTIC_CODE_DEFINITIONS.md`:
- Line 8: 생성된 diagnostics API 문서에서 CROCO_CLI_* 항목이 helper 링크 반복으로 축약되어 실제 정의가
보이지 않는 문제를 해결해야 합니다. CROCO_DIAGNOSTIC_CODE_DEFINITIONS를 만드는 문서 생성 로직 또는 원본 소스에서
새 CLI 항목의 title, action, legacyCodes가 이 페이지에 인라인으로 펼쳐지도록 바꾸고,
DiagnosticCodeDefinition 참조만 반복 출력되지 않게 조정하세요.
CROCO_DIAGNOSTIC_CODE_DEFINITIONS와 DiagnosticCodeDefinition 관련 생성 경로를 확인해 CLI
정의가 문서에 실제 객체 형태로 노출되도록 수정하세요.
In `@scripts/problem-registry.mts`:
- Around line 789-826: `resolveImportedSourceFile`에서 동일한 임포트 대상이 여러 번
`readFileSync`와 `ts.createSourceFile`로 반복 파싱되고 있으니, 절대 경로 기준 캐시를 추가해 중복 작업을
막아주세요. `discoverProblemCodeCandidates` 호출 경로에서 재사용되도록
`resolveImportedSourceFile`, `sourceFilePath`, `ts.createSourceFile` 기준으로 메모이즈를
넣고, 이미 파싱된 모듈은 캐시된 `ts.SourceFile`을 반환하도록 수정하세요.
🪄 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
Run ID: e27d5dd7-c8fe-4651-a457-e14af7cfbec0
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (29)
.changeset/stable-cli-diagnostic-codes.mddocs/problem-code-registry.jsondocs/troubleshooting/diagnostics.mdpackages/cli/package.jsonpackages/cli/src/commands/diCheck.tspackages/cli/src/commands/doctor.tspackages/cli/src/commands/generateUsageDashboard.tspackages/cli/src/commands/jobs.tspackages/cli/src/commands/projectMap.tspackages/cli/src/libs/diagnosticCodes.tspackages/cli/src/libs/ops.tspackages/cli/src/tests/diCheck.spec.tspackages/cli/src/tests/diagnosticCodes.spec.tspackages/cli/src/tests/doctor.spec.tspackages/cli/src/tests/generateUsageDashboard.spec.tspackages/cli/src/tests/jobs.spec.tspackages/cli/src/tests/opsStatus.spec.tspackages/cli/src/tests/projectMap.spec.tspackages/cli/vitest.config.tspackages/diagnostics-core/src/libs/DiagnosticCodes.tspackages/diagnostics-core/src/tests/DiagnosticCodes.spec.tspackages/docs/src/content/docs/api/cli/src/type-aliases/DiCheckDiagnostic.mdpackages/docs/src/content/docs/api/cli/src/type-aliases/DoctorDiagnostic.mdpackages/docs/src/content/docs/api/diagnostics-core/src/type-aliases/DiagnosticCodeDefinition.mdpackages/docs/src/content/docs/api/diagnostics-core/src/variables/CROCO_DIAGNOSTIC_CODE_DEFINITIONS.mdpackages/docs/src/content/docs/en/reference/problem-recovery-cookbook.mdscripts/problem-registry.mtsscripts/strict-contract-typecheck.mtsscripts/tests/problem-registry.spec.ts
|
@coderabbitai review |
✅ Action performedReview finished.
|
5ca1480 to
3751b55
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (2)
packages/cli/src/tests/diagnosticCodes.spec.ts (1)
169-171: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win가져온 legacy 코드 상수는 현재 스캐너가 놓칩니다.
resolveStringExpression()은 같은 파일에서 수집한 바인딩만 해석해서super(CLI_LEGACY_DIAGNOSTIC_CODES.jobsHttpError)같은 케이스를undefined로 흘려보냅니다. 그러면 slash-form 1차 코드가 다시 들어와도 Line 46 테스트가 통과할 수 있습니다. 이 PR의 회귀 방지 목적이라면 imported legacy alias도 해석해야 합니다.수정 예시
if (ts.isPropertyAccessExpression(unwrapped)) { - return bindings.propertyAccesses.get(unwrapped.getText()); + const importedLegacyCode = + ts.isIdentifier(unwrapped.expression) && + unwrapped.expression.text === "CLI_LEGACY_DIAGNOSTIC_CODES" + ? CLI_LEGACY_DIAGNOSTIC_CODES[ + unwrapped.name.text as keyof typeof CLI_LEGACY_DIAGNOSTIC_CODES + ] + : undefined; + + return importedLegacyCode ?? bindings.propertyAccesses.get(unwrapped.getText()); }🤖 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/cli/src/tests/diagnosticCodes.spec.ts` around lines 169 - 171, `resolveStringExpression()` is only resolving property accesses from local bindings, so imported legacy diagnostic constants like `super(CLI_LEGACY_DIAGNOSTIC_CODES.jobsHttpError)` are being treated as unresolved. Update the resolver used in `diagnosticCodes.spec.ts` to also follow imported legacy aliases when handling `ts.isPropertyAccessExpression(unwrapped)`, so it can map the imported symbol to the actual string value instead of returning undefined. Keep the existing local binding lookup in `bindings.propertyAccesses.get(...)`, but extend the lookup path to cover imported legacy constants in the same resolution flow.packages/cli/src/commands/diCheck.ts (1)
215-225: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winCLI legacy prefix 판별이 아직 일부 namespace만 다룹니다.
isCliLegacyDiagnosticCode()가cli/와doctor/만 legacy로 취급해서, 이번 마이그레이션 범위에 포함된project-map/...·usage-dashboard/...같은 미등록 slash-form 값은 Line 218에서 그대로code로 다시 노출됩니다. 그러면 stableCROCO_*surface 보장이 깨지므로, 여기 판별을 전체 CLI legacy namespace 기준으로 넓히거나 중앙화된 테이블로 옮겨서 unknown stable code로 정규화해야 합니다.수정 예시
+const CLI_LEGACY_DIAGNOSTIC_PREFIXES = [ + "cli/", + "doctor/", + "project-map/", + "usage-dashboard/", +] as const; + function isCliLegacyDiagnosticCode(code: string): boolean { - return code.startsWith("cli/") || code.startsWith("doctor/"); + return CLI_LEGACY_DIAGNOSTIC_PREFIXES.some((prefix) => code.startsWith(prefix)); }Also applies to: 239-240
🤖 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/cli/src/commands/diCheck.ts` around lines 215 - 225, isCliLegacyDiagnosticCode() only treats a subset of slash-form namespaces as legacy, so unmapped values like project-map/... and usage-dashboard/... can still leak back out as code in diCheck’s normalization path. Update the legacy-diagnostic detection used in diCheck.ts to cover all CLI legacy namespaces (or centralize the namespace list/table) so any non-stable slash-form code is mapped to CLI_DIAGNOSTIC_CODES.diCheckDiagnosticUnknown and only the stable CROCO_* surface is emitted; make sure the legacyCode derivation in the same block follows the same expanded classification.
🤖 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/cli/src/commands/generateUsageDashboard.ts`:
- Line 282: In the generateUsageDashboard template, the generated
UsageDashboardProblems.ts currently mixes value imports and type-only imports in
the same import statement. Update the template in generateUsageDashboard so
ProblemDetails and ProblemOptions are emitted as a separate import type section,
while Problem and ProblemCategory remain in the normal value import; keep the
import block organized to match the TypeScript import-type and grouped import
rules.
---
Duplicate comments:
In `@packages/cli/src/commands/diCheck.ts`:
- Around line 215-225: isCliLegacyDiagnosticCode() only treats a subset of
slash-form namespaces as legacy, so unmapped values like project-map/... and
usage-dashboard/... can still leak back out as code in diCheck’s normalization
path. Update the legacy-diagnostic detection used in diCheck.ts to cover all CLI
legacy namespaces (or centralize the namespace list/table) so any non-stable
slash-form code is mapped to CLI_DIAGNOSTIC_CODES.diCheckDiagnosticUnknown and
only the stable CROCO_* surface is emitted; make sure the legacyCode derivation
in the same block follows the same expanded classification.
In `@packages/cli/src/tests/diagnosticCodes.spec.ts`:
- Around line 169-171: `resolveStringExpression()` is only resolving property
accesses from local bindings, so imported legacy diagnostic constants like
`super(CLI_LEGACY_DIAGNOSTIC_CODES.jobsHttpError)` are being treated as
unresolved. Update the resolver used in `diagnosticCodes.spec.ts` to also follow
imported legacy aliases when handling
`ts.isPropertyAccessExpression(unwrapped)`, so it can map the imported symbol to
the actual string value instead of returning undefined. Keep the existing local
binding lookup in `bindings.propertyAccesses.get(...)`, but extend the lookup
path to cover imported legacy constants in the same resolution flow.
🪄 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
Run ID: 53c7eab6-d22b-4a1a-a5f9-b3de049b4996
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (29)
.changeset/stable-cli-diagnostic-codes.mddocs/problem-code-registry.jsondocs/troubleshooting/diagnostics.mdpackages/cli/package.jsonpackages/cli/src/commands/diCheck.tspackages/cli/src/commands/doctor.tspackages/cli/src/commands/generateUsageDashboard.tspackages/cli/src/commands/jobs.tspackages/cli/src/commands/projectMap.tspackages/cli/src/libs/diagnosticCodes.tspackages/cli/src/libs/ops.tspackages/cli/src/tests/diCheck.spec.tspackages/cli/src/tests/diagnosticCodes.spec.tspackages/cli/src/tests/doctor.spec.tspackages/cli/src/tests/generateUsageDashboard.spec.tspackages/cli/src/tests/jobs.spec.tspackages/cli/src/tests/opsStatus.spec.tspackages/cli/src/tests/projectMap.spec.tspackages/cli/vitest.config.tspackages/diagnostics-core/src/libs/DiagnosticCodes.tspackages/diagnostics-core/src/tests/DiagnosticCodes.spec.tspackages/docs/src/content/docs/api/cli/src/type-aliases/DiCheckDiagnostic.mdpackages/docs/src/content/docs/api/cli/src/type-aliases/DoctorDiagnostic.mdpackages/docs/src/content/docs/api/diagnostics-core/src/type-aliases/DiagnosticCodeDefinition.mdpackages/docs/src/content/docs/api/diagnostics-core/src/variables/CROCO_DIAGNOSTIC_CODE_DEFINITIONS.mdpackages/docs/src/content/docs/en/reference/problem-recovery-cookbook.mdscripts/problem-registry.mtsscripts/strict-contract-typecheck.mtsscripts/tests/problem-registry.spec.ts
d125e0f to
dddd5b2
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
packages/cli/src/tests/diagnosticCodes.spec.ts (1)
54-75: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
CLI_LEGACY_DIAGNOSTIC_CODES를 지역 변수에 담으면 회귀 검사가 비켜갑니다.
collectStringBindings()는 문자열 리터럴/객체 리터럴만 식별자 바인딩으로 저장해서const code = CLI_LEGACY_DIAGNOSTIC_CODES.jobsHttpError; super(code, ...)같은 형태를 해석하지 못합니다. 그래서 Line 46 회귀 테스트는 slash-form 1차 코드를 다시 primary code로 써도 통과할 수 있습니다.🔧 최소 수정 예시
function collectStringBindings(sourceFile: ts.SourceFile): StringBindings { const identifiers = new Map<string, string>(); const propertyAccesses = new Map<string, string>(); const visit = (node: ts.Node): void => { if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) { const initializer = unwrapExpression(node.initializer); - const value = readStringLiteral(initializer); + const value = + readStringLiteral(initializer) ?? + resolveStringExpression(initializer, { identifiers, propertyAccesses }); if (value) { identifiers.set(node.name.text, value); }Also applies to: 161-221
🤖 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/cli/src/tests/diagnosticCodes.spec.ts` around lines 54 - 75, `collectStringBindings()` currently only records direct string/object-literal bindings, so an alias like `const code = CLI_LEGACY_DIAGNOSTIC_CODES.jobsHttpError` can bypass the primary-code scan. Update the binding collection and/or `resolveStringExpression()` path to follow identifier aliases back to the imported legacy diagnostic constant, using `collectStringBindings`, `findFirstSuperArgument`, and `resolveStringExpression` as the main entry points. Also extend the `diagnosticCodes.spec.ts` coverage with a case that stores `CLI_LEGACY_DIAGNOSTIC_CODES.jobsHttpError` in a local variable before passing it to `super(...)`, so the regression is caught.
🤖 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 `@docs/troubleshooting/diagnostics.md`:
- Line 161: legacyCode alias 설명이 너무 뭉뚱그려져 있어 migration lookup에 필요한 개별 slash-form
값을 알 수 없습니다. diagnostics 문서의 legacy alias 안내를 수정해,
project-map/framework-manifest-* 및 project-map/contract-graph-* 같은 와일드카드 대신 실제
개별 alias를 모두 명시하거나, 개별 alias를 보존하지 않는다는 점을 diagnostics의 code/legacyCode 규칙과 함께
분명히 적어주세요.
In `@packages/cli/src/commands/diCheck.ts`:
- Around line 239-247: `isCliLegacyDiagnosticCode()` currently only classifies a
few legacy slash-form prefixes, so `jobs/`, `ops/`, and `di-check/` can still
leak through as stable CLI codes. Update `CLI_LEGACY_DIAGNOSTIC_PREFIXES` in
`diCheck.ts` to include those prefixes so the existing slash-form-to-`CROCO_*`
fallback applies, and add matching regression coverage in `diCheck.spec.ts` for
these codes to ensure they are normalized consistently.
---
Duplicate comments:
In `@packages/cli/src/tests/diagnosticCodes.spec.ts`:
- Around line 54-75: `collectStringBindings()` currently only records direct
string/object-literal bindings, so an alias like `const code =
CLI_LEGACY_DIAGNOSTIC_CODES.jobsHttpError` can bypass the primary-code scan.
Update the binding collection and/or `resolveStringExpression()` path to follow
identifier aliases back to the imported legacy diagnostic constant, using
`collectStringBindings`, `findFirstSuperArgument`, and `resolveStringExpression`
as the main entry points. Also extend the `diagnosticCodes.spec.ts` coverage
with a case that stores `CLI_LEGACY_DIAGNOSTIC_CODES.jobsHttpError` in a local
variable before passing it to `super(...)`, so the regression is caught.
🪄 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
Run ID: eb5af13c-30fe-4418-8b25-649caa061aa2
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (30)
.changeset/stable-cli-diagnostic-codes.mddocs/problem-code-registry.jsondocs/troubleshooting/diagnostics.mdpackages/cli/package.jsonpackages/cli/src/commands/diCheck.tspackages/cli/src/commands/doctor.tspackages/cli/src/commands/generateUsageDashboard.tspackages/cli/src/commands/jobs.tspackages/cli/src/commands/projectMap.tspackages/cli/src/libs/diagnosticCodes.tspackages/cli/src/libs/ops.tspackages/cli/src/tests/diCheck.spec.tspackages/cli/src/tests/diagnosticCodes.spec.tspackages/cli/src/tests/doctor.spec.tspackages/cli/src/tests/generateUsageDashboard.spec.tspackages/cli/src/tests/integration/e2e.spec.tspackages/cli/src/tests/jobs.spec.tspackages/cli/src/tests/opsStatus.spec.tspackages/cli/src/tests/projectMap.spec.tspackages/cli/vitest.config.tspackages/diagnostics-core/src/libs/DiagnosticCodes.tspackages/diagnostics-core/src/tests/DiagnosticCodes.spec.tspackages/docs/src/content/docs/api/cli/src/type-aliases/DiCheckDiagnostic.mdpackages/docs/src/content/docs/api/cli/src/type-aliases/DoctorDiagnostic.mdpackages/docs/src/content/docs/api/diagnostics-core/src/type-aliases/DiagnosticCodeDefinition.mdpackages/docs/src/content/docs/api/diagnostics-core/src/variables/CROCO_DIAGNOSTIC_CODE_DEFINITIONS.mdpackages/docs/src/content/docs/en/reference/problem-recovery-cookbook.mdscripts/problem-registry.mtsscripts/strict-contract-typecheck.mtsscripts/tests/problem-registry.spec.ts
dddd5b2 to
9144e23
Compare
9144e23 to
de74608
Compare
Summary
CROCO_*codes.legacyCodemetadata and documented in the troubleshooting migration table.Validation
CI=true corepack pnpm --filter @croco/cli --filter @croco/diagnostics-core testCI=true corepack pnpm --filter @croco/cli --filter @croco/diagnostics-core typecheckCI=true corepack pnpm exec vitest run scripts/tests/problem-registry.spec.ts scripts/tests/strict-contract-typecheck.spec.ts --config vitest.config.tsCI=true corepack pnpm checkCI=true corepack pnpm --filter @croco/cli... buildFixes #971
Summary by CodeRabbit
CROCO_*코드로 출력되며, 기존 표기들은legacyCode별칭으로 함께 제공됩니다(Doctor/DI Check/Jobs/Ops/Project Map/Usage Dashboard 및 JSON 출력 포함).CROCO_CLI_*코드가 레지스트리에 추가되었습니다.CROCO_*/legacyCode기준으로 갱신되었습니다.