Block ingest for retired WDMI slugs, purge project data via migration, remove WDMI runbooks, and add offboard-project helper for future retirements. Co-authored-by: Cursor <[email protected]>
124 lines
3.5 KiB
TypeScript
124 lines
3.5 KiB
TypeScript
import type { IncidentDetail, IncidentSummary } from "./types";
|
|
|
|
/** Deterministic demo payloads for local UI review only (BIT-179 replaces with API). */
|
|
const _demoSummaries: IncidentSummary[] = [
|
|
{
|
|
id: "demo-1",
|
|
projectSlug: "crm",
|
|
fingerprint: "fp_checkout_timeout",
|
|
title: "Checkout API timeout after 30s",
|
|
severity: "high",
|
|
currentState: "open",
|
|
firstSeenAt: "2026-03-20T10:00:00.000Z",
|
|
lastSeenAt: "2026-03-22T03:12:44.000Z",
|
|
occurrencesCount: 142,
|
|
},
|
|
{
|
|
id: "demo-2",
|
|
projectSlug: "ott",
|
|
fingerprint: "fp_null_sku",
|
|
title: "TypeError: Cannot read properties of undefined (reading 'sku')",
|
|
severity: "medium",
|
|
currentState: "investigating",
|
|
firstSeenAt: "2026-03-18T14:22:00.000Z",
|
|
lastSeenAt: "2026-03-21T18:01:02.000Z",
|
|
occurrencesCount: 38,
|
|
},
|
|
{
|
|
id: "demo-3",
|
|
projectSlug: "crm",
|
|
fingerprint: "fp_rate_limit",
|
|
title: "429 Too Many Requests on /api/v1/prices",
|
|
severity: "low",
|
|
currentState: "resolved",
|
|
firstSeenAt: "2026-03-10T08:00:00.000Z",
|
|
lastSeenAt: "2026-03-15T22:00:00.000Z",
|
|
occurrencesCount: 901,
|
|
},
|
|
{
|
|
id: "demo-4",
|
|
projectSlug: "legacy-ott",
|
|
fingerprint: "fp_deprecated_endpoint",
|
|
title: "Deprecated endpoint still called: /legacy/ping",
|
|
severity: "info",
|
|
currentState: "ignored",
|
|
firstSeenAt: "2026-01-05T12:00:00.000Z",
|
|
lastSeenAt: "2026-02-01T09:30:00.000Z",
|
|
occurrencesCount: 12,
|
|
},
|
|
];
|
|
|
|
const _stackSample = `TypeError: Cannot read properties of undefined (reading 'sku')
|
|
at mapLineItem (webpack-internal:///(api)/./src/cart.ts:42:17)
|
|
at Array.map (<anonymous>)
|
|
at POST (webpack-internal:///(api)/./src/routes/checkout.ts:118:22)`;
|
|
|
|
const _details: Record<string, IncidentDetail> = {
|
|
"demo-1": {
|
|
..._demoSummaries[0],
|
|
metadataJson: { route: "/checkout", release: "store-1.4.2" },
|
|
ingestKeyLabel: "production-web",
|
|
occurrences: [
|
|
{
|
|
id: "occ-1a",
|
|
occurredAt: "2026-03-22T03:12:44.000Z",
|
|
levelRaw: "error",
|
|
severity: "high",
|
|
message: "Upstream payment service did not respond within 30000ms",
|
|
stacktrace: null,
|
|
contextJson: { requestId: "req_9f2a", userAgent: "Mozilla/5.0 …" },
|
|
},
|
|
],
|
|
},
|
|
"demo-2": {
|
|
..._demoSummaries[1],
|
|
metadataJson: { module: "Ecommerce.Cart" },
|
|
ingestKeyLabel: "crm-php",
|
|
occurrences: [
|
|
{
|
|
id: "occ-2a",
|
|
occurredAt: "2026-03-21T18:01:02.000Z",
|
|
levelRaw: "error",
|
|
severity: "medium",
|
|
message: "TypeError: Cannot read properties of undefined (reading 'sku')",
|
|
stacktrace: _stackSample,
|
|
contextJson: { userId: 10294, cartId: "cart_88aa" },
|
|
},
|
|
],
|
|
},
|
|
"demo-3": {
|
|
..._demoSummaries[2],
|
|
metadataJson: { limit: 120, window: "1m" },
|
|
ingestKeyLabel: "store-bff",
|
|
occurrences: [
|
|
{
|
|
id: "occ-3a",
|
|
occurredAt: "2026-03-15T22:00:00.000Z",
|
|
levelRaw: "warn",
|
|
severity: "low",
|
|
message: "429 Too Many Requests",
|
|
stacktrace: null,
|
|
contextJson: { clientIp: "203.0.113.10" },
|
|
},
|
|
],
|
|
},
|
|
"demo-4": {
|
|
..._demoSummaries[3],
|
|
metadataJson: { owner: "platform" },
|
|
ingestKeyLabel: "ott-lb",
|
|
occurrences: [],
|
|
},
|
|
};
|
|
|
|
export function getDemoIncidentSummaries(): IncidentSummary[] {
|
|
return [..._demoSummaries];
|
|
}
|
|
|
|
export function getDemoIncidentDetail(id: string): IncidentDetail | null {
|
|
const _row = _details[id];
|
|
if (!_row) {
|
|
return null;
|
|
}
|
|
return { ..._row, occurrences: [..._row.occurrences] };
|
|
}
|