cdk-real-drift 0.12.48 → 0.12.49

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/README.md CHANGED
@@ -670,14 +670,19 @@ If the whole invocation fails before any stack is reached (bad config, an
670
670
  un-synthesizable app, or a zero-stack app), stdout is still a valid empty array
671
671
  `[]` (exit code non-zero, the reason on stderr) — never empty bytes.
672
672
 
673
- Every successfully-checked stack element carries a `"baseline": <bool>` flag —
673
+ Every successfully-checked stack element of a baseline-consulting `check` carries a
674
+ `"baseline": <bool>` flag —
674
675
  `true` when the stack has a committed `.cdkrd` baseline (its undeclared dimension is
675
676
  **watched**), `false` when it has never been recorded. Without a baseline the
676
677
  classification shifts: appeared-since-record out-of-band values read as `unrecorded`
677
678
  and are excluded from `drifted`, so a QUIET never-recorded stack emits the
678
679
  byte-identical `"drifted": 0` of a watched-clean one. A consumer summing `drifted`
679
680
  uses `baseline` to tell an UNWATCHED stack from a watched-clean one (#1095). It is
680
- omitted on the `error` / `stackDeleted` shapes (never reconciled against a baseline).
681
+ omitted whenever the baseline was **not consulted**: on the `error` / `stackDeleted`
682
+ shapes (never reconciled against a baseline), and on every element of a
683
+ `--pre-deploy` or `--show-all` run (both are baseline-untouched modes, so they
684
+ cannot claim `false` — a committed baseline may well exist; #1335). Absent means
685
+ "not consulted"; `false` means "consulted, never recorded".
681
686
 
682
687
  Each stack element is `{ "stack": "<name> (<region>)", "drifted": <n>, "baseline": <bool>, "findings": [...] }`
683
688
  (`error` added only on a pre-check failure; `stackDeleted: true` only on a deleted
@@ -737,9 +742,10 @@ mode: a `record` / `ignore` that would need the selection prompt refuses without
737
742
  `--yes` (`"refused": true`), and `revert` refuses the AWS write without `--yes`
738
743
  (`"exit": 2`). Per-verb element:
739
744
 
740
- - `record` → `{ "stack", "recorded": <n>, "wrote": <bool>, "baseline"?: "<path>",
745
+ - `record` → `{ "stack", "recorded": <n>, "wrote": <bool>, "baselinePath"?: "<path>",
741
746
  "refused"?: true, "error"?: "<reason>" }` — `recorded` is how many undeclared
742
- value(s) were written.
747
+ value(s) were written; `baselinePath` is the baseline file written (a path string,
748
+ deliberately NOT named `baseline` — that key is check's boolean flag; #1336).
743
749
  - `ignore` → `{ "stack", "added": <n>, "wrote": <bool>, "config"?:
744
750
  ".cdkrd/ignore.yaml", "refused"?: true, "error"?: "<reason>" }` — `added` is how
745
751
  many new rules were appended.
package/dist/cli.js CHANGED
@@ -13811,7 +13811,7 @@ function buildStackJson(rawFindings, header, hasBaseline) {
13811
13811
  stack: header,
13812
13812
  drifted,
13813
13813
  findings: findings.map((f) => redactFinding(f)),
13814
- baseline: hasBaseline === true
13814
+ ...hasBaseline === void 0 ? {} : { baseline: hasBaseline }
13815
13815
  },
13816
13816
  code: drifted === 0 ? 0 : 1
13817
13817
  };
@@ -17689,7 +17689,7 @@ async function runRecord(args) {
17689
17689
  recorded: result.count ?? 0,
17690
17690
  wrote: result.wrote,
17691
17691
  ...result.refused && { refused: true },
17692
- ...result.path !== void 0 && { baseline: result.path }
17692
+ ...result.path !== void 0 && { baselinePath: result.path }
17693
17693
  });
17694
17694
  } catch (e) {
17695
17695
  if (isStackNotDeployed(e)) {
@@ -18729,7 +18729,7 @@ async function runCheck(args) {
18729
18729
  const reportHeader = `${posPrefix}${stackName} (${region})`;
18730
18730
  let code;
18731
18731
  if (a.json) {
18732
- const { json, code: jsonCode } = buildStackJson(reconciled, reportHeader, baseline !== void 0);
18732
+ const { json, code: jsonCode } = buildStackJson(reconciled, reportHeader, a.showAll ? void 0 : baseline !== void 0);
18733
18733
  jsonReports.push(json);
18734
18734
  code = jsonCode;
18735
18735
  } else code = report(reconciled, reportHeader, {