This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / web / src / lib / components / repo / pipelines / mock.ts
2.7 kB 88 lines
1// fake data for the pipelines tab until it is wired to bobbin 2 3import type { PipelineSummary } from "$lib/components/repo/types"; 4 5const minutes = (n: number) => n * 60_000; 6 7// fixed base so the times do not depend on when this runs 8const base = Date.parse("2026-08-04T09:00:00Z"); 9const ago = (mins: number) => new Date(base - minutes(mins)).toISOString(); 10 11export const pipelines: PipelineSummary[] = [ 12 // a run still in flight 13 { 14 id: "01K1XJ4WPQ0000000000000001", 15 sha: "9f2c1ab4d8e7350f6b1c2d9e4a5b6c7d8e9f0a1b", 16 createdAt: ago(3), 17 trigger: { kind: "push", targetRef: "master" }, 18 workflows: [ 19 { name: "build", status: "success", duration: minutes(1) + 12_000 }, 20 { name: "test", status: "running", duration: 0 }, 21 { name: "lint", status: "pending", duration: 0 } 22 ] 23 }, 24 // mixed outcome 25 { 26 id: "01K1XJ4WPQ0000000000000002", 27 sha: "3d7e91c05fa2b8461d0e5c7a9b3f2e1d4c6a8b0f", 28 createdAt: ago(47), 29 trigger: { 30 kind: "pull_request", 31 targetRef: "master", 32 sourceLabel: "oppi.li/core:fix-packfile-timeout", 33 pullPath: "/tangled.org/core/pulls/42" 34 }, 35 workflows: [ 36 { name: "build", status: "success", duration: minutes(2) + 4_000 }, 37 { name: "test", status: "failed", duration: minutes(6) + 31_000, error: "3 tests failed" }, 38 { name: "lint", status: "success", duration: 41_000 } 39 ] 40 }, 41 // all green 42 { 43 id: "01K1XJ4WPQ0000000000000003", 44 sha: "c1b4a7e2f9308d65b2a1c4e7f0d3b6a9c2e5f8b1", 45 createdAt: ago(190), 46 trigger: { kind: "push", targetRef: "master" }, 47 workflows: [ 48 { name: "build", status: "success", duration: minutes(1) + 58_000 }, 49 { name: "test", status: "success", duration: minutes(5) + 12_000 }, 50 { name: "lint", status: "success", duration: 39_000 } 51 ] 52 }, 53 // a spindle that never answered 54 { 55 id: "01K1XJ4WPQ0000000000000004", 56 sha: "7a0f3b8c1d2e4f5a6b7c8d9e0f1a2b3c4d5e6f70", 57 createdAt: ago(320), 58 trigger: { kind: "manual" }, 59 workflows: [] 60 }, 61 // timed out 62 { 63 id: "01K1XJ4WPQ0000000000000005", 64 sha: "e5d4c3b2a1908f7e6d5c4b3a2918f7e6d5c4b3a2", 65 createdAt: ago(1_450), 66 trigger: { 67 kind: "pull_request", 68 targetRef: "release-1.4", 69 sourceLabel: "bump-deps" 70 }, 71 workflows: [ 72 { name: "build", status: "success", duration: minutes(2) + 9_000 }, 73 { name: "e2e", status: "timeout", duration: minutes(30) } 74 ] 75 }, 76 // cancelled mid-run 77 { 78 id: "01K1XJ4WPQ0000000000000006", 79 sha: "b8c7d6e5f4a3b2c1d0e9f8a7b6c5d4e3f2a1b0c9", 80 createdAt: ago(2_880), 81 // the appview strips refs/heads/ and refs/tags/ before it reaches the card 82 trigger: { kind: "push", targetRef: "v1.3.0" }, 83 workflows: [ 84 { name: "build", status: "cancelled", duration: 18_000 }, 85 { name: "release", status: "cancelled", duration: 0 } 86 ] 87 } 88];