cdk-real-drift 0.12.109 → 0.13.0
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 +9 -1
- package/dist/cli.js +17 -4
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -355,6 +355,13 @@ CI (with `--yes`).
|
|
|
355
355
|
the flag).
|
|
356
356
|
- **`--fail`** (the `cdk diff --fail` / `cdk drift --fail` convention) exits `1` on
|
|
357
357
|
drift and suppresses all prompts. It's the one flag for scripts and CI.
|
|
358
|
+
- **`--no-prompt`** is the **prompt** axis, orthogonal to `--fail`'s exit-code axis:
|
|
359
|
+
it suppresses the interactive resolve menu (report-only) but keeps exit `0` on
|
|
360
|
+
drift. Reach for it when a script runs `check` **attached to a terminal** (both
|
|
361
|
+
stdin+stdout are a TTY, so the TTY gate alone would still prompt and could hang)
|
|
362
|
+
yet must not fail the job on drift. A non-TTY run (real CI, a pipe, redirected
|
|
363
|
+
output) never prompts anyway, so this only matters for the terminal-attached case;
|
|
364
|
+
combined with `--fail`, `--fail`'s exit `1` wins.
|
|
358
365
|
- **`--strict`** is the orthogonal **coverage** axis: it exits `1` when a run was
|
|
359
366
|
incomplete (a resource skipped for an ACTIONABLE reason — a CC-unsupported type
|
|
360
367
|
with no override, a read error / throttle / AccessDenied — or a nested stack not
|
|
@@ -401,6 +408,7 @@ CI (with `--yes`).
|
|
|
401
408
|
| `--all` | target every stack the app defines (the default when no `<stack>` is named; cannot be combined with named stacks — a `<stack> ... --all` invocation errors) |
|
|
402
409
|
| `--json` | machine-readable output (see [JSON contract](#json-output-contract)) |
|
|
403
410
|
| `--fail` | (check) exit 1 on drift and never prompt; for scripts/CI. Without it, check reports drift but exits 0 |
|
|
411
|
+
| `--no-prompt` | (check) never open the interactive resolve menu (report-only), but keep exit 0 on drift — the exit-0 twin of `--fail`'s prompt suppression, for a report-only script attached to a terminal. Non-TTY never prompts anyway; with `--fail`, `--fail`'s exit 1 wins |
|
|
404
412
|
| `--strict` | (check) exit 1 when coverage is incomplete. A coverage gap is always surfaced loudly; `--strict` makes it CI-failing. Orthogonal to `--fail` |
|
|
405
413
|
| `--show-all` | (check) inventory mode: show all current undeclared state, ignoring the baseline |
|
|
406
414
|
| `--verbose` / `-v` | (check) expand the `info:` footer tiers / (revert) expand the not-revertable summary to full lists; (record) itemizes nested sub-keys in the multiselect. `-v` means `--verbose` **inside a verb** (`check -v`); a bare `cdkrd -v` (no verb) prints the version |
|
|
@@ -422,7 +430,7 @@ error (they select which comparison runs, so a combination is contradictory).
|
|
|
422
430
|
### Interactive prompts (TTY only, CI is never prompted)
|
|
423
431
|
|
|
424
432
|
Every option runs exactly the same code as the standalone commands. Prompts are
|
|
425
|
-
skipped under `--json`, `--show-all`, `--pre-deploy`, `--fail`, `--yes`, and the
|
|
433
|
+
skipped under `--json`, `--show-all`, `--pre-deploy`, `--fail`, `--no-prompt`, `--yes`, and the
|
|
426
434
|
scope filters `--declared-only` / `--undeclared-only` (a filtered finding set must
|
|
427
435
|
never become a snapshot-complete baseline via the inline Record — use the standalone
|
|
428
436
|
`record` verb, which sees the unfiltered state, #779). A non-TTY run
|
package/dist/cli.js
CHANGED
|
@@ -287,6 +287,7 @@ const VALUE_FLAGS = new Set([
|
|
|
287
287
|
const BOOLEAN_FLAGS = new Set([
|
|
288
288
|
"--json",
|
|
289
289
|
"--fail",
|
|
290
|
+
"--no-prompt",
|
|
290
291
|
"--show-all",
|
|
291
292
|
"--yes",
|
|
292
293
|
"-y",
|
|
@@ -321,6 +322,7 @@ const ALLOWED_FLAGS_BY_VERB = {
|
|
|
321
322
|
check: new Set([
|
|
322
323
|
...GLOBAL_FLAGS,
|
|
323
324
|
"--fail",
|
|
325
|
+
"--no-prompt",
|
|
324
326
|
"--strict",
|
|
325
327
|
"--show-all",
|
|
326
328
|
"--pre-deploy",
|
|
@@ -416,7 +418,7 @@ function parseCommonArgs(args, verb) {
|
|
|
416
418
|
].filter(has);
|
|
417
419
|
if (scopes.length > 1) throw new Error(`${scopes.join(" and ")} are mutually exclusive — see cdkrd --help`);
|
|
418
420
|
if (values["--profile"] !== void 0) process.env.CDKRD_EXPLICIT_PROFILE = "1";
|
|
419
|
-
|
|
421
|
+
const parsed = {
|
|
420
422
|
stackNames,
|
|
421
423
|
all: has("--all"),
|
|
422
424
|
context,
|
|
@@ -436,6 +438,8 @@ function parseCommonArgs(args, verb) {
|
|
|
436
438
|
verbose: has("--verbose") || has("-v"),
|
|
437
439
|
waitMs
|
|
438
440
|
};
|
|
441
|
+
parsed.noPrompt = has("--no-prompt");
|
|
442
|
+
return parsed;
|
|
439
443
|
}
|
|
440
444
|
|
|
441
445
|
//#endregion
|
|
@@ -20241,6 +20245,9 @@ function finalCheckExit(code, fail) {
|
|
|
20241
20245
|
* who can make the decision. It is gated OUT of every machine/automation mode:
|
|
20242
20246
|
* - --json / --show-all / --pre-deploy — machine output or baseline-untouched contracts,
|
|
20243
20247
|
* - --fail — the CI drift-exit path,
|
|
20248
|
+
* - --no-prompt — the exit-0 twin of --fail's suppression: force the run non-interactive
|
|
20249
|
+
* (report-only) even in a TTY, without failing CI on drift. Its whole job is this gate;
|
|
20250
|
+
* when it fires on a no-baseline stack the establish note below takes over (no hang).
|
|
20244
20251
|
* - #779: --declared-only / --undeclared-only — a SCOPE filter is active, so `findings`
|
|
20245
20252
|
* has been reduced to one tier (declared-only drops the whole undeclared/added/atDefault
|
|
20246
20253
|
* tier; undeclared-only drops declared plus its readGap/unresolved byproducts). The
|
|
@@ -20263,7 +20270,7 @@ function finalCheckExit(code, fail) {
|
|
|
20263
20270
|
* Pure + exported for tests.
|
|
20264
20271
|
*/
|
|
20265
20272
|
function shouldOfferInteractiveResolve(a, ctx) {
|
|
20266
|
-
return (ctx.code === 1 || ctx.hasUnrecorded || !ctx.hasBaseline) && !a.json && !a.showAll && !a.preDeploy && !a.fail && !a.yes && !a.declaredOnly && !a.undeclaredOnly && ctx.interactive;
|
|
20273
|
+
return (ctx.code === 1 || ctx.hasUnrecorded || !ctx.hasBaseline) && !a.json && !a.showAll && !a.preDeploy && !a.fail && !a.noPrompt && !a.yes && !a.declaredOnly && !a.undeclaredOnly && ctx.interactive;
|
|
20267
20274
|
}
|
|
20268
20275
|
/**
|
|
20269
20276
|
* #781: does a committed baseline exist for this stack IN THE REGION being checked?
|
|
@@ -20760,6 +20767,12 @@ OPTIONS
|
|
|
20760
20767
|
--fail (check) exit 1 on drift + never prompt — for
|
|
20761
20768
|
scripts/CI (same convention as \`cdk diff --fail\`);
|
|
20762
20769
|
without it, check REPORTS drift but exits 0
|
|
20770
|
+
--no-prompt (check) never open the interactive resolve menu —
|
|
20771
|
+
report only, exit 0 even on drift. The exit-0 twin of
|
|
20772
|
+
--fail's suppression, for a report-only script run
|
|
20773
|
+
ATTACHED to a terminal (where the TTY gate alone would
|
|
20774
|
+
still prompt and could hang). Non-TTY runs never prompt
|
|
20775
|
+
anyway; with --fail, --fail's exit-1 wins
|
|
20763
20776
|
--strict (check) exit 1 when coverage is INCOMPLETE — any
|
|
20764
20777
|
resource skipped (unread) or a nested stack not
|
|
20765
20778
|
recursed into. A loud coverage warning always prints;
|
|
@@ -20799,8 +20812,8 @@ OPTIONS
|
|
|
20799
20812
|
--help, -h --version, -v (bare \`cdkrd -v\` prints the version; inside a verb,
|
|
20800
20813
|
\`-v\` is the short alias for --verbose, e.g. check -v)
|
|
20801
20814
|
|
|
20802
|
-
Automation: check --fail
|
|
20803
|
-
--dry-run); non-TTY runs never prompt.
|
|
20815
|
+
Automation: check --fail (or --no-prompt for exit-0 report-only) / record --yes /
|
|
20816
|
+
ignore --yes / revert --yes (or --dry-run); non-TTY runs never prompt.
|
|
20804
20817
|
|
|
20805
20818
|
EXIT CODES
|
|
20806
20819
|
check: 0 = clean (or drift without --fail) 1 = drift (--fail) / incomplete coverage (--strict) 2 = error
|