@astrofoundry/pi-astro 0.40.47 → 0.40.48
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.
|
@@ -94,9 +94,11 @@ function entry(r: ArcaneReport, stack: string): StackEntry {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
describe("Arcane Daily Report layout", () => {
|
|
97
|
-
it("marks the images our own CI builds", () => {
|
|
97
|
+
it("marks the images our own CI builds and leaves out stopped stacks", () => {
|
|
98
98
|
const own = { stack: "bigcapital", service: "server", ref: "ghcr.io/astrofoundry/bigcapital-server:astrofoundry", running: "?", latest: "new build", status: "update", action: "pull", note: "versions unavailable: private image" };
|
|
99
|
-
const
|
|
99
|
+
const stopped = { ...own, stack: "grimoire-graphile-bootstrap", service: "bootstrap", ref: "ghcr.io/astronaute77/arcane-graphile-worker:latest", stopped: true };
|
|
100
|
+
const built = buildStacks({ ...updateReport, rows: [rows[0], own, stopped] });
|
|
101
|
+
expect(built?.stacks.map((s) => s.stack)).toEqual(["bigcapital", "vpn"]);
|
|
100
102
|
expect(built?.stacks.find((s) => s.stack === "bigcapital")?.lines[0].own).toBe(true);
|
|
101
103
|
expect(built?.stacks.find((s) => s.stack === "vpn")?.lines[0].own).toBeUndefined();
|
|
102
104
|
});
|
|
@@ -22,6 +22,7 @@ interface ReportRow {
|
|
|
22
22
|
status: string;
|
|
23
23
|
action: string;
|
|
24
24
|
note: string;
|
|
25
|
+
stopped?: boolean;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
interface UpdateReportJson {
|
|
@@ -150,12 +151,13 @@ export interface ReportStacks {
|
|
|
150
151
|
/**
|
|
151
152
|
* The report's stacks from one `update-report` answer: services with a
|
|
152
153
|
* pending update, a failed check, or a newer major tag, grouped by stack.
|
|
154
|
+
* Stopped stacks are left out: nobody uses them, and `stack-update` refuses them.
|
|
153
155
|
* The arcane stack is the manager, offered through manager-upgrade.
|
|
154
156
|
*/
|
|
155
157
|
export function buildStacks(report: unknown): ReportStacks | null {
|
|
156
158
|
if (!isReport(report)) return null;
|
|
157
159
|
const holds = report.holds ?? {};
|
|
158
|
-
const shown = report.rows.filter((r) => PENDING.has(r.status) || r.status === "unknown" || /newer major \S+ available/.test(r.note ?? ""));
|
|
160
|
+
const shown = report.rows.filter((r) => !r.stopped && (PENDING.has(r.status) || r.status === "unknown" || /newer major \S+ available/.test(r.note ?? "")));
|
|
159
161
|
const names = [...new Set(shown.map((r) => r.stack))].sort((a, b) => a.localeCompare(b));
|
|
160
162
|
const stacks = names.map((stack): StackEntry => {
|
|
161
163
|
const lines = shown
|
package/package.json
CHANGED
|
@@ -145,6 +145,8 @@ describe("buildUpdateReport", () => {
|
|
|
145
145
|
const all = await buildUpdateReport({ check, projects, registry, startedAt: NOW, all: true });
|
|
146
146
|
expect(all.rows).toHaveLength(6);
|
|
147
147
|
expect(all.table).toContain("* canary: stack is stopped");
|
|
148
|
+
expect(all.rows.find((r) => r.stack === "canary")?.stopped).toBe(true);
|
|
149
|
+
expect(all.rows.find((r) => r.stack === "media")?.stopped).toBeUndefined();
|
|
148
150
|
});
|
|
149
151
|
|
|
150
152
|
it("fetches each repository's tags once", async () => {
|
|
@@ -28,6 +28,8 @@ export interface UpdateRow {
|
|
|
28
28
|
note: string;
|
|
29
29
|
/** For `edit digest` rows: the manifest digest of the latest release, to write into the Compose file. */
|
|
30
30
|
latestDigest?: string;
|
|
31
|
+
/** The stack is stopped: `stack-update` refuses it, because a redeploy would start it. */
|
|
32
|
+
stopped?: true;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
export interface UpdateReport {
|
|
@@ -370,7 +372,7 @@ export async function buildUpdateReport(input: { check: unknown; projects: unkno
|
|
|
370
372
|
if (s.ref === null) return { stack: s.stack, service: s.service, ref: "", image: "?", kind: "floating", running: "?", latest: "?", status: "unknown", action: "", note: "Arcane lists no images for this stack" };
|
|
371
373
|
const r = resolved.get(s.ref) as Resolution & { kind: RefKind };
|
|
372
374
|
const note = [r.note, s.stopped ? "stack is stopped" : ""].filter(Boolean).join("; ");
|
|
373
|
-
return { stack: s.stack, service: s.service, ref: s.ref, image: shortImage(parseImageRef(s.ref)), kind: r.kind, running: r.running, latest: r.latest, status: r.status, action: r.action, note, ...(r.latestDigest ? { latestDigest: r.latestDigest } : {}) };
|
|
375
|
+
return { stack: s.stack, service: s.service, ref: s.ref, image: shortImage(parseImageRef(s.ref)), kind: r.kind, running: r.running, latest: r.latest, status: r.status, action: r.action, note, ...(r.latestDigest ? { latestDigest: r.latestDigest } : {}), ...(s.stopped ? { stopped: true as const } : {}) };
|
|
374
376
|
});
|
|
375
377
|
rows.sort((a, b) => STATUS_ORDER[a.status] - STATUS_ORDER[b.status] || a.stack.localeCompare(b.stack) || a.service.localeCompare(b.service));
|
|
376
378
|
const counts: Record<UpdateStatus, number> = { update: 0, release: 0, rebuild: 0, unknown: 0, "up-to-date": 0 };
|