@intentius/terragucci 0.4.6 → 0.4.8
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/dist/notify.schema.json +62 -56
- package/dist/run.schema.json +1 -1
- package/dist/terragucci.mjs +698 -623
- package/dist/terragucci.mjs.map +4 -4
- package/dist/terragucci.schema.json +64 -6
- package/dist/types.d.ts +41 -4
- package/package.json +6 -6
|
@@ -57,10 +57,11 @@
|
|
|
57
57
|
"gate": {
|
|
58
58
|
"enum": [
|
|
59
59
|
"always",
|
|
60
|
-
"on-
|
|
61
|
-
"never"
|
|
60
|
+
"on-destructive",
|
|
61
|
+
"never",
|
|
62
|
+
"on-destroy"
|
|
62
63
|
],
|
|
63
|
-
"description": "When a wave waits for an approval."
|
|
64
|
+
"description": "When a wave waits for an approval. on-destroy is an older name for on-destructive."
|
|
64
65
|
},
|
|
65
66
|
"approval": {
|
|
66
67
|
"enum": [
|
|
@@ -121,6 +122,10 @@
|
|
|
121
122
|
"pattern": "^[^\\s,;=']+$"
|
|
122
123
|
}
|
|
123
124
|
}
|
|
125
|
+
},
|
|
126
|
+
"point": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
124
129
|
}
|
|
125
130
|
},
|
|
126
131
|
"additionalProperties": false,
|
|
@@ -986,6 +991,30 @@
|
|
|
986
991
|
"additionalProperties": false,
|
|
987
992
|
"description": "Policy checks over each plan."
|
|
988
993
|
},
|
|
994
|
+
"sources": {
|
|
995
|
+
"type": "object",
|
|
996
|
+
"properties": {
|
|
997
|
+
"modules": {
|
|
998
|
+
"type": "array",
|
|
999
|
+
"minItems": 1,
|
|
1000
|
+
"items": {
|
|
1001
|
+
"type": "string",
|
|
1002
|
+
"pattern": "^[^\\s,;'\"]+$"
|
|
1003
|
+
}
|
|
1004
|
+
},
|
|
1005
|
+
"providers": {
|
|
1006
|
+
"type": "array",
|
|
1007
|
+
"minItems": 1,
|
|
1008
|
+
"items": {
|
|
1009
|
+
"type": "string",
|
|
1010
|
+
"pattern": "^[^\\s,;'\"]+$"
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
},
|
|
1014
|
+
"additionalProperties": false,
|
|
1015
|
+
"minProperties": 1,
|
|
1016
|
+
"description": "Globs of the module sources and provider addresses a root may use, checked before init."
|
|
1017
|
+
},
|
|
989
1018
|
"atlantis_comments": {
|
|
990
1019
|
"type": "boolean",
|
|
991
1020
|
"description": "Read atlantis plan and atlantis apply comments as terragucci's."
|
|
@@ -1445,10 +1474,11 @@
|
|
|
1445
1474
|
"gate": {
|
|
1446
1475
|
"enum": [
|
|
1447
1476
|
"always",
|
|
1448
|
-
"on-
|
|
1449
|
-
"never"
|
|
1477
|
+
"on-destructive",
|
|
1478
|
+
"never",
|
|
1479
|
+
"on-destroy"
|
|
1450
1480
|
],
|
|
1451
|
-
"description": "When a wave waits for an approval."
|
|
1481
|
+
"description": "When a wave waits for an approval. on-destroy is an older name for on-destructive."
|
|
1452
1482
|
},
|
|
1453
1483
|
"approval": {
|
|
1454
1484
|
"enum": [
|
|
@@ -1509,6 +1539,10 @@
|
|
|
1509
1539
|
"pattern": "^[^\\s,;=']+$"
|
|
1510
1540
|
}
|
|
1511
1541
|
}
|
|
1542
|
+
},
|
|
1543
|
+
"point": {
|
|
1544
|
+
"type": "string",
|
|
1545
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
1512
1546
|
}
|
|
1513
1547
|
},
|
|
1514
1548
|
"additionalProperties": false,
|
|
@@ -2366,6 +2400,30 @@
|
|
|
2366
2400
|
"additionalProperties": false,
|
|
2367
2401
|
"description": "Policy checks over each plan."
|
|
2368
2402
|
},
|
|
2403
|
+
"sources": {
|
|
2404
|
+
"type": "object",
|
|
2405
|
+
"properties": {
|
|
2406
|
+
"modules": {
|
|
2407
|
+
"type": "array",
|
|
2408
|
+
"minItems": 1,
|
|
2409
|
+
"items": {
|
|
2410
|
+
"type": "string",
|
|
2411
|
+
"pattern": "^[^\\s,;'\"]+$"
|
|
2412
|
+
}
|
|
2413
|
+
},
|
|
2414
|
+
"providers": {
|
|
2415
|
+
"type": "array",
|
|
2416
|
+
"minItems": 1,
|
|
2417
|
+
"items": {
|
|
2418
|
+
"type": "string",
|
|
2419
|
+
"pattern": "^[^\\s,;'\"]+$"
|
|
2420
|
+
}
|
|
2421
|
+
}
|
|
2422
|
+
},
|
|
2423
|
+
"additionalProperties": false,
|
|
2424
|
+
"minProperties": 1,
|
|
2425
|
+
"description": "Globs of the module sources and provider addresses a root may use, checked before init."
|
|
2426
|
+
},
|
|
2369
2427
|
"atlantis_comments": {
|
|
2370
2428
|
"type": "boolean",
|
|
2371
2429
|
"description": "Read atlantis plan and atlantis apply comments as terragucci's."
|
package/dist/types.d.ts
CHANGED
|
@@ -2,7 +2,15 @@ import { type GenerateSettings } from "./generate-config";
|
|
|
2
2
|
export { ROOTS_NOT_ATMOS, ROOTS_NOT_TERRAGRUNT, SYNTH_DRIFT_PR, SYNTH_DRIFT_PR_SHORT, SYNTH_GENERATE, SYNTH_ROLLOUTS } from "./refusals";
|
|
3
3
|
export declare const BINARIES: readonly ["terraform", "tofu", "choudoufu"];
|
|
4
4
|
export declare const FORGES: readonly ["github", "gitlab", "forgejo"];
|
|
5
|
-
export declare const GATES: readonly ["always", "on-
|
|
5
|
+
export declare const GATES: readonly ["always", "on-destructive", "never"];
|
|
6
|
+
/** Older spellings of a gate policy, still accepted from terragucci.yml and --gate: `on-destroy` is `on-destructive`. */
|
|
7
|
+
export declare const GATE_ALIASES: {
|
|
8
|
+
readonly "on-destroy": "on-destructive";
|
|
9
|
+
};
|
|
10
|
+
/** Every gate name terragucci accepts: the policies and their older spellings. */
|
|
11
|
+
export declare const GATE_NAMES: readonly GateName[];
|
|
12
|
+
/** The policy a gate name means, or undefined when it names none. */
|
|
13
|
+
export declare function normalizeGate(v: unknown): Gate | undefined;
|
|
6
14
|
/**
|
|
7
15
|
* What counts as the approval of a waiting wave (`approval:`). `ledger` (the
|
|
8
16
|
* default): any `chant approve` of the wave's set digest on chant/lifecycle,
|
|
@@ -43,6 +51,8 @@ export declare const APPLY_REQUIRES: readonly ["approved", "mergeable", "undiver
|
|
|
43
51
|
export type Binary = (typeof BINARIES)[number];
|
|
44
52
|
export type ForgeName = (typeof FORGES)[number];
|
|
45
53
|
export type Gate = (typeof GATES)[number];
|
|
54
|
+
/** A gate as terragucci.yml or --gate may spell it: a policy, or an older name for one. */
|
|
55
|
+
export type GateName = Gate | keyof typeof GATE_ALIASES;
|
|
46
56
|
export type Approval = (typeof APPROVALS)[number];
|
|
47
57
|
/**
|
|
48
58
|
* `gitlab.token`: how a GitLab project keeps its forge token. `unprotected`
|
|
@@ -120,6 +130,14 @@ export interface ApplySettings {
|
|
|
120
130
|
* here matches. Plain roots only, with `when: merge`.
|
|
121
131
|
*/
|
|
122
132
|
branches?: Record<string, string[]>;
|
|
133
|
+
/**
|
|
134
|
+
* The workspace decision point every wave gate asks instead of waiting for
|
|
135
|
+
* `terragucci approve` (chant's "A gate that asks a decision point"). The
|
|
136
|
+
* point declares `gate.planDigest`, so each plan is its own question, and
|
|
137
|
+
* its deciders and quorum decide. Read at base, like `approval:`, which
|
|
138
|
+
* stays `ledger`.
|
|
139
|
+
*/
|
|
140
|
+
point?: string;
|
|
123
141
|
}
|
|
124
142
|
/**
|
|
125
143
|
* Policy as code, off unless set. `tf-plan` runs the engine over each planned
|
|
@@ -352,8 +370,8 @@ export interface ProjectSettings {
|
|
|
352
370
|
forge?: ForgeName;
|
|
353
371
|
/** Where the project lives, for a forge not on https or the default port. */
|
|
354
372
|
url?: string;
|
|
355
|
-
/** When a wave waits for an approval. */
|
|
356
|
-
gate?:
|
|
373
|
+
/** When a wave waits for an approval. A loaded config holds the policy's current name: on-destroy reads as on-destructive. */
|
|
374
|
+
gate?: GateName;
|
|
357
375
|
/** What counts as a waiting wave's approval; see APPROVALS. Read from the config at base, never the applied commit's own. */
|
|
358
376
|
approval?: Approval;
|
|
359
377
|
/** When a change applies; see ApplySettings. */
|
|
@@ -490,6 +508,8 @@ export interface ProjectSettings {
|
|
|
490
508
|
atmos?: AtmosSettings;
|
|
491
509
|
/** Opt-in policy checks over each plan; see PolicySettings. */
|
|
492
510
|
policy?: PolicySettings;
|
|
511
|
+
/** The module and provider sources a root may use, checked before init; see SourcesSettings. Off when absent. */
|
|
512
|
+
sources?: SourcesSettings;
|
|
493
513
|
/**
|
|
494
514
|
* `atlantis plan` and `atlantis apply` comments read as `/terragucci plan`
|
|
495
515
|
* and `/terragucci apply`. Off by default. The alias changes the words
|
|
@@ -612,7 +632,7 @@ export declare const BUILT_IN: ResolvedSettings;
|
|
|
612
632
|
* own clone URL and `rollouts` belongs to a single repo, so `defaults`
|
|
613
633
|
* refuses both.
|
|
614
634
|
*/
|
|
615
|
-
export declare const PROJECT_FILE_KEYS: readonly ["policy", "reports", "approval", "gate", "roots", "waves", "parallelism", "synth", "steps", "drift", "cost", "tips", "runtime", "telemetry", "respond", "review", "decide", "audit_region", "modules", "terragrunt", "token_env", "generate", "ephemeral"];
|
|
635
|
+
export declare const PROJECT_FILE_KEYS: readonly ["policy", "sources", "reports", "approval", "gate", "roots", "waves", "parallelism", "synth", "steps", "drift", "cost", "tips", "runtime", "telemetry", "respond", "review", "decide", "audit_region", "modules", "terragrunt", "token_env", "generate", "ephemeral"];
|
|
616
636
|
export declare class ConfigError extends Error {
|
|
617
637
|
/** Every problem found, when the error is a validation failure. */
|
|
618
638
|
readonly problems?: string[];
|
|
@@ -629,6 +649,9 @@ export declare const RELEASE_VERSION: RegExp;
|
|
|
629
649
|
/** The settings of `notify`, `policy`, `oidc`, `telemetry`, `gitlab`, `cost`, `pass` and `agent`. */
|
|
630
650
|
export declare const NOTIFY_KEYS: string[];
|
|
631
651
|
export declare const POLICY_KEYS: string[];
|
|
652
|
+
export declare const SOURCES_KEYS: string[];
|
|
653
|
+
/** One `sources` entry: a glob with no whitespace, commas, semicolons or quotes. */
|
|
654
|
+
export declare const SOURCE_GLOB = "^[^\\s,;'\"]+$";
|
|
632
655
|
export declare const OIDC_KEYS: string[];
|
|
633
656
|
export declare const TELEMETRY_KEYS: string[];
|
|
634
657
|
export declare const TOKEN_PROTECTION_KEYS: string[];
|
|
@@ -666,6 +689,18 @@ export interface ModulesSettings {
|
|
|
666
689
|
/** Write each release as the Terraform module registry protocol, as static files a bucket or a Pages site serves. */
|
|
667
690
|
registry?: RegistrySettings;
|
|
668
691
|
}
|
|
692
|
+
/**
|
|
693
|
+
* `sources`: the module and provider sources a root may use (./sources.ts).
|
|
694
|
+
* A list that is set refuses every source of its kind that no glob in it
|
|
695
|
+
* matches, before `init` downloads anything; a list that is not set checks
|
|
696
|
+
* nothing of its kind. Read at base, as `policy` is.
|
|
697
|
+
*/
|
|
698
|
+
export interface SourcesSettings {
|
|
699
|
+
/** Globs of module sources, as written and without their `?` query, such as `./**` for local paths. */
|
|
700
|
+
modules?: string[];
|
|
701
|
+
/** Globs of provider addresses, such as `hashicorp/*` or `registry.example.com/acme/*`. */
|
|
702
|
+
providers?: string[];
|
|
703
|
+
}
|
|
669
704
|
/** `modules.registry`: the module registry protocol as static files. */
|
|
670
705
|
export interface RegistrySettings {
|
|
671
706
|
/** The bucket the files go to: `s3://<bucket>`, `gs://<bucket>` or `az://<account>/<container>`. */
|
|
@@ -733,6 +768,8 @@ export declare const OWN_JOB_NAME: RegExp;
|
|
|
733
768
|
export declare function ownJobsProblems(v: unknown, where: string): string[];
|
|
734
769
|
export declare const EPHEMERAL_KEYS: string[];
|
|
735
770
|
export declare const APPLY_KEYS: string[];
|
|
771
|
+
/** A decision point's name, as chant's points file declares it. */
|
|
772
|
+
export declare const POINT_NAME: RegExp;
|
|
736
773
|
/** A branch name `apply.branches` may name: what a forge's rule and the job's shell both take as it is. */
|
|
737
774
|
export declare const APPLY_BRANCH: RegExp;
|
|
738
775
|
/** Why `apply.branches` is refused with `apply.when: pull-request`. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/terragucci",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"description": "The whole Terraform lifecycle, handled: one config file, generated pipelines for GitHub, GitLab and Forgejo.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"build": "node ../../scripts/build-cli.mjs"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@intentius/chant": "0.
|
|
37
|
+
"@intentius/chant": "0.124.18"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@intentius/tsad-reference": "2.x",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@cdktn/hcl2json": "0.24.0",
|
|
53
|
-
"@intentius/chant-lexicon-forgejo": "0.
|
|
54
|
-
"@intentius/chant-lexicon-github": "0.
|
|
55
|
-
"@intentius/chant-lexicon-gitlab": "0.
|
|
56
|
-
"@intentius/chant-lexicon-terraform": "0.
|
|
53
|
+
"@intentius/chant-lexicon-forgejo": "0.124.18",
|
|
54
|
+
"@intentius/chant-lexicon-github": "0.124.18",
|
|
55
|
+
"@intentius/chant-lexicon-gitlab": "0.124.18",
|
|
56
|
+
"@intentius/chant-lexicon-terraform": "0.124.18",
|
|
57
57
|
"@intentius/tsad-reference": "2.1.0",
|
|
58
58
|
"@modelcontextprotocol/sdk": "1.30.1"
|
|
59
59
|
}
|