feat(app): show template stage counts

This commit is contained in:
2026-10-23 12:20:06 +01:00
parent c089ecd8af
commit 23b8ee8f7c
8 changed files with 117 additions and 19 deletions
+5 -1
View File
@@ -100,7 +100,11 @@ class _ProbeGateway implements ApiGateway {
publish();
await Future<void>.delayed(const Duration(milliseconds: 200));
return {
'graph': {'stages': const []},
'graph': {
'stages': const [
{'key': 'release'},
],
},
};
}
if (type == 'submit') {
+7 -6
View File
@@ -241,7 +241,7 @@ try {
await clickLabel('Release workflow', { contains: true });
await assertBody('Definition source');
const before = await state();
if (before?.listCalls !== 1 || before?.validates !== 0 || before?.submits !== 0) {
if (before?.listCalls !== 1 || before?.validates !== 2 || before?.submits !== 0) {
throw new Error(`Opening the template made unexpected requests: ${JSON.stringify(before)}`);
}
@@ -251,7 +251,7 @@ try {
await assertBody('Definition source');
await assertBody('Create pipeline from this template');
const refused = await state();
if (refused?.listCalls !== 2 || refused?.validates !== 0 || refused?.submits !== 0) {
if (refused?.listCalls !== 2 || refused?.validates !== 2 || refused?.submits !== 0) {
throw new Error(`The failed refresh did not stay read-only: ${JSON.stringify(refused)}`);
}
captures.push(await capture(`${capturePrefix}-detail-refresh-error`));
@@ -286,6 +286,7 @@ try {
await assertBody('Release workflow');
await assertBody('(unnamed template)');
await assertBody('Ship a version');
await assertBody('1 stage');
const gallery = await state();
if (gallery?.listCalls !== 2) {
throw new Error(`Retry did not re-read exactly once: ${JSON.stringify(gallery)}`);
@@ -299,7 +300,7 @@ try {
await assertBody('Includes a schedule');
await assertBody('Create pipeline from this template');
const detail = await state();
if (detail?.validates !== 0 || detail?.submits !== 0) {
if (detail?.validates !== 2 || detail?.submits !== 0) {
throw new Error(`Opening a template sent a write: ${JSON.stringify(detail)}`);
}
captures.push(await capture(`${capturePrefix}-detail`));
@@ -310,7 +311,7 @@ try {
await clickLabel('Refresh');
await assertBody('Added after refresh');
const refreshed = await state();
if (refreshed?.listCalls !== 3) {
if (refreshed?.listCalls !== 3 || refreshed?.validates !== 5) {
throw new Error(`Refresh made unexpected requests: ${JSON.stringify(refreshed)}`);
}
captures.push(await capture(`${capturePrefix}-refreshed`));
@@ -326,7 +327,7 @@ try {
await clickLabel('Cancel');
await waitFor(async () => !(await semanticText()).includes('Create from Release workflow'), 'the prompt to close');
const cancelled = await state();
if (cancelled?.validates !== 0 || cancelled?.submits !== 0 || cancelled?.created?.length !== 0) {
if (cancelled?.validates !== 5 || cancelled?.submits !== 0 || cancelled?.created?.length !== 0) {
throw new Error(`Cancel sent a request: ${JSON.stringify(cancelled)}`);
}
checks.push({ check: 'Cancel sent nothing', state: cancelled });
@@ -341,7 +342,7 @@ try {
await clickLabel('Create');
await assertBody('Created "Probe created". It is in the Pipelines list.');
const created = await state();
if (created?.validates !== 1 || created?.submits !== 1 || created?.created?.length !== 1) {
if (created?.validates !== 6 || created?.submits !== 1 || created?.created?.length !== 1) {
throw new Error(`The accepted create was not reported exactly once: ${JSON.stringify(created)}`);
}
if (created.lastSubmit?.name !== 'Probe release' || created.lastSubmit?.create_only !== true) {