merge(app): land pipeline Graph tab after retained-deadline recovery
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:pipelines_app/features/pipelines/screen.dart';
|
||||
|
||||
import 'pipelines_probe_fixture.dart';
|
||||
|
||||
/// Browser fixture for the pipeline detail's real Graph tab.
|
||||
///
|
||||
/// `style=cupertino` selects the Cupertino host, `dark=1` its dark theme and
|
||||
/// `scale=2` a real 2x text scale. The screen, its list, detail, Graph tab and
|
||||
/// definition pane are the same widgets the app registers; only the replies
|
||||
/// come from the in-memory fixture.
|
||||
void main() {
|
||||
final parameters = Uri.base.queryParameters;
|
||||
runApp(
|
||||
_PipelineGraphTabProbe(
|
||||
cupertino: parameters['style'] == 'cupertino',
|
||||
dark: parameters['dark'] == '1',
|
||||
scale: double.tryParse(parameters['scale'] ?? '') ?? 1,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class _PipelineGraphTabProbe extends StatelessWidget {
|
||||
const _PipelineGraphTabProbe({
|
||||
required this.cupertino,
|
||||
required this.dark,
|
||||
required this.scale,
|
||||
});
|
||||
|
||||
final bool cupertino;
|
||||
final bool dark;
|
||||
final double scale;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget scaled(BuildContext context, Widget? child) => MediaQuery(
|
||||
data: MediaQuery.of(
|
||||
context,
|
||||
).copyWith(textScaler: TextScaler.linear(scale)),
|
||||
child: child ?? const SizedBox.shrink(),
|
||||
);
|
||||
final screen = PipelinesScreen(
|
||||
gateway: PipelinesProbeGateway(),
|
||||
embedded: true,
|
||||
);
|
||||
if (cupertino) {
|
||||
return CupertinoApp(
|
||||
title: 'Pipeline graph fixture',
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: CupertinoThemeData(
|
||||
brightness: dark ? Brightness.dark : Brightness.light,
|
||||
),
|
||||
builder: scaled,
|
||||
// The application shell owns the navigation bar; the probe keeps the
|
||||
// same embedded screen inside a host-native page instead of adding a
|
||||
// second bar that would overlay the detail header.
|
||||
home: CupertinoPageScaffold(child: SafeArea(child: screen)),
|
||||
);
|
||||
}
|
||||
return MaterialApp(
|
||||
title: 'Pipeline graph fixture',
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: ThemeData(
|
||||
platform: TargetPlatform.android,
|
||||
brightness: Brightness.light,
|
||||
),
|
||||
darkTheme: ThemeData(
|
||||
platform: TargetPlatform.android,
|
||||
brightness: Brightness.dark,
|
||||
),
|
||||
themeMode: dark ? ThemeMode.dark : ThemeMode.light,
|
||||
builder: scaled,
|
||||
home: Scaffold(body: SafeArea(child: screen)),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,372 @@
|
||||
// Browser acceptance for the pipeline detail's landed Graph tab.
|
||||
//
|
||||
// Serves the probe build (`flutter build web -t tool/pipeline_graph_tab_probe.dart`)
|
||||
// on an OS-assigned loopback port and drives the actual PipelinesScreen: open a
|
||||
// pipeline, switch to Graph, select a stage node, verify the definition pane's
|
||||
// pinned identity, close it with Back and confirm the Graph tab is still there.
|
||||
// Captures are written for both hosts, dark at 2x; the file prefix carries the
|
||||
// viewport so short-window and large-text runs cannot overwrite each other.
|
||||
//
|
||||
// PROBE_VARIANT=material|cupertino PROBE_SCHEME=dark|light PROBE_SCALE=1|2 \
|
||||
// PROBE_WIDTH=1280 PROBE_HEIGHT=900 PROBE_WEB_ROOT=<probe build> \
|
||||
// OPENCODE_ARTIFACT_DIR=<dir> node tool/pipeline_graph_tab_probe.mjs
|
||||
import { createServer } from 'node:http';
|
||||
import { spawn } from 'node:child_process';
|
||||
import { once } from 'node:events';
|
||||
import { setTimeout as delay } from 'node:timers/promises';
|
||||
import { join, extname, resolve, sep } from 'node:path';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
|
||||
|
||||
const root = resolve(
|
||||
process.env.PROBE_WEB_ROOT ??
|
||||
join(process.cwd(), 'build/pipeline_graph_tab_probe_web'),
|
||||
);
|
||||
const variant = process.env.PROBE_VARIANT ?? 'material';
|
||||
const scheme = process.env.PROBE_SCHEME ?? 'dark';
|
||||
const scale = process.env.PROBE_SCALE ?? '2';
|
||||
const width = Number(process.env.PROBE_WIDTH ?? 1280);
|
||||
const height = Number(process.env.PROBE_HEIGHT ?? 900);
|
||||
const chromePath = process.env.CHROME_PATH ??
|
||||
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
|
||||
const artifactDir = process.env.OPENCODE_ARTIFACT_DIR;
|
||||
if (!artifactDir) throw new Error('Set OPENCODE_ARTIFACT_DIR for the probe captures');
|
||||
await mkdir(artifactDir, { recursive: true });
|
||||
const prefix = `pipeline-graph-${variant}-${scheme}-${scale}x-${width}x${height}`;
|
||||
const mime = {
|
||||
'.html': 'text/html',
|
||||
'.js': 'text/javascript',
|
||||
'.json': 'application/json',
|
||||
'.wasm': 'application/wasm',
|
||||
'.png': 'image/png',
|
||||
'.ico': 'image/x-icon',
|
||||
'.otf': 'font/otf',
|
||||
'.ttf': 'font/ttf',
|
||||
};
|
||||
const server = createServer(async (req, res) => {
|
||||
try {
|
||||
const path = resolve(root, '.' + decodeURIComponent(new URL(req.url, 'http://localhost').pathname));
|
||||
if (path !== root && !path.startsWith(root + sep)) return res.writeHead(403).end();
|
||||
const filePath = path === root || path.endsWith('/') ? join(path, 'index.html') : path;
|
||||
const file = await readFile(filePath);
|
||||
res.writeHead(200, { 'content-type': mime[extname(filePath)] ?? 'application/octet-stream' }).end(file);
|
||||
} catch {
|
||||
res.writeHead(404).end('not found');
|
||||
}
|
||||
});
|
||||
server.listen(0, '127.0.0.1');
|
||||
await once(server, 'listening');
|
||||
const port = server.address().port;
|
||||
const profile = await mkdtemp(join(tmpdir(), 'pipeline-graph-chrome-'));
|
||||
const chrome = spawn(chromePath, [
|
||||
'--headless=new', '--no-first-run', '--no-default-browser-check', '--disable-gpu',
|
||||
'--remote-debugging-port=0', `--user-data-dir=${profile}`, 'about:blank',
|
||||
], { stdio: ['ignore', 'ignore', 'pipe'] });
|
||||
let stderr = '';
|
||||
chrome.stderr.on('data', (data) => { stderr += data; });
|
||||
const waitFor = async (fn) => {
|
||||
for (let i = 0; i < 140; i++) {
|
||||
const value = await fn();
|
||||
if (value) return value;
|
||||
await delay(100);
|
||||
}
|
||||
throw new Error('Timed out waiting for Chrome DevTools');
|
||||
};
|
||||
let ws;
|
||||
try {
|
||||
const endpoint = await waitFor(() => stderr.match(/DevTools listening on (ws:\/\/[^\s]+)/)?.[1]);
|
||||
ws = new WebSocket(endpoint);
|
||||
await once(ws, 'open');
|
||||
let id = 0;
|
||||
const pending = new Map();
|
||||
ws.addEventListener('message', (event) => {
|
||||
const message = JSON.parse(event.data);
|
||||
if (message.method === 'Runtime.exceptionThrown') {
|
||||
console.error('PAGE EXCEPTION', JSON.stringify(message.params?.exceptionDetails?.exception?.description));
|
||||
}
|
||||
if (message.id && pending.has(message.id)) {
|
||||
pending.get(message.id)(message);
|
||||
pending.delete(message.id);
|
||||
}
|
||||
});
|
||||
const send = (method, params = {}, sessionId) => new Promise((resolveCall) => {
|
||||
const callId = ++id;
|
||||
pending.set(callId, resolveCall);
|
||||
ws.send(JSON.stringify({ id: callId, method, params, ...(sessionId ? { sessionId } : {}) }));
|
||||
});
|
||||
const created = await send('Target.createTarget', { url: 'about:blank' });
|
||||
const target = created.result.targetId;
|
||||
const session = (await send('Target.attachToTarget', { targetId: target, flatten: true })).result.sessionId;
|
||||
await send('Page.enable', {}, session);
|
||||
await send('Runtime.enable', {}, session);
|
||||
await send('Emulation.setEmulatedMedia', {
|
||||
features: [{ name: 'prefers-color-scheme', value: scheme }],
|
||||
}, session);
|
||||
await send('Emulation.setDeviceMetricsOverride', {
|
||||
width, height, deviceScaleFactor: 1, mobile: false,
|
||||
}, session);
|
||||
const query = `?style=${variant}&dark=${scheme === 'dark' ? 1 : 0}&scale=${scale}`;
|
||||
const navigation = await send('Page.navigate', { url: `http://127.0.0.1:${port}/${query}` }, session);
|
||||
if (navigation.error || navigation.result?.errorText) throw new Error(JSON.stringify(navigation));
|
||||
const evaluate = async (expression) => {
|
||||
const response = await send('Runtime.evaluate', {
|
||||
expression, returnByValue: true, awaitPromise: true,
|
||||
}, session);
|
||||
if (response.error) throw new Error(`Runtime.evaluate failed: ${JSON.stringify(response)}`);
|
||||
return response.result?.result?.value;
|
||||
};
|
||||
await delay(3500);
|
||||
const loaded = await evaluate('({url:location.href, ready:document.readyState})');
|
||||
if (!loaded?.url.includes(`127.0.0.1:${port}/${query}`)) {
|
||||
throw new Error(`Fixture did not load: ${JSON.stringify(loaded)}`);
|
||||
}
|
||||
await evaluate("document.querySelector('flt-semantics-placeholder')?.click()");
|
||||
await delay(2200);
|
||||
|
||||
const semantics = () => evaluate(`[...document.querySelectorAll('flt-semantics')].map(x => {
|
||||
const r = x.getBoundingClientRect();
|
||||
return {
|
||||
label: (x.getAttribute('aria-label') || (x.innerText || '')).trim(),
|
||||
x: r.x, y: r.y, width: r.width, height: r.height,
|
||||
visible: r.width > 0 && r.height > 0 && r.bottom > 0 && r.top < innerHeight,
|
||||
};
|
||||
})`);
|
||||
const labels = async () => (await semantics()).map((item) => item.label).filter(Boolean);
|
||||
const bodyText = async () => [await evaluate('document.body.innerText'), ...(await labels())].join('\n');
|
||||
const waitForText = async (needle, context) => {
|
||||
for (let attempt = 0; attempt < 60; attempt++) {
|
||||
if ((await bodyText()).includes(needle)) return;
|
||||
await delay(250);
|
||||
}
|
||||
throw new Error(`${context}: missing ${JSON.stringify(needle)}\n${await bodyText()}`);
|
||||
};
|
||||
const exact = async (label) => {
|
||||
const items = await semantics();
|
||||
return items.filter((item) => item.label === label && item.visible)
|
||||
.sort((a, b) => a.width * a.height - b.width * b.height)[0] ?? null;
|
||||
};
|
||||
const clickItem = async (item) => {
|
||||
const x = item.x + item.width / 2;
|
||||
const y = item.y + item.height / 2;
|
||||
await send('Input.dispatchMouseEvent', {
|
||||
type: 'mousePressed', x, y, button: 'left', clickCount: 1,
|
||||
}, session);
|
||||
await send('Input.dispatchMouseEvent', {
|
||||
type: 'mouseReleased', x, y, button: 'left', clickCount: 1,
|
||||
}, session);
|
||||
await delay(1200);
|
||||
};
|
||||
const clickExact = async (label) => {
|
||||
const item = await exact(label);
|
||||
if (!item) throw new Error(`Missing control ${JSON.stringify(label)}: ${JSON.stringify(await labels())}`);
|
||||
await clickItem(item);
|
||||
};
|
||||
// A list row's merged semantics label starts with the pipeline name and also
|
||||
// carries its id/version/run text, so match that prefix and use the row box.
|
||||
const clickNamed = async (name) => {
|
||||
const items = await semantics();
|
||||
const item = items.filter((entry) => entry.label.startsWith(name) && entry.visible)
|
||||
.sort((a, b) => a.width * a.height - b.width * b.height)[0];
|
||||
if (!item) throw new Error(`Missing row ${JSON.stringify(name)}: ${JSON.stringify(await labels())}`);
|
||||
await clickItem(item);
|
||||
};
|
||||
const capture = async (name) => {
|
||||
const data = (await send('Page.captureScreenshot', {
|
||||
format: 'png', captureBeyondViewport: false,
|
||||
}, session)).result.data;
|
||||
const file = `${prefix}-${name}.png`;
|
||||
await writeFile(join(artifactDir, file), Buffer.from(data, 'base64'));
|
||||
return file;
|
||||
};
|
||||
const evidence = { variant, scheme, scale, width, height, checks: [], captures: [] };
|
||||
const check = (text, value) => evidence.checks.push({ check: text, value });
|
||||
|
||||
await waitForText('Release verification', 'pipeline list');
|
||||
await clickNamed('Release verification');
|
||||
await waitForText('Content hash', 'pipeline detail');
|
||||
check('actual pipeline detail opened from the list', true);
|
||||
|
||||
await clickExact('Graph');
|
||||
await waitForText('select a stage for details', 'graph tab guidance');
|
||||
await waitForText('inspect', 'definition stage node');
|
||||
const graphSemantics = await semantics();
|
||||
const note = graphSemantics.find((item) => item.label.startsWith('Scroll or pinch to zoom'));
|
||||
if (!note?.visible) throw new Error(`Graph note is not visible: ${JSON.stringify(note)}`);
|
||||
const tab = graphSemantics.find((item) => item.label === 'Graph');
|
||||
const node = graphSemantics.find((item) => item.label === 'inspect');
|
||||
if (!node?.visible || node.width <= 0 || node.height <= 0) {
|
||||
throw new Error(`Measured stage node is not visible: ${JSON.stringify(node)}`);
|
||||
}
|
||||
// The graph is bounded: the tabs and note stay on screen above the canvas
|
||||
// instead of the canvas growing with the routed layout.
|
||||
if (!tab?.visible) throw new Error(`Graph tab scrolled away: ${JSON.stringify(tab)}`);
|
||||
if (note.y + note.height > node.y) {
|
||||
throw new Error(`Canvas overlaps the note: ${JSON.stringify({ note, node })}`);
|
||||
}
|
||||
if (note.height < 16) throw new Error(`Guidance note collapsed: ${JSON.stringify(note)}`);
|
||||
evidence.nodeRect = node;
|
||||
evidence.noteRect = note;
|
||||
// A capped note must be a real scroll region with its remainder present, not
|
||||
// a label clipped at the viewport edge. Flutter's semantics expose that region
|
||||
// as an overflow-scrolling group with a scroll-overflow marker, so the page
|
||||
// proves the hidden guidance exists and is reachable.
|
||||
const noteScroll = await evaluate(`(() => {
|
||||
const matches = [...document.querySelectorAll('flt-semantics')]
|
||||
.filter(x => ((x.getAttribute('aria-label') || x.innerText || '').trim()
|
||||
.startsWith('Scroll or pinch to zoom')));
|
||||
matches.sort((a, b) =>
|
||||
a.getBoundingClientRect().height - b.getBoundingClientRect().height);
|
||||
let element = matches[0];
|
||||
while (element && element.tagName === 'FLT-SEMANTICS') {
|
||||
if (getComputedStyle(element).overflowY === 'scroll') {
|
||||
const marker = element.querySelector('flt-semantics-scroll-overflow');
|
||||
return {
|
||||
scrollable: true,
|
||||
viewport: element.getBoundingClientRect().height,
|
||||
overflowHeight: marker ? marker.getBoundingClientRect().height : 0,
|
||||
};
|
||||
}
|
||||
element = element.parentElement;
|
||||
}
|
||||
return { scrollable: false, viewport: 0, overflowHeight: 0 };
|
||||
})()`);
|
||||
evidence.noteScroll = noteScroll;
|
||||
if (noteScroll.scrollable) {
|
||||
if (!(noteScroll.overflowHeight > 0)) {
|
||||
throw new Error(`Capped note has no scrollable remainder: ${JSON.stringify(noteScroll)}`);
|
||||
}
|
||||
check(
|
||||
'capped guidance note is an explicit scroll region, not a clipped label',
|
||||
`${Math.round(noteScroll.viewport)}px viewport`,
|
||||
);
|
||||
} else {
|
||||
check('the guidance note fits its slot without scrolling', true);
|
||||
}
|
||||
check('graph tab draws a measured native stage node inside a bounded viewport', true);
|
||||
check('guidance note keeps a readable slot above the canvas', `${note.width}x${note.height}`);
|
||||
evidence.captures.push(await capture('graph'));
|
||||
|
||||
await clickExact('inspect');
|
||||
await waitForText('inspect definition', 'stage definition pane');
|
||||
await waitForText('Release verification · v3', 'pinned identity');
|
||||
await waitForText('Inspect the candidate release.', 'stage definition field');
|
||||
const paneLabels = await labels();
|
||||
if (paneLabels.includes('Release verification') && !paneLabels.includes('Graph')) {
|
||||
throw new Error(`Definition pane did not replace the detail: ${JSON.stringify(paneLabels)}`);
|
||||
}
|
||||
evidence.checks.push({
|
||||
check: 'selecting a stage opens the definition pane for the exact pinned identity',
|
||||
value: 'Release verification · v3',
|
||||
});
|
||||
evidence.captures.push(await capture('stage-definition'));
|
||||
|
||||
await clickExact('Back');
|
||||
await waitForText('Scroll or pinch to zoom, drag to pan', 'graph tab after Back');
|
||||
const afterClose = await bodyText();
|
||||
if (afterClose.includes('inspect definition')) {
|
||||
throw new Error(`Definition pane stayed open after Back: ${afterClose}`);
|
||||
}
|
||||
check('Back closes the definition pane and returns to the same graph tab', true);
|
||||
evidence.captures.push(await capture('closed'));
|
||||
|
||||
// A capped note is a real scroll region; prove its hidden tail moves under a
|
||||
// wheel rather than being unreachable clipped text.
|
||||
if (noteScroll.scrollable) {
|
||||
const noteScrollTop = () => evaluate(`(() => {
|
||||
const matches = [...document.querySelectorAll('flt-semantics')]
|
||||
.filter(x => ((x.getAttribute('aria-label') || x.innerText || '').trim()
|
||||
.startsWith('Scroll or pinch to zoom')));
|
||||
matches.sort((a, b) =>
|
||||
a.getBoundingClientRect().height - b.getBoundingClientRect().height);
|
||||
let element = matches[0];
|
||||
while (element && element.tagName === 'FLT-SEMANTICS') {
|
||||
if (getComputedStyle(element).overflowY === 'scroll') return element.scrollTop;
|
||||
element = element.parentElement;
|
||||
}
|
||||
return -1;
|
||||
})()`);
|
||||
await send('Input.dispatchMouseEvent', {
|
||||
type: 'mouseWheel',
|
||||
x: Math.round(note.x + note.width / 2),
|
||||
y: Math.round(note.y + note.height / 2),
|
||||
deltaX: 0,
|
||||
deltaY: 120,
|
||||
button: 'none',
|
||||
}, session);
|
||||
await delay(600);
|
||||
const scrolled = await noteScrollTop();
|
||||
if (!(scrolled > 0)) {
|
||||
throw new Error(`Wheel did not scroll the capped note: ${JSON.stringify({ scrolled, note })}`);
|
||||
}
|
||||
evidence.noteScrolledPixels = scrolled;
|
||||
check('wheel reaches the guidance note tail inside its scroll region', `${scrolled}px`);
|
||||
evidence.captures.push(await capture('note-scrolled'));
|
||||
}
|
||||
|
||||
// The two definition states the widget tests cover also render in the real
|
||||
// page. They need the list on screen, so they run where list and detail sit
|
||||
// side by side instead of behind one another.
|
||||
if (width >= 1200 && height >= 900) {
|
||||
// At a larger text scale the last rows start below the window; wheel the
|
||||
// list itself until the row is fully on screen, then click its own box.
|
||||
const clickListRow = async (name) => {
|
||||
for (let attempt = 0; attempt < 8; attempt++) {
|
||||
const item = (await semantics())
|
||||
.filter((entry) => entry.label.startsWith(name) && entry.visible)
|
||||
.sort((a, b) => a.width * a.height - b.width * b.height)[0];
|
||||
if (item && item.y >= 0 && item.y + item.height <= height) {
|
||||
await clickItem(item);
|
||||
return;
|
||||
}
|
||||
await send('Input.dispatchMouseEvent', {
|
||||
type: 'mouseWheel',
|
||||
x: Math.round(width * 0.15),
|
||||
y: Math.round(height * 0.5),
|
||||
deltaX: 0,
|
||||
deltaY: 240,
|
||||
button: 'none',
|
||||
}, session);
|
||||
await delay(600);
|
||||
}
|
||||
throw new Error(`Missing list row ${JSON.stringify(name)}: ${JSON.stringify(await labels())}`);
|
||||
};
|
||||
const openGraph = async (name) => {
|
||||
await clickListRow(name);
|
||||
await clickExact('Graph');
|
||||
};
|
||||
const hasStageNode = async () =>
|
||||
(await semantics()).some((item) => item.label === 'inspect' && item.visible);
|
||||
|
||||
await openGraph('Unparsed definition');
|
||||
await waitForText('did not include the pipeline definition graph', 'missing graph state');
|
||||
if (await hasStageNode()) {
|
||||
throw new Error('A reply without a graph still drew a stage node');
|
||||
}
|
||||
check('a reply without a definition graph states it and draws nothing', true);
|
||||
evidence.captures.push(await capture('missing-graph'));
|
||||
|
||||
await openGraph('Empty definition');
|
||||
await waitForText('This pipeline has no stages.', 'empty definition state');
|
||||
if (await hasStageNode()) {
|
||||
throw new Error('An empty definition still drew a stage node');
|
||||
}
|
||||
check('an empty definition keeps its native empty message', true);
|
||||
evidence.captures.push(await capture('empty-definition'));
|
||||
}
|
||||
|
||||
console.log(JSON.stringify(evidence, null, 2));
|
||||
} finally {
|
||||
if (ws?.readyState === WebSocket.OPEN) {
|
||||
ws.send(JSON.stringify({ id: 2147483647, method: 'Browser.close' }));
|
||||
}
|
||||
await Promise.race([once(chrome, 'exit'), delay(3000)]);
|
||||
ws?.close();
|
||||
if (chrome.exitCode === null) chrome.kill('SIGTERM');
|
||||
chrome.stderr.destroy();
|
||||
chrome.unref();
|
||||
await new Promise((resolveClose) => {
|
||||
server.close(resolveClose);
|
||||
server.closeAllConnections();
|
||||
});
|
||||
await rm(profile, { recursive: true, force: true });
|
||||
}
|
||||
@@ -54,6 +54,28 @@ class PipelinesProbeGateway implements ApiGateway {
|
||||
'schedule_count': null,
|
||||
'enabled_schedule_count': null,
|
||||
},
|
||||
{
|
||||
'id': 21,
|
||||
'name': 'Unparsed definition',
|
||||
'version': 1,
|
||||
'stages': 1,
|
||||
'created_at': '2026-07-19T09:05:00',
|
||||
'updated_at': '2026-09-30T14:00:00',
|
||||
'scheduled': false,
|
||||
'schedule_count': 0,
|
||||
'enabled_schedule_count': 0,
|
||||
},
|
||||
{
|
||||
'id': 22,
|
||||
'name': 'Empty definition',
|
||||
'version': 1,
|
||||
'stages': 0,
|
||||
'created_at': '2026-06-02T16:30:00',
|
||||
'updated_at': '2026-08-22T10:20:00',
|
||||
'scheduled': false,
|
||||
'schedule_count': 0,
|
||||
'enabled_schedule_count': 0,
|
||||
},
|
||||
];
|
||||
|
||||
static const _runs = <Map<String, dynamic>>[
|
||||
@@ -107,6 +129,97 @@ class PipelinesProbeGateway implements ApiGateway {
|
||||
14: [
|
||||
{'version': 1, 'stages': 1, 'created_at': '2026-08-04T11:45:00'},
|
||||
],
|
||||
21: [
|
||||
{'version': 1, 'stages': 1, 'created_at': '2026-07-19T09:05:00'},
|
||||
],
|
||||
22: [
|
||||
{'version': 1, 'stages': 0, 'created_at': '2026-06-02T16:30:00'},
|
||||
],
|
||||
};
|
||||
|
||||
/// The pinned definition for each fixture pipeline, in the server's own
|
||||
/// `graph` shape. Only the definitions are here: no run evidence is present.
|
||||
static const _graphs = <int, Map<String, dynamic>>{
|
||||
3: {
|
||||
'name': 'Release verification',
|
||||
'stages': [
|
||||
{
|
||||
'key': 'inspect',
|
||||
'type': 'model',
|
||||
'prompt': 'Inspect the candidate release.',
|
||||
'output': 'report',
|
||||
'edges': {'pass': 'verify', 'fail': '#failure'},
|
||||
},
|
||||
{
|
||||
'key': 'verify',
|
||||
'type': 'model',
|
||||
'prompt': 'Verify the report against the checklist.',
|
||||
'output': 'verdict',
|
||||
'edges': {'pass': 'package', 'fail': '#failure'},
|
||||
},
|
||||
{
|
||||
'key': 'package',
|
||||
'type': 'human',
|
||||
'prompt': 'Approve the package.',
|
||||
'output': 'approval',
|
||||
'edges': {'approve': 'publish', 'hold': '#success'},
|
||||
},
|
||||
{
|
||||
'key': 'publish',
|
||||
'type': 'model',
|
||||
'prompt': 'Publish the release.',
|
||||
'output': 'release',
|
||||
'edges': {'done': '#success'},
|
||||
},
|
||||
],
|
||||
},
|
||||
7: {
|
||||
'name': 'Nightly documentation',
|
||||
'stages': [
|
||||
{
|
||||
'key': 'collect',
|
||||
'type': 'model',
|
||||
'edges': {'done': 'write'},
|
||||
},
|
||||
{
|
||||
'key': 'write',
|
||||
'type': 'model',
|
||||
'edges': {'done': '#success'},
|
||||
},
|
||||
],
|
||||
},
|
||||
11: {
|
||||
'name': 'Hotfix triage',
|
||||
'stages': [
|
||||
{
|
||||
'key': 'classify',
|
||||
'type': 'model',
|
||||
'edges': {'urgent': 'patch', 'normal': 'document'},
|
||||
},
|
||||
{
|
||||
'key': 'patch',
|
||||
'type': 'model',
|
||||
'edges': {'done': '#success'},
|
||||
},
|
||||
{
|
||||
'key': 'document',
|
||||
'type': 'human',
|
||||
'edges': {'done': '#success'},
|
||||
},
|
||||
],
|
||||
},
|
||||
14: {
|
||||
'name': 'Legacy import',
|
||||
'stages': [
|
||||
{
|
||||
'key': 'import',
|
||||
'type': 'model',
|
||||
'edges': {'done': '#success'},
|
||||
},
|
||||
],
|
||||
},
|
||||
// 21 intentionally has no entry: the reply carries no definition graph.
|
||||
22: {'name': 'Empty definition', 'stages': <dynamic>[]},
|
||||
};
|
||||
|
||||
static const _sources = <int, String>{
|
||||
@@ -179,6 +292,19 @@ stages:
|
||||
output: summary
|
||||
edges:
|
||||
done: '#success'
|
||||
''',
|
||||
21: '''
|
||||
name: Unparsed definition
|
||||
stages:
|
||||
import:
|
||||
type: model
|
||||
output: summary
|
||||
edges:
|
||||
done: '#success'
|
||||
''',
|
||||
22: '''
|
||||
name: Empty definition
|
||||
stages: {}
|
||||
''',
|
||||
};
|
||||
|
||||
@@ -223,6 +349,7 @@ stages:
|
||||
'version_created_at': _versionCreatedAt(versions, resolved),
|
||||
'content_hash': 'sha256:fixture-$id-v$resolved',
|
||||
'source': '${_sources[id]}\n# selected version $resolved\n',
|
||||
'graph': _graphs[id],
|
||||
'versions': versions,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user