@intentius/terragucci 0.4.1 → 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 +77 -1
- package/dist/terragucci.mjs +464 -345
- package/dist/terragucci.mjs.map +4 -4
- package/dist/types.d.ts +82 -4
- 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:`. */
|
|
@@ -261,12 +268,44 @@ export interface ProjectSettings {
|
|
|
261
268
|
};
|
|
262
269
|
/** A cron schedule for tf-drift, or false. */
|
|
263
270
|
drift?: string | false;
|
|
271
|
+
/**
|
|
272
|
+
* The command that writes the roots before any job reads them, such as
|
|
273
|
+
* CDK Terrain's `npx cdktn synth`. Run from the repo's root, in the check,
|
|
274
|
+
* plan, apply and drift jobs, on their own checkout.
|
|
275
|
+
*/
|
|
276
|
+
synth?: string;
|
|
277
|
+
/**
|
|
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).
|
|
282
|
+
*/
|
|
283
|
+
notify?: {
|
|
284
|
+
slack?: string;
|
|
285
|
+
teams?: string;
|
|
286
|
+
webhook?: string;
|
|
287
|
+
webhook_key?: string;
|
|
288
|
+
};
|
|
289
|
+
/**
|
|
290
|
+
* Cost estimates per root in the plan note: Infracost on the customer's
|
|
291
|
+
* own key (`key_secret`, default INFRACOST_API_KEY), or a `command` that
|
|
292
|
+
* prints Infracost's JSON (report/cost.ts).
|
|
293
|
+
*/
|
|
294
|
+
cost?: CostSettings;
|
|
264
295
|
/**
|
|
265
296
|
* GitLab only: the cron of the comments schedule, or false. The pipeline
|
|
266
297
|
* gets a `comments` job that reads new merge request notes on that
|
|
267
298
|
* schedule (comment-gitlab.ts), since GitLab starts no pipeline for a note.
|
|
268
299
|
*/
|
|
269
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;
|
|
270
309
|
/** GitLab only: how the project keeps its forge token; see TOKEN_PROTECTIONS. */
|
|
271
310
|
gitlab?: {
|
|
272
311
|
token?: GitLabToken;
|
|
@@ -301,10 +340,7 @@ export interface ProjectSettings {
|
|
|
301
340
|
trace_url?: string;
|
|
302
341
|
};
|
|
303
342
|
tips?: boolean;
|
|
304
|
-
modules?:
|
|
305
|
-
path?: string;
|
|
306
|
-
publish?: string | string[];
|
|
307
|
-
};
|
|
343
|
+
modules?: ModulesSettings;
|
|
308
344
|
/**
|
|
309
345
|
* Cloud identities the pipeline takes over OIDC, so no long-lived keys sit in CI.
|
|
310
346
|
* Plan runs pull-request code and gets the read-only identity; apply gets the
|
|
@@ -342,6 +378,13 @@ export interface TerragucciConfig extends ProjectSettings {
|
|
|
342
378
|
}
|
|
343
379
|
/** The response a project takes to an event: its setting, or the event's default. */
|
|
344
380
|
export declare function responseTo(settings: ProjectSettings, event: RespondEvent): string;
|
|
381
|
+
/** `cost: true`, or the secret holding the estimator's key and the command to run instead of Infracost. */
|
|
382
|
+
export type CostSettings = true | {
|
|
383
|
+
key_secret?: string;
|
|
384
|
+
command?: string;
|
|
385
|
+
};
|
|
386
|
+
/** The secret Infracost's key is read from when `cost.key_secret` is unset; the job gets it as this variable too. */
|
|
387
|
+
export declare const COST_KEY_SECRET = "INFRACOST_API_KEY";
|
|
345
388
|
/** Settings with terragucci's defaults filled in. Detection fills `roots`, `binary` and `forge` later. */
|
|
346
389
|
export interface ResolvedSettings extends ProjectSettings {
|
|
347
390
|
gate: Gate;
|
|
@@ -351,6 +394,18 @@ export interface ResolvedSettings extends ProjectSettings {
|
|
|
351
394
|
env: Record<string, string>;
|
|
352
395
|
}
|
|
353
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"];
|
|
354
409
|
export declare class ConfigError extends Error {
|
|
355
410
|
/** Every problem found, when the error is a validation failure. */
|
|
356
411
|
readonly problems?: string[];
|
|
@@ -361,6 +416,29 @@ export declare function checkMode(mode: string): "dry-run" | "apply";
|
|
|
361
416
|
export declare const CONFIG_NAMES: string[];
|
|
362
417
|
/** The config file in `dir`, or undefined. Two of them is an error. */
|
|
363
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";
|
|
364
442
|
/** Why `comments` is GitLab's alone: the other forges start a job for each comment. */
|
|
365
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";
|
|
366
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",
|