@intentius/terragucci 0.4.2 → 0.4.3
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/audit.schema.json +34 -0
- package/dist/changes.schema.json +33 -0
- package/dist/estate.schema.json +162 -0
- package/dist/history.schema.json +49 -0
- package/dist/inventory.schema.json +38 -0
- package/dist/notify.schema.json +66 -0
- package/dist/report-index.schema.json +57 -0
- package/dist/report.schema.json +38 -0
- package/dist/terragucci.mjs +429 -364
- package/dist/terragucci.mjs.map +4 -4
- package/dist/types.d.ts +57 -7
- package/package.json +3 -2
package/dist/types.d.ts
CHANGED
|
@@ -78,6 +78,12 @@ export interface ApplySettings {
|
|
|
78
78
|
merge?: ApplyMerge;
|
|
79
79
|
merge_token_env?: string;
|
|
80
80
|
requires?: ApplyRequire[];
|
|
81
|
+
/**
|
|
82
|
+
* Minutes between runs of the resume job, which applies a waiting wave once
|
|
83
|
+
* an approval of its digest is on chant/lifecycle (resume.ts). Off when
|
|
84
|
+
* unset. 5 to 60.
|
|
85
|
+
*/
|
|
86
|
+
resume?: number;
|
|
81
87
|
}
|
|
82
88
|
/**
|
|
83
89
|
* Policy as code, off unless set. `tf-plan` runs the engine over each planned
|
|
@@ -169,6 +175,7 @@ export declare const RESPONSES: {
|
|
|
169
175
|
readonly tips: readonly ["pull-request", "off"];
|
|
170
176
|
readonly fmt: readonly ["commit", "off"];
|
|
171
177
|
readonly publish: readonly ["notes", "off"];
|
|
178
|
+
/** next-wave: with `rollouts:` set, init writes a job that runs `respond rollout` on that schedule, so a merged and applied wave's next one opens within one interval. off leaves the job out. */
|
|
172
179
|
readonly rollout: readonly ["next-wave", "off"];
|
|
173
180
|
readonly "version-bump": readonly ["off", "suggest"];
|
|
174
181
|
/** terragucci#30: a typed decision flags a pull request whose description leaves out what its plan destroys or replaces. Needs `decide:`. */
|
|
@@ -268,13 +275,16 @@ export interface ProjectSettings {
|
|
|
268
275
|
*/
|
|
269
276
|
synth?: string;
|
|
270
277
|
/**
|
|
271
|
-
*
|
|
272
|
-
* incoming webhook
|
|
273
|
-
*
|
|
278
|
+
* Notifications: the names of the secrets holding a Slack or Teams
|
|
279
|
+
* incoming webhook, and a generic webhook's address with the key that
|
|
280
|
+
* signs its body. An apply job whose wave waits, is refused or fails posts
|
|
281
|
+
* to each (notify.ts).
|
|
274
282
|
*/
|
|
275
283
|
notify?: {
|
|
276
284
|
slack?: string;
|
|
277
285
|
teams?: string;
|
|
286
|
+
webhook?: string;
|
|
287
|
+
webhook_key?: string;
|
|
278
288
|
};
|
|
279
289
|
/**
|
|
280
290
|
* Cost estimates per root in the plan note: Infracost on the customer's
|
|
@@ -288,6 +298,14 @@ export interface ProjectSettings {
|
|
|
288
298
|
* schedule (comment-gitlab.ts), since GitLab starts no pipeline for a note.
|
|
289
299
|
*/
|
|
290
300
|
comments?: string | false;
|
|
301
|
+
/**
|
|
302
|
+
* A cron schedule, or false: init writes a job that runs `terragucci respond
|
|
303
|
+
* rollout --mode apply` on it, which opens the next wave of every rollout in
|
|
304
|
+
* flight once the last one merged and applied. A single repo's key: a
|
|
305
|
+
* control repo's rollout spans its projects, so it is continued from the
|
|
306
|
+
* control repo. `respond.rollout: off` leaves the job out.
|
|
307
|
+
*/
|
|
308
|
+
rollouts?: string | false;
|
|
291
309
|
/** GitLab only: how the project keeps its forge token; see TOKEN_PROTECTIONS. */
|
|
292
310
|
gitlab?: {
|
|
293
311
|
token?: GitLabToken;
|
|
@@ -322,10 +340,7 @@ export interface ProjectSettings {
|
|
|
322
340
|
trace_url?: string;
|
|
323
341
|
};
|
|
324
342
|
tips?: boolean;
|
|
325
|
-
modules?:
|
|
326
|
-
path?: string;
|
|
327
|
-
publish?: string | string[];
|
|
328
|
-
};
|
|
343
|
+
modules?: ModulesSettings;
|
|
329
344
|
/**
|
|
330
345
|
* Cloud identities the pipeline takes over OIDC, so no long-lived keys sit in CI.
|
|
331
346
|
* Plan runs pull-request code and gets the read-only identity; apply gets the
|
|
@@ -379,6 +394,18 @@ export interface ResolvedSettings extends ProjectSettings {
|
|
|
379
394
|
env: Record<string, string>;
|
|
380
395
|
}
|
|
381
396
|
export declare const BUILT_IN: ResolvedSettings;
|
|
397
|
+
/**
|
|
398
|
+
* The keys a project's jobs read from the project's own terragucci.yml: the
|
|
399
|
+
* plan and apply stages, `respond`, `approve` and `check-policy` read them
|
|
400
|
+
* there, and no pipeline flag carries them. A control repo's `reconcile`
|
|
401
|
+
* writes each one its settings give the project, other than the built-in
|
|
402
|
+
* value, into that file (init.ts). Every other key reaches a project through
|
|
403
|
+
* the pipeline init writes (flags, the job's environment, its steps and
|
|
404
|
+
* files, such as `apply.resume` and `notify.webhook`). `url` is the project's
|
|
405
|
+
* own clone URL and `rollouts` belongs to a single repo, so `defaults`
|
|
406
|
+
* refuses both.
|
|
407
|
+
*/
|
|
408
|
+
export declare const PROJECT_FILE_KEYS: readonly ["policy", "reports", "approval", "gate", "roots", "waves", "parallelism", "synth", "drift", "cost", "tips", "runtime", "telemetry", "respond", "decide", "audit_region", "modules", "terragrunt", "token_env"];
|
|
382
409
|
export declare class ConfigError extends Error {
|
|
383
410
|
/** Every problem found, when the error is a validation failure. */
|
|
384
411
|
readonly problems?: string[];
|
|
@@ -389,6 +416,29 @@ export declare function checkMode(mode: string): "dry-run" | "apply";
|
|
|
389
416
|
export declare const CONFIG_NAMES: string[];
|
|
390
417
|
/** The config file in `dir`, or undefined. Two of them is an error. */
|
|
391
418
|
export declare function findConfig(dir: string): string | undefined;
|
|
419
|
+
/** A publisher in another repo whose releases `modules.require: attested` checks. */
|
|
420
|
+
export interface TrustedModuleSource {
|
|
421
|
+
/** How the roots' module sources begin: an `oci://` prefix, or the publisher's git URL with or without `git::`. */
|
|
422
|
+
source: string;
|
|
423
|
+
/** The publisher's cosign public key, a path in this repo. */
|
|
424
|
+
key: string;
|
|
425
|
+
/** The git repository whose `chant/lifecycle` branch holds the publisher's release ledger. */
|
|
426
|
+
ledger: string;
|
|
427
|
+
}
|
|
428
|
+
export interface ModulesSettings {
|
|
429
|
+
path?: string;
|
|
430
|
+
publish?: string | string[];
|
|
431
|
+
/** Sign each release, write its provenance and SBOM, and record it in the release ledger. `true` reads the key at cosign.pub. */
|
|
432
|
+
attest?: boolean | {
|
|
433
|
+
key?: string;
|
|
434
|
+
};
|
|
435
|
+
/** `attested`: tf-check and tf-plan refuse a root that pins a release of a checked source unless it verifies. */
|
|
436
|
+
require?: "attested";
|
|
437
|
+
/** Publishers in other repos whose releases `require` checks. */
|
|
438
|
+
trusted?: TrustedModuleSource[];
|
|
439
|
+
}
|
|
440
|
+
/** Why a control repo's projects take no `rollouts` job: each project's pipeline sees only its own roots. */
|
|
441
|
+
export declare const ROLLOUTS_SINGLE_REPO = "a control repo's rollout plans its waves across every project, and a project's pipeline sees only its own roots; leave rollouts unset and run terragucci respond rollout --mode apply on a schedule in the control repo";
|
|
392
442
|
/** Why `comments` is GitLab's alone: the other forges start a job for each comment. */
|
|
393
443
|
export declare const COMMENTS_GITLAB_ONLY = "comments is for GitLab, which starts no pipeline for a merge request note; GitHub and Forgejo start the comment jobs from the comment itself, so leave comments unset";
|
|
394
444
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/terragucci",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
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",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
".": {
|
|
18
18
|
"types": "./dist/types.d.ts"
|
|
19
19
|
},
|
|
20
|
-
"./report.schema.json": "./dist/report.schema.json"
|
|
20
|
+
"./report.schema.json": "./dist/report.schema.json",
|
|
21
|
+
"./notify.schema.json": "./dist/notify.schema.json"
|
|
21
22
|
},
|
|
22
23
|
"files": [
|
|
23
24
|
"dist",
|