agl 42.2.2 → 43.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +24 -0
- package/dist_serve/bundle.js +6697 -5287
- package/dist_serve/bundle.js.map +2 -2
- package/dist_serve/bundle.js.third-party-notices.json +29 -29
- package/dist_serve/bundle.js.third-party-notices.txt +29 -29
- package/dist_serve/third-party-notices.md +597 -8
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/aglapi/aglapisurface.document.js +114 -16
- package/dist_ts/aglapi/interfaces.d.ts +30 -0
- package/dist_ts/aglapi/interfaces.js +7 -1
- package/dist_ts/classes.authstore.d.ts +7 -0
- package/dist_ts/classes.authstore.js +12 -1
- package/dist_ts/classes.browserpainttransport.d.ts +2 -2
- package/dist_ts/classes.browserpainttransport.js +9 -8
- package/dist_ts/classes.browserresourcehost.js +30 -20
- package/dist_ts/classes.cli.js +10 -1
- package/dist_ts/classes.controller.d.ts +41 -11
- package/dist_ts/classes.controller.js +232 -52
- package/dist_ts/classes.harnessoperationmanager.d.ts +44 -0
- package/dist_ts/classes.harnessoperationmanager.js +15 -10
- package/dist_ts/classes.mcpclient.d.ts +5 -0
- package/dist_ts/classes.mcpclient.js +15 -3
- package/dist_ts/classes.mcpcontrollerhost.d.ts +3 -0
- package/dist_ts/classes.mcpcontrollerhost.js +17 -3
- package/dist_ts/classes.mcptools.d.ts +4 -3
- package/dist_ts/classes.mcptools.js +20 -1
- package/dist_ts/classes.mcpvalidation.js +4 -1
- package/dist_ts/classes.ticketstore.d.ts +71 -3
- package/dist_ts/classes.ticketstore.js +299 -12
- package/dist_ts/classes.validation.d.ts +2 -0
- package/dist_ts/classes.validation.js +27 -5
- package/dist_ts/driver/classes.directreports.d.ts +23 -3
- package/dist_ts/driver/classes.directreports.js +59 -2
- package/dist_ts/driver/classes.drivereventrelay.js +3 -2
- package/dist_ts/driver/functions.driverinstructions.d.ts +1 -1
- package/dist_ts/driver/functions.driverinstructions.js +12 -3
- package/dist_ts/driver/functions.drivertools.d.ts +4 -0
- package/dist_ts/driver/functions.drivertools.js +8 -2
- package/dist_ts/fleet/classes.boardpump.d.ts +53 -3
- package/dist_ts/fleet/classes.boardpump.js +237 -32
- package/dist_ts/fleet/classes.claudeworkers.d.ts +10 -3
- package/dist_ts/fleet/classes.claudeworkers.js +43 -19
- package/dist_ts/fleet/classes.codexworkers.d.ts +5 -3
- package/dist_ts/fleet/classes.codexworkers.js +26 -9
- package/dist_ts/fleet/classes.deploymonitor.d.ts +253 -0
- package/dist_ts/fleet/classes.deploymonitor.js +821 -0
- package/dist_ts/fleet/classes.gitfacts.d.ts +61 -0
- package/dist_ts/fleet/classes.gitfacts.js +125 -0
- package/dist_ts/fleet/classes.releasereconciler.d.ts +51 -0
- package/dist_ts/fleet/classes.releasereconciler.js +101 -0
- package/dist_ts/fleet/classes.service.d.ts +13 -1
- package/dist_ts/fleet/classes.service.js +76 -7
- package/dist_ts/fleet/classes.ticketeffects.d.ts +13 -0
- package/dist_ts/fleet/classes.ticketeffects.js +42 -8
- package/dist_ts/fleet/classes.workers.d.ts +10 -3
- package/dist_ts/fleet/classes.workers.js +18 -3
- package/dist_ts/fleet/functions.controllerbuild.d.ts +23 -0
- package/dist_ts/fleet/functions.controllerbuild.js +75 -0
- package/dist_ts/fleet/functions.deployprobes.d.ts +39 -0
- package/dist_ts/fleet/functions.deployprobes.js +82 -0
- package/dist_ts/fleet/functions.deployvalidation.d.ts +27 -0
- package/dist_ts/fleet/functions.deployvalidation.js +43 -0
- package/dist_ts/fleet/functions.release.d.ts +2 -1
- package/dist_ts/fleet/functions.release.js +32 -5
- package/dist_ts/fleet/functions.releasefacts.d.ts +42 -0
- package/dist_ts/fleet/functions.releasefacts.js +46 -0
- package/dist_ts/fleet/functions.validation.d.ts +3 -3
- package/dist_ts/fleet/functions.validation.js +4 -7
- package/dist_ts/fleet/functions.watchprobes.js +7 -9
- package/dist_ts/fleet/functions.workervalidation.js +4 -3
- package/dist_ts/fleet/interfaces.workers.d.ts +30 -3
- package/dist_ts/fleet/interfaces.workers.js +14 -1
- package/dist_ts/functions.deploycli.d.ts +36 -0
- package/dist_ts/functions.deploycli.js +157 -0
- package/dist_ts/functions.mcpdeploytools.d.ts +13 -0
- package/dist_ts/functions.mcpdeploytools.js +16 -0
- package/dist_ts/functions.mcptickettools.d.ts +54 -0
- package/dist_ts/functions.mcptickettools.js +8 -7
- package/dist_ts/functions.ticketautolabels.d.ts +2 -0
- package/dist_ts/functions.ticketautolabels.js +9 -3
- package/dist_ts/functions.ticketcli.d.ts +16 -2
- package/dist_ts/functions.ticketcli.js +105 -27
- package/dist_ts/functions.ticketvalidation.d.ts +55 -0
- package/dist_ts/functions.ticketvalidation.js +26 -8
- package/dist_ts_interfaces/deployments.d.ts +241 -0
- package/dist_ts_interfaces/deployments.js +5 -6
- package/dist_ts_interfaces/fleet.d.ts +12 -0
- package/dist_ts_interfaces/fleetworkers.d.ts +21 -1
- package/dist_ts_interfaces/functions.fleetversion.d.ts +4 -0
- package/dist_ts_interfaces/functions.fleetversion.js +25 -0
- package/dist_ts_interfaces/interfaces.d.ts +4 -2
- package/dist_ts_interfaces/interfaces.js +4 -2
- package/dist_ts_interfaces/mcprequests.d.ts +3 -2
- package/dist_ts_interfaces/mcprequests.js +3 -1
- package/dist_ts_interfaces/requests.d.ts +3 -2
- package/dist_ts_interfaces/requests.directreports.d.ts +58 -6
- package/dist_ts_interfaces/requests.js +1 -1
- package/dist_ts_interfaces/requests.tickets.d.ts +25 -5
- package/dist_ts_interfaces/requests.tickets.js +2 -2
- package/dist_ts_interfaces/tickets.d.ts +71 -6
- package/dist_ts_interfaces/tickets.js +34 -6
- package/dist_ts_migration/classes.documentmigrationrunner.d.ts +7 -0
- package/dist_ts_migration/classes.documentmigrationrunner.js +14 -1
- package/dist_ts_migration/index.d.ts +2 -0
- package/dist_ts_migration/index.js +3 -1
- package/dist_ts_migration/v41_ticketclosedcolumn.d.ts +20 -0
- package/dist_ts_migration/v41_ticketclosedcolumn.js +118 -0
- package/dist_ts_migration/v41_ticketlinkrepos.d.ts +24 -0
- package/dist_ts_migration/v41_ticketlinkrepos.js +101 -0
- package/package.json +6 -2
- package/readme.md +308 -36
- package/third-party-notices.md +597 -8
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/aglapi/aglapisurface.document.ts +113 -15
- package/ts/aglapi/interfaces.ts +6 -0
- package/ts/classes.authstore.ts +13 -0
- package/ts/classes.browserpainttransport.ts +8 -7
- package/ts/classes.browserresourcehost.ts +38 -14
- package/ts/classes.cli.ts +9 -0
- package/ts/classes.controller.ts +244 -61
- package/ts/classes.harnessoperationmanager.ts +20 -14
- package/ts/classes.mcpclient.ts +17 -2
- package/ts/classes.mcpcontrollerhost.ts +18 -2
- package/ts/classes.mcptools.ts +21 -2
- package/ts/classes.mcpvalidation.ts +2 -0
- package/ts/classes.ticketstore.ts +312 -13
- package/ts/classes.validation.ts +28 -4
- package/ts/driver/classes.directreports.ts +58 -3
- package/ts/driver/classes.drivereventrelay.ts +2 -1
- package/ts/driver/functions.driverinstructions.ts +11 -2
- package/ts/driver/functions.drivertools.ts +10 -2
- package/ts/fleet/classes.boardpump.ts +235 -28
- package/ts/fleet/classes.claudeworkers.ts +36 -15
- package/ts/fleet/classes.codexworkers.ts +24 -7
- package/ts/fleet/classes.deploymonitor.ts +854 -0
- package/ts/fleet/classes.gitfacts.ts +135 -0
- package/ts/fleet/classes.releasereconciler.ts +103 -0
- package/ts/fleet/classes.service.ts +81 -8
- package/ts/fleet/classes.ticketeffects.ts +38 -6
- package/ts/fleet/classes.workers.ts +19 -5
- package/ts/fleet/functions.controllerbuild.ts +84 -0
- package/ts/fleet/functions.deployprobes.ts +84 -0
- package/ts/fleet/functions.deployvalidation.ts +50 -0
- package/ts/fleet/functions.release.ts +32 -3
- package/ts/fleet/functions.releasefacts.ts +74 -0
- package/ts/fleet/functions.validation.ts +3 -6
- package/ts/fleet/functions.watchprobes.ts +6 -8
- package/ts/fleet/functions.workervalidation.ts +3 -2
- package/ts/fleet/interfaces.workers.ts +23 -3
- package/ts/functions.deploycli.ts +156 -0
- package/ts/functions.mcpdeploytools.ts +18 -0
- package/ts/functions.mcptickettools.ts +7 -6
- package/ts/functions.ticketautolabels.ts +10 -2
- package/ts/functions.ticketcli.ts +100 -24
- package/ts/functions.ticketvalidation.ts +26 -7
- package/ts_interfaces/deployments.ts +194 -0
- package/ts_interfaces/fleet.ts +17 -2
- package/ts_interfaces/fleetworkers.ts +20 -0
- package/ts_interfaces/functions.fleetversion.ts +20 -0
- package/ts_interfaces/interfaces.ts +3 -1
- package/ts_interfaces/mcprequests.ts +3 -0
- package/ts_interfaces/requests.directreports.ts +52 -8
- package/ts_interfaces/requests.tickets.ts +20 -4
- package/ts_interfaces/requests.ts +6 -1
- package/ts_interfaces/tickets.ts +53 -6
- package/ts_migration/classes.documentmigrationrunner.ts +15 -0
- package/ts_migration/index.ts +2 -0
- package/ts_migration/v41_ticketclosedcolumn.ts +106 -0
- package/ts_migration/v41_ticketlinkrepos.ts +91 -0
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements.deployments.ts +1066 -0
- package/ts_web/elements.directreport.ts +2 -2
- package/ts_web/elements.directreportsession.ts +5 -5
- package/ts_web/elements.harnesscontrollerapp.ts +179 -13
- package/ts_web/elements.makedirectreport.ts +444 -0
- package/ts_web/elements.nativesession.ts +29 -1
- package/ts_web/elements.ticketboard.ts +74 -18
- package/ts_web/functions.deployments.ts +231 -0
- package/ts_web/functions.sessionchat.ts +2 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { compareFleetVersions } from '../ts_interfaces/functions.fleetversion.js';
|
|
2
|
+
import type * as interfaces from '../ts_interfaces/index.js';
|
|
3
|
+
import type { IKanbanDetailSection, IKanbanFact, TTone } from '@design.estate/dees-catalog';
|
|
4
|
+
|
|
5
|
+
/** What the Deployments view and its header badge read from one deploy status. */
|
|
6
|
+
export interface IDeploymentsSummary {
|
|
7
|
+
targets: interfaces.IFleetDeployTargetStatus[];
|
|
8
|
+
/** Targets that run less than their newest release, or rolled back. */
|
|
9
|
+
behind: interfaces.IFleetDeployTargetStatus[];
|
|
10
|
+
/** Targets whose probe does not answer. */
|
|
11
|
+
down: interfaces.IFleetDeployTargetStatus[];
|
|
12
|
+
/** Tickets released in a version a target does not run yet, once each. */
|
|
13
|
+
releasedNotRunning: interfaces.IFleetDeployTicket[];
|
|
14
|
+
/** Open bugs found in a running version, once each, urgent first. */
|
|
15
|
+
openBugs: interfaces.IFleetDeployBug[];
|
|
16
|
+
/** Release plans, once each, urgent first. */
|
|
17
|
+
plans: (interfaces.IFleetReleasePlanTicket & { repo: string })[];
|
|
18
|
+
/** Deploy plans, those waiting for the owner's go first, with their target. */
|
|
19
|
+
deployPlans: (interfaces.IFleetDeployPlan & { targetStatus: interfaces.IFleetDeployTargetStatus })[];
|
|
20
|
+
/** The maintenance windows on tickets not done, the earliest first. */
|
|
21
|
+
windows: interfaces.IFleetDeployWindow[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const priorityRank: Record<interfaces.TTicketPriority, number> = { urgent: 0, high: 1, normal: 2, low: 3, none: 4 };
|
|
25
|
+
const byPriority = <T extends { key: string; priority: interfaces.TTicketPriority }>(leftArg: T, rightArg: T): number => (
|
|
26
|
+
priorityRank[leftArg.priority] - priorityRank[rightArg.priority] || leftArg.key.localeCompare(rightArg.key, 'en', { numeric: true })
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
/** Missing ancestry in an older tag is historical evidence, never an implicit rollback proposal. */
|
|
30
|
+
const newerDeployReleases = (targetArg: interfaces.IFleetDeployTargetStatus) => targetArg.notRunning.releases.filter((releaseArg) =>
|
|
31
|
+
!targetArg.running || compareFleetVersions(releaseArg.version, targetArg.running.version) > 0);
|
|
32
|
+
|
|
33
|
+
export const isDeployTargetBehind = (targetArg: interfaces.IFleetDeployTargetStatus): boolean => (
|
|
34
|
+
newerDeployReleases(targetArg).length > 0 || targetArg.running?.rolledBack === true
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
export const summarizeDeployments = (statusArg: interfaces.IFleetDeployStatus): IDeploymentsSummary => {
|
|
38
|
+
const once = <T extends { key: string }>(listsArg: T[][]): T[] => {
|
|
39
|
+
const seen = new Map<string, T>();
|
|
40
|
+
for (const item of listsArg.flat()) if (!seen.has(item.key)) seen.set(item.key, item);
|
|
41
|
+
return [...seen.values()];
|
|
42
|
+
};
|
|
43
|
+
return {
|
|
44
|
+
targets: statusArg.targets,
|
|
45
|
+
behind: statusArg.targets.filter(isDeployTargetBehind),
|
|
46
|
+
down: statusArg.targets.filter((targetArg) => targetArg.probe.state === 'down'),
|
|
47
|
+
releasedNotRunning: once(statusArg.targets.map((targetArg) => targetArg.notRunning.tickets)),
|
|
48
|
+
openBugs: once(statusArg.targets.map((targetArg) => targetArg.openBugs)).sort(byPriority),
|
|
49
|
+
plans: once(statusArg.targets.map((targetArg) => targetArg.plans.map((planArg) => ({
|
|
50
|
+
...planArg, repo: targetArg.repository ?? targetArg.target.repo })))).sort(byPriority),
|
|
51
|
+
deployPlans: statusArg.targets.flatMap((targetArg) => targetArg.deployPlans.map((planArg) => ({ ...planArg, targetStatus: targetArg })))
|
|
52
|
+
.sort((leftArg, rightArg) => Number(rightArg.go === 'waiting') - Number(leftArg.go === 'waiting') || byPriority(leftArg, rightArg)),
|
|
53
|
+
windows: [...statusArg.windows],
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The header badge: how many targets are behind, do not answer, or have a deploy plan that waits for the owner's go,
|
|
59
|
+
* and how many maintenance windows the driver proposed wait for it.
|
|
60
|
+
*/
|
|
61
|
+
export const deploymentsAttentionCount = (statusArg: interfaces.IFleetDeployStatus): number => (
|
|
62
|
+
statusArg.targets.filter((targetArg) => isDeployTargetBehind(targetArg) || targetArg.probe.state === 'down'
|
|
63
|
+
|| targetArg.deployPlans.some((planArg) => planArg.go === 'waiting')).length
|
|
64
|
+
+ statusArg.windows.filter((windowArg) => windowArg.go === 'waiting').length
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const dayMs = 24 * 60 * 60 * 1000;
|
|
68
|
+
const startOfDay = (timeArg: number): number => { const date = new Date(timeArg); date.setHours(0, 0, 0, 0); return date.getTime(); };
|
|
69
|
+
const clock = (dateArg: Date): string => `${String(dateArg.getHours()).padStart(2, '0')}:${String(dateArg.getMinutes()).padStart(2, '0')}`;
|
|
70
|
+
|
|
71
|
+
/** A moment as the view says it, in the reader's time zone: "today 10:05", "yesterday 18:40", "Thu 21:14", "17 Oct". */
|
|
72
|
+
export const deployMoment = (isoArg: string | undefined, nowArg = Date.now()): string => {
|
|
73
|
+
if (!isoArg) return '';
|
|
74
|
+
const time = Date.parse(isoArg);
|
|
75
|
+
if (!Number.isFinite(time)) return '';
|
|
76
|
+
const date = new Date(time);
|
|
77
|
+
const days = Math.round((startOfDay(nowArg) - startOfDay(time)) / dayMs);
|
|
78
|
+
if (days <= 0) return `today ${clock(date)}`;
|
|
79
|
+
if (days === 1) return `yesterday ${clock(date)}`;
|
|
80
|
+
if (days < 7) return `${date.toLocaleDateString('en', { weekday: 'short' })} ${clock(date)}`;
|
|
81
|
+
return date.toLocaleDateString('en', { day: 'numeric', month: 'short' });
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/** The time of day alone, for "checked 12:41". */
|
|
85
|
+
export const deployClock = (isoArg: string | undefined): string => {
|
|
86
|
+
const time = isoArg ? Date.parse(isoArg) : Number.NaN;
|
|
87
|
+
return Number.isFinite(time) ? clock(new Date(time)) : '';
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/** How long ago, roughly: "2 days ago", "5 hours ago", "just now". */
|
|
91
|
+
export const deployAge = (isoArg: string | undefined, nowArg = Date.now()): string => {
|
|
92
|
+
const time = isoArg ? Date.parse(isoArg) : Number.NaN;
|
|
93
|
+
if (!Number.isFinite(time)) return '';
|
|
94
|
+
const minutes = Math.max(0, Math.round((nowArg - time) / 60_000));
|
|
95
|
+
if (minutes < 2) return 'just now';
|
|
96
|
+
if (minutes < 120) return `${minutes} minutes ago`;
|
|
97
|
+
const hours = Math.round(minutes / 60);
|
|
98
|
+
if (hours < 48) return `${hours} hours ago`;
|
|
99
|
+
return `${Math.round(hours / 24)} days ago`;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const shortSha = (shaArg: string | undefined): string => shaArg ? shaArg.slice(0, 7) : '';
|
|
103
|
+
|
|
104
|
+
/** A maintenance window's time as the view says it, in the reader's time zone: "Tue Oct 27, 02:00–03:00". */
|
|
105
|
+
export const deployWindowRange = (windowArg: Pick<interfaces.IFleetDeployWindow, 'from' | 'to'>): string => {
|
|
106
|
+
const from = new Date(windowArg.from), to = new Date(windowArg.to);
|
|
107
|
+
const day = (dateArg: Date) => dateArg.toLocaleDateString('en', { weekday: 'short', day: 'numeric', month: 'short' }).replace(/^(\w+),? /u, '$1 ');
|
|
108
|
+
return `${day(from)}, ${clock(from)}–${day(from) === day(to) ? '' : `${day(to)}, `}${clock(to)}`;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/** When a target may be deployed, in words, for the target sheet. */
|
|
112
|
+
export const deployWhenText = (targetArg: interfaces.IFleetDeployTargetStatus): string => {
|
|
113
|
+
if (targetArg.deployWhen === 'idle') {
|
|
114
|
+
return `When no session is busy${targetArg.busySessions ? `: ${targetArg.busySessions} busy now` : ': none is busy now'}.`;
|
|
115
|
+
}
|
|
116
|
+
if (targetArg.deployWhen === 'anytime') return 'At any time.';
|
|
117
|
+
// Only a window the owner gave counts; one the driver proposed waits for the owner's go.
|
|
118
|
+
const given = targetArg.windows.filter((windowArg) => windowArg.go === 'given');
|
|
119
|
+
const active = given.find((windowArg) => windowArg.state === 'active');
|
|
120
|
+
const next = given[0];
|
|
121
|
+
const waiting = targetArg.windows.find((windowArg) => windowArg.go === 'waiting');
|
|
122
|
+
return active ? `Only inside a maintenance window: ${active.key} is open until ${deployClock(active.to)}.`
|
|
123
|
+
: next ? `Only inside a maintenance window: the next is ${next.key}, ${deployWindowRange(next)}.`
|
|
124
|
+
: waiting ? `Only inside a maintenance window: ${waiting.key}, ${deployWindowRange(waiting)}, waits for your go.`
|
|
125
|
+
: 'Only inside a maintenance window; none is planned.';
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/** A deploy plan's state as a pill and a line: the owner's go, and where the deploy stands. */
|
|
129
|
+
export const deployGoView = (planArg: interfaces.IFleetDeployPlan, conditionArg: interfaces.TFleetDeployCondition):
|
|
130
|
+
{ text: string; tone: TTone; detail: string } => {
|
|
131
|
+
if (planArg.go === 'waiting') return { text: 'Waits on your go', tone: 'warning', detail: `Deploy ${planArg.version}` };
|
|
132
|
+
if (planArg.go === 'now') return { text: 'Go: deploy now', tone: 'info', detail: `Deploy ${planArg.version}` };
|
|
133
|
+
if (planArg.go === 'idle') return { text: 'When idle', tone: 'info', detail: `Upgrade to ${planArg.version} when no session is busy` };
|
|
134
|
+
if (planArg.go === 'hold') return { text: 'Held', tone: 'neutral', detail: `Deploy ${planArg.version} held` };
|
|
135
|
+
return planArg.window
|
|
136
|
+
? { text: planArg.window.state === 'active' ? 'In the open window' : 'Queued', tone: planArg.window.state === 'active' ? 'success' : 'info',
|
|
137
|
+
detail: `${planArg.version} in ${planArg.window.key}, ${deployWindowRange(planArg.window)}` }
|
|
138
|
+
: { text: 'Waits for a window', tone: 'warning', detail: conditionArg === 'window' ? `${planArg.version}: plan a window` : `Deploy ${planArg.version}` };
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/** Where a deploy plan stands, in a line, for the Plans list, the target sheet and the ticket detail. */
|
|
142
|
+
export const deployPlanLine = (planArg: interfaces.IFleetDeployPlan): string => {
|
|
143
|
+
const who = planArg.assignee ?? 'the driver';
|
|
144
|
+
if (planArg.go === 'waiting') return 'Waits for your go: deploy now, queue it or hold it.';
|
|
145
|
+
if (planArg.go === 'now') return `Go given: ${who} deploys it now.`;
|
|
146
|
+
if (planArg.go === 'idle') return `Go given: ${who} upgrades it when no session is busy.`;
|
|
147
|
+
if (planArg.go === 'hold') return 'Held: nothing deploys it until it is planned again.';
|
|
148
|
+
return planArg.window ? `Queued into ${planArg.window.key}, ${deployWindowRange(planArg.window)}: ${who} deploys it then.`
|
|
149
|
+
: 'Queued into the next maintenance window: none is planned yet.';
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
/** A maintenance window as a pill: the owner's go while it is not given, else where it stands. */
|
|
153
|
+
export const deployWindowStateView = (windowArg: Pick<interfaces.IFleetDeployWindow, 'state' | 'go'>): { text: string; tone: TTone } => (
|
|
154
|
+
windowArg.go === 'waiting' ? { text: 'waits for your go', tone: 'warning' } : windowArg.go === 'declined' ? { text: 'declined', tone: 'neutral' }
|
|
155
|
+
: windowArg.state === 'active' ? { text: 'open now', tone: 'success' } : windowArg.state === 'done' ? { text: 'ended', tone: 'neutral' }
|
|
156
|
+
: { text: 'scheduled', tone: 'info' }
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
/** Where the Deployments view lives: the app opens it when it loads with this hash. */
|
|
160
|
+
export const deploymentsHref = '#deployments';
|
|
161
|
+
|
|
162
|
+
/** A target's name as the view shows it. */
|
|
163
|
+
export const deployTargetName = (targetArg: interfaces.IFleetDeployTargetStatus): string => targetArg.target.name ?? targetArg.target.id;
|
|
164
|
+
|
|
165
|
+
/** What a target's probe is, in words. */
|
|
166
|
+
export const deployProbeText = (targetArg: interfaces.IFleetDeployTarget): string => targetArg.probe.kind === 'controller'
|
|
167
|
+
? 'Built in: the controller\'s own version and start time'
|
|
168
|
+
: `HTTP ${targetArg.probe.url}, version at ${targetArg.probe.versionPointer ?? '/version'}${targetArg.probe.shaPointer ? `, commit at ${targetArg.probe.shaPointer}` : ''}`;
|
|
169
|
+
|
|
170
|
+
/** The next step for a target, for the table's last column. */
|
|
171
|
+
export type TDeployNext =
|
|
172
|
+
| { kind: 'hotfix'; bug: interfaces.IFleetDeployBug }
|
|
173
|
+
| { kind: 'deployPlan'; plan: interfaces.IFleetDeployPlan }
|
|
174
|
+
| { kind: 'plan'; plan: interfaces.IFleetReleasePlanTicket }
|
|
175
|
+
| { kind: 'deploy'; version: string }
|
|
176
|
+
| { kind: 'none' };
|
|
177
|
+
export const deployNextStep = (targetArg: interfaces.IFleetDeployTargetStatus): TDeployNext => {
|
|
178
|
+
const hotfix = targetArg.openBugs.find((bugArg) => bugArg.priority === 'urgent' && bugArg.fixLandedSha
|
|
179
|
+
&& !targetArg.plans.some((planArg) => planArg.key === bugArg.key));
|
|
180
|
+
if (hotfix) return { kind: 'hotfix', bug: hotfix };
|
|
181
|
+
if (targetArg.deployPlans[0]) return { kind: 'deployPlan', plan: targetArg.deployPlans[0] };
|
|
182
|
+
if (targetArg.plans[0]) return { kind: 'plan', plan: targetArg.plans[0] };
|
|
183
|
+
const next = newerDeployReleases(targetArg)[0];
|
|
184
|
+
if (next) return { kind: 'deploy', version: next.version };
|
|
185
|
+
return { kind: 'none' };
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* The ticket detail's own section (AGL-914): where the work runs (landed, fixed in, which targets run it), from
|
|
190
|
+
* `controller.deploy.ticket`.
|
|
191
|
+
*/
|
|
192
|
+
export const ticketDeploySections = (placementArg: interfaces.IFleetDeployTicketPlacement): IKanbanDetailSection[] => {
|
|
193
|
+
const where: IKanbanFact[] = [];
|
|
194
|
+
for (const landed of placementArg.landed) {
|
|
195
|
+
where.push({ iconName: 'lucide:GitCommitHorizontal', tone: 'success', text: `Landed on main${placementArg.landed.length > 1 ? ` of ${landed.repo}` : ''}`,
|
|
196
|
+
code: shortSha(landed.sha), ...(landed.branch ? { detail: `branch ${landed.branch}` } : {}) });
|
|
197
|
+
where.push(landed.fixedIn
|
|
198
|
+
? { iconName: 'lucide:Tag', tone: 'success', text: `Fixed in ${landed.repo}`, code: landed.fixedIn.version,
|
|
199
|
+
detail: `the first tag that holds ${shortSha(landed.sha)}` }
|
|
200
|
+
: { iconName: 'lucide:Tag', tone: 'neutral', text: 'In no release yet', detail: `the next release of ${landed.repo} ships it` });
|
|
201
|
+
}
|
|
202
|
+
const running = placementArg.runs.filter((runArg) => runArg.runs);
|
|
203
|
+
const missing = placementArg.runs.filter((runArg) => !runArg.runs && runArg.shippedIn);
|
|
204
|
+
if (running.length) {
|
|
205
|
+
where.push({ iconName: 'lucide:Server', tone: 'success', text: `Running on ${running.map((runArg) => runArg.name).join(', ')}`,
|
|
206
|
+
detail: running.map((runArg) => `${runArg.name} runs ${runArg.version}`).join(' · ') });
|
|
207
|
+
}
|
|
208
|
+
if (missing.length) {
|
|
209
|
+
where.push({ iconName: 'lucide:ServerOff', tone: 'warning', text: running.length ? `Not running on ${missing.map((runArg) => runArg.name).join(', ')}` : 'Not running anywhere yet',
|
|
210
|
+
detail: missing.map((runArg) => `${runArg.name}${runArg.environment ? ` ${runArg.environment}` : ''} runs ${runArg.version ?? 'nothing observed'}`).join(' · ') });
|
|
211
|
+
}
|
|
212
|
+
if (!where.length) where.push({ iconName: 'lucide:Circle', text: 'Not landed yet.', detail: 'A landing links its commit; a release and the targets that run it follow.' });
|
|
213
|
+
// Found in and the release plan are the kanban's own fields (the ticket's affects links and releasePlan).
|
|
214
|
+
const planned: IKanbanFact[] = [];
|
|
215
|
+
const window = placementArg.maintenanceWindow;
|
|
216
|
+
if (window) {
|
|
217
|
+
const state = deployWindowStateView(window);
|
|
218
|
+
planned.push({ iconName: 'lucide:CalendarDays', tone: state.tone, text: `Maintenance window, ${state.text}`,
|
|
219
|
+
detail: `${deployWindowRange(window)} · ${window.targets.join(', ')}` });
|
|
220
|
+
}
|
|
221
|
+
const deploy = placementArg.deployPlan;
|
|
222
|
+
if (deploy) {
|
|
223
|
+
planned.push({ iconName: 'lucide:Rocket', tone: deployGoView(deploy.plan, deploy.deployWhen).tone,
|
|
224
|
+
text: `Deploy to ${deploy.targetName}${deploy.environment ? ` (${deploy.environment})` : ''}`, code: deploy.plan.version, detail: deployPlanLine(deploy.plan) });
|
|
225
|
+
}
|
|
226
|
+
// A link the board reports before it follows it: the app routes it, and a new tab opens the app on the view.
|
|
227
|
+
const actions = [{ id: 'open-deployments', label: 'Open in Deployments', iconName: 'lucide:Rocket', href: deploymentsHref }];
|
|
228
|
+
// A window or a deploy plan ships no code of its own: its ticket says what it plans, not where it runs.
|
|
229
|
+
if (planned.length && !placementArg.landed.length && !placementArg.runs.length) return [{ id: 'planned', title: 'Planned', facts: planned, actions }];
|
|
230
|
+
return [{ id: 'where', title: 'Where it runs', facts: where, actions }, ...(planned.length ? [{ id: 'planned', title: 'Planned', facts: planned }] : [])];
|
|
231
|
+
};
|
|
@@ -55,6 +55,7 @@ type TSessionChatProperty =
|
|
|
55
55
|
| 'reasoningEffort'
|
|
56
56
|
| 'effortOptions'
|
|
57
57
|
| 'menuActions'
|
|
58
|
+
| 'toolbarActions'
|
|
58
59
|
| 'workers'
|
|
59
60
|
| 'selectedWorkerId'
|
|
60
61
|
| 'workersHeading'
|
|
@@ -164,6 +165,7 @@ export const renderSessionChat = (viewArg: ISessionChatView): plugins.deesElemen
|
|
|
164
165
|
.reasoningEffort=${viewArg.reasoningEffort ?? ''}
|
|
165
166
|
.effortOptions=${viewArg.effortOptions ?? emptyList}
|
|
166
167
|
.menuActions=${viewArg.menuActions ?? emptyList}
|
|
168
|
+
.toolbarActions=${viewArg.toolbarActions ?? emptyList}
|
|
167
169
|
.workers=${viewArg.workers}
|
|
168
170
|
.selectedWorkerId=${viewArg.selectedWorkerId ?? ''}
|
|
169
171
|
.workersHeading=${viewArg.workersHeading ?? ''}
|