mirror of
https://github.com/codeflash-ai/codeflash-internal.git
synced 2026-05-04 18:25:18 +00:00
## Summary - **Fix CI build failure**: Auth0Client crashes during Next.js prerendering when env vars aren't set. Returns a no-op stub (`getSession → null`) when domain is missing — semantically correct for static generation - **Lazy-load markdown libs (~260kb)**: ReactMarkdown, remarkGfm, and react-syntax-highlighter were eagerly imported in monaco-diff-viewer but only rendered when user expands "Generated Tests". Extracted into a dynamic component - **Parallelize repo detail query**: `getRepositoryById` ran the activity count sequentially after the repo lookup. Since `repoId` is already available, all three queries now run in parallel ## Test plan - [ ] CI `build` check passes (was failing since #2598) - [ ] Trace page still renders generated tests correctly when expanded - [ ] Repository detail page loads correctly with activity status
54 lines
1.7 KiB
TypeScript
54 lines
1.7 KiB
TypeScript
import { Request } from "express"
|
|
|
|
// Permissive Octokit type
|
|
export type AnyOctokit = any
|
|
|
|
// PR response type
|
|
export type PullRequestCreationResponse = any
|
|
|
|
// Subscription info attached by track-usage middleware
|
|
export interface SubscriptionInfo {
|
|
userId: string
|
|
tier: string
|
|
used: number
|
|
limit: number
|
|
}
|
|
|
|
// Extended Request with userId and organizationId
|
|
export interface AuthorizedUserReq extends Request {
|
|
userId?: string
|
|
organizationId?: string | null
|
|
user?: {
|
|
id: string
|
|
email?: string
|
|
}
|
|
subscriptionInfo?: SubscriptionInfo
|
|
}
|
|
|
|
// PR database interface
|
|
export interface PullRequestDB {
|
|
pull_request: {
|
|
dependent_pr_url?: string
|
|
review_suggestion_pr_url?: string
|
|
[key: string]: any
|
|
}
|
|
}
|
|
|
|
// Complete AsyncExpressApp interface
|
|
export interface AsyncExpressApp {
|
|
post: ((path: string, handler: any) => AsyncExpressApp) &
|
|
((path: string, middleware: any, handler: any) => AsyncExpressApp) &
|
|
((path: string, ...handlers: any[]) => AsyncExpressApp)
|
|
|
|
// Async methods
|
|
postAsync: (path: string, handler: (req: any, res: any, next?: any) => Promise<any>) => void
|
|
getAsync: (path: string, handler: (req: any, res: any, next?: any) => Promise<any>) => void
|
|
|
|
// Standard Express methods
|
|
use: (pathOrMiddleware: any, middleware?: any) => AsyncExpressApp
|
|
get: (path: string, handler: (req: any, res: any, next?: any) => any) => AsyncExpressApp
|
|
put: (path: string, handler: (req: any, res: any, next?: any) => any) => AsyncExpressApp
|
|
delete: (path: string, handler: (req: any, res: any, next?: any) => any) => AsyncExpressApp
|
|
patch: (path: string, handler: (req: any, res: any, next?: any) => any) => AsyncExpressApp
|
|
listen: (port: number, callback?: () => void) => any
|
|
}
|