@intentius/chant 0.18.32 → 0.18.34
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":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/lifecycle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/lifecycle.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAgDlD;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAqF/E;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAoC3E;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAuB/E;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAyF3E;AA4TD;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsI3E;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiB1E;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAM9E;AAkBD;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA+C/E"}
|
package/dist/graph-ir.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,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OAAO,CAUvE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAgC7E"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant",
|
|
3
|
-
"version": "0.18.
|
|
4
|
-
"description": "Declarative infrastructure-as-code toolkit
|
|
3
|
+
"version": "0.18.34",
|
|
4
|
+
"description": "Declarative infrastructure-as-code toolkit — TypeScript on Node.js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://intentius.io/chant",
|
|
7
7
|
"repository": {
|
|
@@ -5,6 +5,8 @@ import { readSnapshot, readSnapshotAt, readEnvironmentSnapshots, listSnapshots,
|
|
|
5
5
|
import { computeBuildDigest, diffDigests } from "../../lifecycle/digest";
|
|
6
6
|
import { diffLive, diffLiveArtifacts, diffSnapshots, type LiveDiffResult, type LiveArtifactDiffResult, type SnapshotDiffResult } from "../../lifecycle/live-diff";
|
|
7
7
|
import { buildChangeSet, renderChangeSet, gitlabMrReport, type ChangeSet } from "../../lifecycle/change-set";
|
|
8
|
+
import { discoverComponents } from "../../components/discover";
|
|
9
|
+
import { cfnDeployStacks } from "./components";
|
|
8
10
|
import { affectedStacks } from "../../lifecycle/affected";
|
|
9
11
|
import { rollbackToRevision } from "../../lifecycle/rollback";
|
|
10
12
|
import { loadChantConfig } from "../../config";
|
|
@@ -661,6 +663,21 @@ export async function runLifecyclePlan(ctx: CommandContext): Promise<number> {
|
|
|
661
663
|
|
|
662
664
|
const lexicons = lexiconFilter ? [lexiconFilter] : Array.from(buildResult.manifest.lexicons);
|
|
663
665
|
|
|
666
|
+
// Multi-stack component projects deploy one CFN stack per component, so the
|
|
667
|
+
// single-stack-per-env observe below would see nothing live and plan every
|
|
668
|
+
// resource as "create". Resolve each component's cfn-deploy stack(s) and
|
|
669
|
+
// observe them all — the same fix runGraphLive uses (graph.ts). Empty for a
|
|
670
|
+
// single-stack project → the original single-call path is kept.
|
|
671
|
+
let componentStacks: string[] = [];
|
|
672
|
+
try {
|
|
673
|
+
const disc = await discoverComponents(resolveBuildRoot(args, config));
|
|
674
|
+
const set = new Set<string>();
|
|
675
|
+
for (const { component } of disc.components.values()) for (const s of cfnDeployStacks(component.deploy)) set.add(s);
|
|
676
|
+
componentStacks = [...set];
|
|
677
|
+
} catch {
|
|
678
|
+
// no components / discovery failed → single-stack path
|
|
679
|
+
}
|
|
680
|
+
|
|
664
681
|
const merged: ChangeSet = { env: environment, entries: [] };
|
|
665
682
|
let checked = 0;
|
|
666
683
|
|
|
@@ -697,15 +714,25 @@ export async function runLifecyclePlan(ctx: CommandContext): Promise<number> {
|
|
|
697
714
|
? rawOutput
|
|
698
715
|
: (rawOutput as SerializerResult).primary;
|
|
699
716
|
|
|
700
|
-
let observedNow: Record<string, ResourceMetadata
|
|
717
|
+
let observedNow: Record<string, ResourceMetadata> = {};
|
|
701
718
|
try {
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
719
|
+
if (componentStacks.length > 0) {
|
|
720
|
+
// Observe each component's own stack and union — the multi-stack fix.
|
|
721
|
+
for (const stack of componentStacks) {
|
|
722
|
+
Object.assign(
|
|
723
|
+
observedNow,
|
|
724
|
+
await plugin.describeResources({ environment, buildOutput, entityNames: Array.from(declared), entities, stack, owned: args.owned }),
|
|
725
|
+
);
|
|
726
|
+
}
|
|
727
|
+
} else {
|
|
728
|
+
observedNow = await plugin.describeResources({
|
|
729
|
+
environment,
|
|
730
|
+
buildOutput,
|
|
731
|
+
entityNames: Array.from(declared),
|
|
732
|
+
entities,
|
|
733
|
+
owned: args.owned,
|
|
734
|
+
});
|
|
735
|
+
}
|
|
709
736
|
} catch (err) {
|
|
710
737
|
console.error(formatError({
|
|
711
738
|
message: `${lexiconName}: describeResources failed — ${err instanceof Error ? err.message : String(err)}`,
|
package/src/graph-ir.test.ts
CHANGED
|
@@ -78,6 +78,33 @@ describe("buildGraphIr", () => {
|
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
80
|
|
|
81
|
+
test("follows a ref nested inside a property-kind declarable (a listener's forward action)", () => {
|
|
82
|
+
// Regression: an inlined property-kind declarable (e.g. a Listener Action)
|
|
83
|
+
// keeps its config in the NON-enumerable `props` bag. collectEdges used to
|
|
84
|
+
// recurse with Object.values(), which skips `props`, so a ref buried in
|
|
85
|
+
// `DefaultActions: [Action{ TargetGroupArn: tg.TargetGroupArn }]` produced
|
|
86
|
+
// NO edge — the target group floated even though it deploys wired.
|
|
87
|
+
const tg = decl({ lexicon: "aws", entityType: "AWS::ElasticLoadBalancingV2::TargetGroup" });
|
|
88
|
+
const action = decl({
|
|
89
|
+
lexicon: "aws",
|
|
90
|
+
entityType: "AWS::ElasticLoadBalancingV2::Listener.Action",
|
|
91
|
+
props: { Type: "forward", TargetGroupArn: new AttrRef(tg, "TargetGroupArn") },
|
|
92
|
+
});
|
|
93
|
+
const listener = decl({
|
|
94
|
+
lexicon: "aws",
|
|
95
|
+
entityType: "AWS::ElasticLoadBalancingV2::Listener",
|
|
96
|
+
props: { DefaultActions: [action] },
|
|
97
|
+
});
|
|
98
|
+
const entities = new Map<string, Declarable>([
|
|
99
|
+
["tg", tg],
|
|
100
|
+
["listener", listener],
|
|
101
|
+
]);
|
|
102
|
+
resolveAttrRefs(entities);
|
|
103
|
+
|
|
104
|
+
const ir = buildGraphIr(entities);
|
|
105
|
+
expect(ir.edges).toContainEqual({ from: "listener", to: "tg", kind: "ref", viaAttr: "DefaultActions" });
|
|
106
|
+
});
|
|
107
|
+
|
|
81
108
|
test("treats a foreign AttrRef (different @intentius/chant copy) as a ref, not an opaque intrinsic (#511)", () => {
|
|
82
109
|
// A lexicon built against a *separate* copy of chant produces AttrRefs that
|
|
83
110
|
// fail `instanceof AttrRef` here but carry the global-symbol brand + shape.
|
package/src/graph-ir.ts
CHANGED
|
@@ -287,6 +287,16 @@ function collectEdges(
|
|
|
287
287
|
}
|
|
288
288
|
if (seen.has(value)) return;
|
|
289
289
|
seen.add(value);
|
|
290
|
+
// A nested declarable (an inlined property-kind resource, e.g. a listener's
|
|
291
|
+
// `DefaultActions: [Listener_Action{ TargetGroupArn: tg.TargetGroupArn }]`)
|
|
292
|
+
// keeps its config in a NON-enumerable `props` bag, so `Object.values`
|
|
293
|
+
// below would walk right past the ref inside it and drop the edge. Descend
|
|
294
|
+
// via `configRoots` (which reads `props`), mirroring `project`'s handling —
|
|
295
|
+
// the ref then resolves to a real from→to edge on the containing node.
|
|
296
|
+
if (isDeclarable(value)) {
|
|
297
|
+
for (const [, v] of configRoots(value)) visit(v, viaAttr);
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
290
300
|
if (Array.isArray(value)) {
|
|
291
301
|
for (const item of value) visit(item, viaAttr);
|
|
292
302
|
return;
|