Repository navigation
(janitor/dedupe): share provider-review error classification - #7564
Conversation
Consolidate the shared provider-review error vocabulary into @kilocode/app-shared/provider-review: the ProviderReviewErrorKind union, the ProviderReviewError and ProviderApiStatusError base classes, and the isNetworkFailure probe. The GitLab and Bitbucket authorization adapters now extend the shared base classes instead of duplicating them, and the router narrows on a single ProviderReviewError type.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryBehavior-preserving dedup of provider-review error classification into Files Reviewed (6 files)
Review Notes
Reviewed by deepseek-v4.1-flash · Input: 54.8K · Output: 11.7K · Cached: 430.1K Review guidance: REVIEW.md from base branch |
|
Meta Janitor: Safety review passed; requesting approval. |
eshurakov
left a comment
There was a problem hiding this comment.
Code Review Summary
Status: No Issues Found | Recommendation: Merge
Executive Summary
Independently reviewed the full six-file diff at 7504a28 against base 0c14020, including pinned source, read/write and branch-listing callers, package exports, tests, CI logs, and existing discussion. No major behavioral/security regression or lost coverage found.
Provider subclass identities and names, fixed-copy classification, retryability, tRPC mappings, and stale-head ledger outcomes are preserved. Isolated in-memory execution of pinned source passed 1,004 status cases, 1,036 classification cases, and 14 router mapping cases. CI logs confirm all seven affected web suites and the five new shared-error tests passed; typecheck, lint, and builds are green.
Validation limitation: full Jest/Vitest suites were not rerun locally; isolated assertions stubbed external tRPC/logging seams and do not replace integration tests. No workspace files changed. Head SHA rechecked immediately before submission.
Files Reviewed (6 files)
apps/web/src/lib/provider-review/bitbucket-authorization.tsapps/web/src/lib/provider-review/gitlab-authorization.tsapps/web/src/routers/provider-review-router.tspackages/app-shared/src/provider-review/errors.test.tspackages/app-shared/src/provider-review/errors.tspackages/app-shared/src/provider-review/index.ts
Summary
Deduplicates the provider-review error classification that was duplicated verbatim across the GitLab and Bitbucket authorization adapters, and consolidates it into the existing owning package
@kilocode/app-shared/provider-review(described as the "pure vocabulary" for the PR/MR review layer).What changed
packages/app-shared/src/provider-review/errors.tsexporting:ProviderReviewErrorKind— the shared mobile error-state union (not_found | forbidden | stale_head | bad_request | retryable)ProviderReviewError— base classified failure (derivesretryablefromkind === 'retryable')ProviderApiStatusError— base HTTP-status failureisNetworkFailure— the network-failure probegitlab-authorization.tsandbitbucket-authorization.tsnow extend these shared base classes and importisNetworkFailure, removing the duplicated type/class bodies (kept*ReviewErrorKindas aliases and preserved each provider'snameand fixed copy).provider-review-router.tsnarrows on a singleProviderReviewErrorinstead ofGitLabReviewError || BitbucketReviewError.errors.test.tscoveringretryablederivation andisNetworkFailure.Why
The error-kind union is one domain concept (the mobile error-state contract): a new state must be added everywhere at once, and the two copies could drift. This concentrates the vocabulary in the authoritative owner and deletes ~63 lines of duplicated type/class declarations.
Verification
pnpm --filter @kilocode/app-shared typecheck— passedpnpm --filter @kilocode/app-shared exec vitest run src/provider-review/errors.test.ts— 5 passedtsgo --noEmit— passedoxfmt --checkandoxlinton changed files — cleanWeb Jest suites (
gitlab-authorization.test.ts,bitbucket-authorization.test.ts) could not run in this sandbox: their global setup requires PostgreSQL, which is unavailable here.