Auto-fix CI failures for PR #507#512
Closed
github-actions[bot] wants to merge 1 commit intofix/daily-quota-timezone-consistencyfrom
Closed
Auto-fix CI failures for PR #507#512github-actions[bot] wants to merge 1 commit intofix/daily-quota-timezone-consistencyfrom
github-actions[bot] wants to merge 1 commit intofix/daily-quota-timezone-consistencyfrom
Conversation
Fixed: - Updated rpm.limit from 'number' to 'number | null' - Updated dailyCost.limit from 'number' to 'number | null' This fixes TypeScript compilation error where getUserLimitUsage() returns nullable limits but UserQuotaSnapshot expected non-null. TypeScript Error: src/app/[locale]/dashboard/quotas/users/page.tsx:75:3 Type mismatch in quota.rpm.limit and quota.dailyCost.limit Verification: - bun run typecheck: PASS - bun run lint: PASS CI Run: https://github.com/ding113/claude-code-hub/actions/runs/20667182871
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI Auto-Fix
Original PR: #507
Failed CI Run: PR Build Check
Root Cause
The
UserQuotaSnapshotinterface had type definitions that didn't match the actual data returned bygetUserLimitUsage():rpm.limit: numberanddailyCost.limit: numberrpm.limit: number | nullanddailyCost.limit: number | nullThis mismatch occurred because the interface was created before the user-level daily quota feature was fully implemented with timezone support.
Fixes Applied
src/app/[locale]/dashboard/quotas/users/_components/types.tsrpm.limit: numbertorpm.limit: number | nullsrc/app/[locale]/dashboard/quotas/users/_components/types.tsdailyCost.limit: numbertodailyCost.limit: number | nullWhy This Fix is Safe
getUserLimitUsageinsrc/actions/users.ts:1233-1237explicitly returns nullable limitsVerification
✅ TypeScript Check:
bun run typecheckpasses✅ Lint Check:
bun run lintpasses✅ No logic changes: Only type definitions updated
Original Error
Auto-generated by Claude AI - CI Auto-Fixer
Greptile Summary
This PR fixes a TypeScript type error by updating
UserQuotaSnapshotinterface to allow nullable limits (number | null) for bothrpm.limitanddailyCost.limitfields. The change aligns the interface definition with the actual data structure returned bygetUserLimitUsage()insrc/actions/users.ts:1235-1236, which explicitly returns nullable limits to support unlimited quotas (where limit is intentionally null).Key changes:
rpm.limitfromnumbertonumber | nulldailyCost.limitfromnumbertonumber | nullImpact:
The UI components already handle null limits correctly through conditional checks and the
QuotaProgresscomponent's null guard on line 13.Confidence Score: 5/5
getUserLimitUsage()(src/actions/users.ts:1235-1236), and all consuming UI code already handles nullable limits through proper null checks and guard clauses. CI checks pass (typecheck and lint), and the change is scoped to exactly 2 type annotations in a single interface.Important Files Changed
getUserLimitUsage()Sequence Diagram
sequenceDiagram participant Page as UsersQuotaPage participant Action as getUserLimitUsage() participant DB as Database participant UI as UserQuotaListItem Page->>Action: getUserLimitUsage(userId) Action->>DB: Query user quota data DB-->>Action: Return { rpm: {limit: null}, dailyCost: {limit: null} } Action-->>Page: ActionResult with nullable limits Note over Page: Type now correctly accepts<br/>number | null for limits Page->>UI: Pass UserQuotaWithUsage UI->>UI: Display quota with null checks Note over UI: Existing code handles nulls<br/>via conditionals & QuotaProgress