@intentius/chant 0.18.28 → 0.18.29
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/components.ts"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,0BAA0B,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAuErF;
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/components.ts"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,0BAA0B,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAuErF;AAqHD,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAuN9E;AAED,kEAAkE;AAClE,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAM/E"}
|
|
@@ -58,6 +58,28 @@ export interface ComponentStatusRow {
|
|
|
58
58
|
reconciliation: "reconciled" | "unrecorded" | "stale" | "drifted" | "unknown";
|
|
59
59
|
/** Human-readable detail backing the verdict. */
|
|
60
60
|
detail: string;
|
|
61
|
+
/**
|
|
62
|
+
* Machine-readable "observed live", when live evidence was gathered (`--live`).
|
|
63
|
+
* A consumer joining this row onto a graph node should read this rather than
|
|
64
|
+
* string-matching `detail`. Absent when `--live` was not requested.
|
|
65
|
+
*/
|
|
66
|
+
live?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* The owning deploy unit's raw status, when a lexicon reported it (AWS: the
|
|
69
|
+
* component's own CFN stack via `describeStackStatus`). Lets a renderer paint a
|
|
70
|
+
* richer palette than the reconciliation verdict — `healthy` green,
|
|
71
|
+
* present-but-not-healthy amber (mid-deploy) / red (rollback/failed).
|
|
72
|
+
*/
|
|
73
|
+
stack?: LiveStackInfo;
|
|
74
|
+
}
|
|
75
|
+
/** A component's owning deploy unit and its provider-native status. */
|
|
76
|
+
export interface LiveStackInfo {
|
|
77
|
+
/** The deploy-unit name (e.g. the CloudFormation stack name). */
|
|
78
|
+
name: string;
|
|
79
|
+
/** Provider-native status string, e.g. "CREATE_COMPLETE". */
|
|
80
|
+
status?: string;
|
|
81
|
+
/** True when `status` is a terminal success state. */
|
|
82
|
+
healthy?: boolean;
|
|
61
83
|
}
|
|
62
84
|
export interface ComponentStatusResult {
|
|
63
85
|
env: string;
|
|
@@ -80,6 +102,9 @@ export interface LiveComponentEvidence {
|
|
|
80
102
|
action?: ChangeAction;
|
|
81
103
|
/** Ownership verdict, when known. */
|
|
82
104
|
ownership?: "owned" | "foreign" | "unknown";
|
|
105
|
+
/** The owning deploy unit's raw status, when observed (AWS: the component's own
|
|
106
|
+
* CFN stack). Surfaced onto `ComponentStatusRow.stack` for a richer palette. */
|
|
107
|
+
stack?: LiveStackInfo;
|
|
83
108
|
}
|
|
84
109
|
/**
|
|
85
110
|
* Overlay per-component stack-presence evidence onto change-set evidence.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/lifecycle/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE5E,+FAA+F;AAC/F,MAAM,WAAW,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AAe,CAC7B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,aAAa,EAAE,EACxB,IAAI,CAAC,EAAE;IACL,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAClD,2DAA2D;IAC3D,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC/C,+MAA+M;IAC/M,oBAAoB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IACxD,6KAA6K;IAC7K,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B,GACA,kBAAkB,EAAE,CAsDtB;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,IAAI,EAAE,OAAO,CAAC;CACf;AAED,oGAAoG;AACpG,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,aAAa,EAAE,CAAA;CAAE,EAChD,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,aAAa,EAAE,CAAA;CAAE,GAC/C,kBAAkB,CAWpB"}
|
package/package.json
CHANGED
|
@@ -172,6 +172,8 @@ interface StatusJsonRow {
|
|
|
172
172
|
} | null;
|
|
173
173
|
reconciliation: string;
|
|
174
174
|
detail: string;
|
|
175
|
+
live?: boolean;
|
|
176
|
+
stack?: { name: string; status?: string; healthy?: boolean };
|
|
175
177
|
}
|
|
176
178
|
|
|
177
179
|
/**
|
|
@@ -237,7 +239,15 @@ async function observeComponentStacks(
|
|
|
237
239
|
const determinate = observed.filter((o): o is NonNullable<typeof o> => o !== null);
|
|
238
240
|
if (determinate.length === 0) continue;
|
|
239
241
|
const present = determinate.every((o) => o.present);
|
|
240
|
-
|
|
242
|
+
// Surface the (first present, else first) stack's raw status for a richer
|
|
243
|
+
// palette than the reconciliation verdict. One cfn-deploy stack per component
|
|
244
|
+
// is the norm; a multi-stack component reports its representative unit.
|
|
245
|
+
const repr = determinate.find((o) => o.present) ?? determinate[0];
|
|
246
|
+
evidence.set(name, {
|
|
247
|
+
live: present,
|
|
248
|
+
ownership: present ? "owned" : undefined,
|
|
249
|
+
stack: { name: repr.stack, status: repr.status, healthy: repr.healthy },
|
|
250
|
+
});
|
|
241
251
|
}
|
|
242
252
|
return evidence;
|
|
243
253
|
}
|
|
@@ -396,6 +406,8 @@ export async function runComponentsStatus(ctx: CommandContext): Promise<number>
|
|
|
396
406
|
: null,
|
|
397
407
|
reconciliation: row.reconciliation,
|
|
398
408
|
detail: row.detail,
|
|
409
|
+
...(row.live !== undefined ? { live: row.live } : {}),
|
|
410
|
+
...(row.stack ? { stack: row.stack } : {}),
|
|
399
411
|
});
|
|
400
412
|
}
|
|
401
413
|
}
|
|
@@ -135,6 +135,29 @@ describe("status", () => {
|
|
|
135
135
|
expect(rows[0].reconciliation).toBe("drifted");
|
|
136
136
|
});
|
|
137
137
|
|
|
138
|
+
test("surfaces machine-readable live + stack status when observed (#57 hardening)", () => {
|
|
139
|
+
const liveEvidence = new Map<string, LiveComponentEvidence>([
|
|
140
|
+
["search-service", { live: true, ownership: "owned", stack: { name: "app-prod-search", status: "CREATE_COMPLETE", healthy: true } }],
|
|
141
|
+
]);
|
|
142
|
+
const rows = reconcileStatus("prod", [record()], { liveEvidence });
|
|
143
|
+
expect(rows[0].live).toBe(true);
|
|
144
|
+
expect(rows[0].stack).toEqual({ name: "app-prod-search", status: "CREATE_COMPLETE", healthy: true });
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
test("live is false (never undefined) under --live when a component's stack is absent", () => {
|
|
148
|
+
const liveEvidence = new Map<string, LiveComponentEvidence>([
|
|
149
|
+
["search-service", { live: false }],
|
|
150
|
+
]);
|
|
151
|
+
const rows = reconcileStatus("prod", [record()], { liveEvidence });
|
|
152
|
+
expect(rows[0].live).toBe(false);
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
test("live is absent (not queried) when no liveEvidence is passed", () => {
|
|
156
|
+
const rows = reconcileStatus("prod", [record()]);
|
|
157
|
+
expect(rows[0].live).toBeUndefined();
|
|
158
|
+
expect(rows[0].stack).toBeUndefined();
|
|
159
|
+
});
|
|
160
|
+
|
|
138
161
|
test("recorded but nothing live -> stale", () => {
|
|
139
162
|
const liveEvidence = new Map<string, LiveComponentEvidence>();
|
|
140
163
|
const rows = reconcileStatus("prod", [record()], { liveEvidence });
|
package/src/lifecycle/status.ts
CHANGED
|
@@ -60,6 +60,29 @@ export interface ComponentStatusRow {
|
|
|
60
60
|
reconciliation: "reconciled" | "unrecorded" | "stale" | "drifted" | "unknown";
|
|
61
61
|
/** Human-readable detail backing the verdict. */
|
|
62
62
|
detail: string;
|
|
63
|
+
/**
|
|
64
|
+
* Machine-readable "observed live", when live evidence was gathered (`--live`).
|
|
65
|
+
* A consumer joining this row onto a graph node should read this rather than
|
|
66
|
+
* string-matching `detail`. Absent when `--live` was not requested.
|
|
67
|
+
*/
|
|
68
|
+
live?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* The owning deploy unit's raw status, when a lexicon reported it (AWS: the
|
|
71
|
+
* component's own CFN stack via `describeStackStatus`). Lets a renderer paint a
|
|
72
|
+
* richer palette than the reconciliation verdict — `healthy` green,
|
|
73
|
+
* present-but-not-healthy amber (mid-deploy) / red (rollback/failed).
|
|
74
|
+
*/
|
|
75
|
+
stack?: LiveStackInfo;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** A component's owning deploy unit and its provider-native status. */
|
|
79
|
+
export interface LiveStackInfo {
|
|
80
|
+
/** The deploy-unit name (e.g. the CloudFormation stack name). */
|
|
81
|
+
name: string;
|
|
82
|
+
/** Provider-native status string, e.g. "CREATE_COMPLETE". */
|
|
83
|
+
status?: string;
|
|
84
|
+
/** True when `status` is a terminal success state. */
|
|
85
|
+
healthy?: boolean;
|
|
63
86
|
}
|
|
64
87
|
|
|
65
88
|
export interface ComponentStatusResult {
|
|
@@ -84,6 +107,9 @@ export interface LiveComponentEvidence {
|
|
|
84
107
|
action?: ChangeAction;
|
|
85
108
|
/** Ownership verdict, when known. */
|
|
86
109
|
ownership?: "owned" | "foreign" | "unknown";
|
|
110
|
+
/** The owning deploy unit's raw status, when observed (AWS: the component's own
|
|
111
|
+
* CFN stack). Surfaced onto `ComponentStatusRow.stack` for a richer palette. */
|
|
112
|
+
stack?: LiveStackInfo;
|
|
87
113
|
}
|
|
88
114
|
|
|
89
115
|
/**
|
|
@@ -108,6 +134,7 @@ export function mergeLiveEvidence(
|
|
|
108
134
|
live: sup.live,
|
|
109
135
|
ownership: sup.ownership ?? b?.ownership,
|
|
110
136
|
action: b?.action,
|
|
137
|
+
stack: sup.stack ?? b?.stack,
|
|
111
138
|
});
|
|
112
139
|
}
|
|
113
140
|
return merged;
|
|
@@ -265,7 +292,17 @@ export function reconcileStatus(
|
|
|
265
292
|
detail = `recorded ${recorded!.timestamp} (digest ${recorded!.digest}), live and consistent`;
|
|
266
293
|
}
|
|
267
294
|
|
|
268
|
-
rows.push({
|
|
295
|
+
rows.push({
|
|
296
|
+
component,
|
|
297
|
+
env,
|
|
298
|
+
recorded,
|
|
299
|
+
build,
|
|
300
|
+
componentBom,
|
|
301
|
+
reconciliation,
|
|
302
|
+
detail,
|
|
303
|
+
...(liveEvidence ? { live: !!evidence?.live } : {}),
|
|
304
|
+
...(evidence?.stack ? { stack: evidence.stack } : {}),
|
|
305
|
+
});
|
|
269
306
|
}
|
|
270
307
|
|
|
271
308
|
return rows;
|