Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 | 65x 2080x 2665x 65x 65x 65x 65x 65x 65x 65x 65x 65x 65x 1170x 195x 390x 1560x 1560x 1560x 1560x 1560x 1560x 65x 520x 520x 520x 520x 520x 520x 520x 65x 65x 65x 65x | // @ts-nocheck
import type { components } from '@/types/api'
type Run = components['schemas']['Run']
type Project = components['schemas']['Project']
type Pipeline = components['schemas']['Pipeline']
type Repository = components['schemas']['Repository']
type BotAccount = components['schemas']['BotAccount']
type LlmConfig = components['schemas']['LlmConfig']
const now = Date.now()
function hoursAgo(h: number): string {
return new Date(now - h * 3600000 - Math.random() * 60000).toISOString()
}
function daysAgo(d: number): string {
return new Date(now - d * 86400000 - Math.random() * 3600000).toISOString()
}
// Bot Accounts
export const mockBotAccounts: BotAccount[] = [
{
id: 'botacct-1',
name: 'CI Pipeline Bot',
description: 'Bot account for CI/CD pipeline automation',
created_by: 'user-1',
updated_by: 'user-1',
created_at: daysAgo(80),
updated_at: hoursAgo(3),
},
{
id: 'botacct-2',
name: 'Doc Bot',
description: 'Read-only bot for documentation scraping',
created_by: 'user-1',
updated_by: 'user-1',
created_at: daysAgo(50),
updated_at: hoursAgo(6),
},
{
id: 'botacct-3',
name: 'Release Manager',
description: null,
created_by: 'user-1',
updated_by: 'user-1',
created_at: daysAgo(35),
updated_at: hoursAgo(12),
},
{
id: 'botacct-4',
name: 'Unused Bot',
description: 'Pre-provisioned bot account, not yet assigned to any repository',
created_by: 'user-1',
updated_by: 'user-1',
created_at: daysAgo(10),
updated_at: daysAgo(10),
},
]
// Projects
export const mockProjects: Project[] = [
{
id: 'proj-1',
name: 'My Application',
description: 'Main application repository',
config: null,
pipeline_count: 3,
created_by: 'user-1',
updated_by: 'user-1',
created_at: daysAgo(60),
updated_at: hoursAgo(2),
},
{
id: 'proj-2',
name: 'Documentation Site',
description: null,
config: null,
pipeline_count: 1,
created_by: 'user-1',
updated_by: 'user-1',
created_at: daysAgo(45),
updated_at: hoursAgo(5),
},
{
id: 'proj-3',
name: 'API Gateway',
description: null,
config: null,
pipeline_count: 2,
created_by: 'user-1',
updated_by: 'user-1',
created_at: daysAgo(30),
updated_at: hoursAgo(1),
},
]
// Pipelines
export const mockPipelines: Pipeline[] = [
{
id: 'pipeline-proj-1-1',
project_id: 'proj-1',
project_name: 'My Application',
name: 'Doc quality',
code_repo_id: 'repo-1',
manifest_repo_id: 'repo-4',
output_branch: null,
enabled: true,
description: 'Automated documentation quality checks for all projects',
config: {
vikunja: {
lanes: {
start: [1],
open_questions: 10,
blocked: 11,
in_progress: 12,
pr_open: 13,
needs_rework: 14,
done: 15,
pr_rejected: 16,
failed: 17,
},
},
},
skill_repos: [
{ repository_id: 'repo-2', name: 'org/docs', url: 'github.com:org/docs.git' },
{ repository_id: 'repo-3', name: 'org/gateway', url: 'git@github.com:org/gateway.git' },
],
created_by: 'user-1',
updated_by: 'user-1',
created_at: daysAgo(60),
updated_at: hoursAgo(2),
},
{
id: 'pipeline-proj-1-2',
project_id: 'proj-1',
project_name: 'My Application',
name: 'PR Review',
code_repo_id: 'repo-1',
manifest_repo_id: 'repo-4',
output_branch: 'review-output',
enabled: true,
description: 'Automated PR review analysis with code quality checks',
config: null,
skill_repos: [],
created_by: 'user-1',
updated_by: 'user-1',
created_at: daysAgo(55),
updated_at: hoursAgo(6),
},
{
id: 'pipeline-proj-1-3',
project_id: 'proj-1',
project_name: 'My Application',
name: 'Release build',
code_repo_id: 'repo-1',
manifest_repo_id: 'repo-4',
output_branch: 'release-output',
enabled: true,
config: null,
skill_repos: [],
created_by: 'user-1',
updated_by: 'user-1',
created_at: daysAgo(50),
updated_at: hoursAgo(12),
},
{
id: 'pipeline-proj-2-1',
project_id: 'proj-2',
project_name: 'Documentation Site',
name: 'Doc quality',
code_repo_id: 'repo-2',
manifest_repo_id: 'repo-4',
output_branch: null,
enabled: true,
config: null,
skill_repos: [],
created_by: 'user-1',
updated_by: 'user-1',
created_at: daysAgo(45),
updated_at: hoursAgo(5),
},
{
id: 'pipeline-proj-3-1',
project_id: 'proj-3',
project_name: 'API Gateway',
name: 'Release build',
code_repo_id: 'repo-3',
manifest_repo_id: 'repo-4',
output_branch: 'release-output',
enabled: true,
config: null,
skill_repos: [],
created_by: 'user-1',
updated_by: 'user-1',
created_at: daysAgo(30),
updated_at: hoursAgo(1),
},
{
id: 'pipeline-proj-3-2',
project_id: 'proj-3',
project_name: 'API Gateway',
name: 'PR Review',
code_repo_id: 'repo-3',
manifest_repo_id: 'repo-4',
output_branch: 'review-output',
enabled: true,
config: null,
skill_repos: [],
created_by: 'user-1',
updated_by: 'user-1',
created_at: daysAgo(28),
updated_at: hoursAgo(24),
},
]
// Build runs referencing the static projects/pipelines
function buildRuns(): Run[] {
const projectMap: Record<string, string> = { 'proj-1': 'My Application', 'proj-2': 'Documentation Site', 'proj-3': 'API Gateway' }
const phaseOrder = ['pending', 'running', 'succeeded', 'failed'] as const
const sources = ['manual', 'webhook', 'api', 'schedule'] as const
const runs: Run[] = []
let idx = 0
let runNumber = 24300
for (const proj of ['proj-1', 'proj-2', 'proj-3']) {
const projPipelines = mockPipelines.filter((p) => p.project_id === proj)
for (const pipeline of projPipelines) {
for (const phase of phaseOrder) {
idx++
const created = idx <= 4 ? hoursAgo(idx * 2) : daysAgo(Math.floor(idx * 1.5))
const duration = phase === 'succeeded' || phase === 'failed' ? 30000 + Math.random() * 1800000 : 0
const started = phase !== 'pending' ? created : null
const completed = phase === 'succeeded' || phase === 'failed' ? new Date(new Date(created).getTime() + duration).toISOString() : null
runs.push({
run_id: `run-mock-${idx}`,
phase,
run_number: runNumber++,
project_id: proj,
project_name: projectMap[proj],
pipeline_id: pipeline.id,
pipeline_name: pipeline.name,
source_type: sources[idx % 4],
source_metadata: null,
error: phase === 'failed'
? { message: 'Pipeline step failed', code: 'EXECUTION_ERROR', step: 'analyze', details: null }
: null,
output: phase === 'succeeded'
? `Pipeline completed successfully.\n- Step analyze: All quality checks passed\n- Step review: No issues found\n- Duration: ${Math.floor(duration / 1000)}s`
: null,
exit_code: phase === 'failed' ? 1 : 0,
token_input: idx * 5000,
token_output: idx * 2500,
created_at: created,
updated_at: created,
started_at: started,
completed_at: completed,
})
}
}
}
// Add extra recent runs for pagination (proj-1 only)
for (let i = 0; i < 8; i++) {
idx++
const phase = phaseOrder[i % 4]
const created = hoursAgo(i * 0.5)
const duration = phase === 'succeeded' || phase === 'failed' ? 30000 + Math.random() * 1800000 : 0
const started = phase !== 'pending' ? created : null
const completed = phase === 'succeeded' || phase === 'failed' ? new Date(new Date(created).getTime() + duration).toISOString() : null
runs.push({
run_id: `run-mock-${idx}`,
phase,
run_number: runNumber++,
project_id: 'proj-1',
project_name: projectMap['proj-1'],
pipeline_id: 'pipeline-proj-1-1',
pipeline_name: 'Doc quality',
source_type: sources[idx % 4],
source_metadata: null,
error: phase === 'failed'
? { message: 'Pipeline step failed', code: 'EXECUTION_ERROR', step: 'analyze', details: null }
: null,
output: phase === 'succeeded'
? `Pipeline completed successfully.\n- Step analyze: All quality checks passed\n- Step review: No issues found`
: null,
exit_code: phase === 'failed' ? 1 : 0,
token_input: idx * 5000,
token_output: idx * 2500,
created_at: created,
updated_at: created,
started_at: started,
completed_at: completed,
})
}
return runs
}
export const mockRuns: Run[] = buildRuns()
export const mockLlmConfigs: LlmConfig[] = [
{
id: 'llmcfg-1',
name: 'OpenAI GPT-4o',
base_url: 'https://api.openai.com/v1',
model: 'gpt-4o',
default_temperature: 0.7,
created_by: 'user-1',
updated_by: 'user-1',
created_at: daysAgo(60),
updated_at: hoursAgo(4),
},
{
id: 'llmcfg-2',
name: 'Anthropic Claude',
base_url: 'https://api.anthropic.com/v1',
model: 'claude-sonnet-4-20250514',
default_temperature: 0.0,
created_by: 'user-1',
updated_by: 'user-1',
created_at: daysAgo(45),
updated_at: hoursAgo(6),
},
]
export const mockRepositories: Repository[] = [
{
id: 'repo-1',
name: 'org/myapp',
url: 'git@github.com:org/myapp.git',
description: 'Main application repository',
bot_account_id: 'botacct-1',
status: 'connected',
last_checked_at: hoursAgo(0.5),
created_at: daysAgo(90),
updated_at: hoursAgo(0.5),
},
{
id: 'repo-2',
name: 'org/docs',
url: 'github.com:org/docs.git',
description: 'Documentation site source',
bot_account_id: 'botacct-2',
status: 'connected',
last_checked_at: hoursAgo(2),
created_at: daysAgo(60),
updated_at: hoursAgo(2),
},
{
id: 'repo-3',
name: 'org/gateway',
url: 'git@github.com:org/gateway.git',
description: null,
bot_account_id: 'botacct-3',
status: 'disconnected',
last_checked_at: hoursAgo(12),
created_at: daysAgo(45),
updated_at: hoursAgo(12),
},
{
id: 'repo-4',
name: 'org/manifests',
url: 'git@gitea.keskikuja.site:org/manifests.git',
description: 'Pipeline manifest repository',
bot_account_id: 'botacct-1',
status: 'unknown',
last_checked_at: null,
created_at: daysAgo(30),
updated_at: daysAgo(30),
},
]
|