@intentius/chant 0.61.0 → 0.63.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/dist/cli/handlers/operator.d.ts +13 -18
- package/dist/cli/handlers/operator.d.ts.map +1 -1
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/registry.d.ts +2 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/cli-support.d.ts +3 -0
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/driver-output.d.ts.map +1 -1
- package/dist/components/driver.d.ts +12 -0
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/fold/fold.d.ts.map +1 -1
- package/dist/fold/subset.d.ts +10 -0
- package/dist/fold/subset.d.ts.map +1 -1
- package/dist/lexicon.d.ts +51 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.d.ts +61 -0
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/git.d.ts +117 -0
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/index.d.ts +1 -0
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/plan-digest.d.ts +33 -0
- package/dist/lifecycle/plan-digest.d.ts.map +1 -0
- package/dist/lifecycle/run-ledger.d.ts.map +1 -1
- package/dist/op/activities/lexicon-upgrade.d.ts +33 -3
- package/dist/op/activities/lexicon-upgrade.d.ts.map +1 -1
- package/dist/op/activities/lifecycle.d.ts +27 -0
- package/dist/op/activities/lifecycle.d.ts.map +1 -1
- package/dist/op/activities/reconcile.d.ts +394 -14
- package/dist/op/activities/reconcile.d.ts.map +1 -1
- package/dist/op/builders.d.ts +6 -0
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/composites/apply-op.d.ts +6 -0
- package/dist/op/composites/apply-op.d.ts.map +1 -1
- package/dist/op/composites/reconcile-op.d.ts.map +1 -1
- package/dist/op/gate-summary.d.ts +16 -0
- package/dist/op/gate-summary.d.ts.map +1 -1
- package/dist/op/gate.d.ts +104 -13
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/index.d.ts +3 -2
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/local-executor.d.ts +34 -2
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-output.d.ts.map +1 -1
- package/dist/op/op-ir.d.ts +8 -1
- package/dist/op/op-ir.d.ts.map +1 -1
- package/dist/op/operator.d.ts.map +1 -1
- package/dist/op/runtime.d.ts +2 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/op/runtimes/local.d.ts.map +1 -1
- package/dist/op/types.d.ts +19 -0
- package/dist/op/types.d.ts.map +1 -1
- package/dist/runtime-adapter.d.ts +8 -0
- package/dist/runtime-adapter.d.ts.map +1 -1
- package/dist/terraform/__fixtures__/build-graph.d.ts +8 -0
- package/dist/terraform/__fixtures__/build-graph.d.ts.map +1 -1
- package/dist/terraform/graph.d.ts +18 -2
- package/dist/terraform/graph.d.ts.map +1 -1
- package/dist/terraform/parse.d.ts.map +1 -1
- package/dist/terraform/types.d.ts +7 -0
- package/dist/terraform/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cli/handlers/operator.test.ts +232 -1
- package/src/cli/handlers/operator.ts +130 -6
- package/src/cli/handlers/run.ts +19 -0
- package/src/cli/main.ts +2 -0
- package/src/cli/registry.ts +2 -0
- package/src/components/cli-support.ts +29 -4
- package/src/components/driver-output.ts +10 -0
- package/src/components/driver.test.ts +31 -0
- package/src/components/driver.ts +54 -8
- package/src/discovery/fold-import.test.ts +55 -0
- package/src/fold/fold.test.ts +152 -0
- package/src/fold/fold.ts +102 -2
- package/src/fold/subset-doc-parity.test.ts +35 -1
- package/src/fold/subset.ts +10 -0
- package/src/lexicon.ts +51 -0
- package/src/lifecycle/gate-ledger.test.ts +133 -1
- package/src/lifecycle/gate-ledger.ts +108 -0
- package/src/lifecycle/git.test.ts +49 -5
- package/src/lifecycle/git.ts +312 -11
- package/src/lifecycle/index.ts +1 -0
- package/src/lifecycle/plan-digest.test.ts +49 -0
- package/src/lifecycle/plan-digest.ts +86 -0
- package/src/lifecycle/run-ledger.ts +1 -0
- package/src/op/activities/lexicon-upgrade.test.ts +134 -39
- package/src/op/activities/lexicon-upgrade.ts +74 -12
- package/src/op/activities/lifecycle.ts +51 -2
- package/src/op/activities/reconcile.test.ts +1013 -1
- package/src/op/activities/reconcile.ts +721 -25
- package/src/op/builders.ts +7 -1
- package/src/op/composites/apply-op.ts +16 -0
- package/src/op/composites/composites.test.ts +15 -2
- package/src/op/composites/reconcile-op.test.ts +18 -0
- package/src/op/composites/reconcile-op.ts +7 -1
- package/src/op/gate-summary.test.ts +33 -0
- package/src/op/gate-summary.ts +31 -0
- package/src/op/gate.test.ts +614 -0
- package/src/op/gate.ts +190 -24
- package/src/op/index.ts +5 -2
- package/src/op/local-executor.test.ts +340 -2
- package/src/op/local-executor.ts +190 -32
- package/src/op/local-output.test.ts +38 -0
- package/src/op/local-output.ts +24 -1
- package/src/op/op-ir.test.ts +22 -0
- package/src/op/op-ir.ts +9 -0
- package/src/op/operator.test.ts +20 -0
- package/src/op/operator.ts +39 -1
- package/src/op/runtime.ts +2 -0
- package/src/op/runtimes/local.ts +11 -0
- package/src/op/types.ts +19 -0
- package/src/runtime-adapter.ts +17 -3
- package/src/terraform/__fixtures__/build-graph.ts +42 -0
- package/src/terraform/__fixtures__/carve-locals-data.test.ts +138 -0
- package/src/terraform/__fixtures__/depth-estate/main.tf +141 -0
- package/src/terraform/__fixtures__/depth-estate/terraform.tfstate +17 -0
- package/src/terraform/__fixtures__/depth-estate.test.ts +162 -0
- package/src/terraform/graph.test.ts +148 -1
- package/src/terraform/graph.ts +144 -6
- package/src/terraform/parse.ts +4 -1
- package/src/terraform/types.ts +7 -0
package/dist/lifecycle/git.d.ts
CHANGED
|
@@ -170,6 +170,123 @@ export declare function pushLifecycle(opts?: {
|
|
|
170
170
|
export declare function fetchLifecycle(opts?: {
|
|
171
171
|
cwd?: string;
|
|
172
172
|
}): Promise<boolean>;
|
|
173
|
+
/**
|
|
174
|
+
* Why a fetch of the ledger branch did or did not produce local history
|
|
175
|
+
* (#2303).
|
|
176
|
+
*
|
|
177
|
+
* `fetchLifecycle`'s boolean cannot answer the question the gate actually
|
|
178
|
+
* needs answered. "No local `chant/lifecycle`" has two causes that a reader
|
|
179
|
+
* of an empty ledger cannot tell apart, and they call for opposite
|
|
180
|
+
* behaviour: on a project whose ledger has never been written, an empty
|
|
181
|
+
* ledger is the truth; in a CI checkout that fetched only the pipeline's own
|
|
182
|
+
* ref, an empty ledger is history the checkout simply cannot see. Reading the
|
|
183
|
+
* second as the first is what makes a second pending fact look correct, so
|
|
184
|
+
* these are separate outcomes:
|
|
185
|
+
*
|
|
186
|
+
* - `fetched` — the branch is now in this checkout (or already was, and is
|
|
187
|
+
* up to date). Whatever the ledger says is the whole truth.
|
|
188
|
+
* - `no-remote` — nothing to fetch from. A single-machine project; local is
|
|
189
|
+
* authoritative by construction, the same assumption `chant operator`'s
|
|
190
|
+
* lease already documents.
|
|
191
|
+
* - `absent` — the remote answered and has no `chant/lifecycle`. The ledger
|
|
192
|
+
* is genuinely empty; this is a project's first gate.
|
|
193
|
+
* - `diverged` — both sides have the branch and neither contains the other.
|
|
194
|
+
* Appending here would drop one side's facts.
|
|
195
|
+
* - `unreachable` — a remote is configured and did not answer (no network,
|
|
196
|
+
* no credentials, a shallow-clone refspec that cannot resolve). Whether
|
|
197
|
+
* anything is on the branch is unknown, which is exactly the state that
|
|
198
|
+
* must not be read as "nothing has been approved".
|
|
199
|
+
*/
|
|
200
|
+
export type LifecycleFetchStatus = {
|
|
201
|
+
status: "fetched";
|
|
202
|
+
} | {
|
|
203
|
+
status: "no-remote";
|
|
204
|
+
} | {
|
|
205
|
+
status: "absent";
|
|
206
|
+
remote: string;
|
|
207
|
+
} | {
|
|
208
|
+
status: "ahead";
|
|
209
|
+
remote: string;
|
|
210
|
+
} | {
|
|
211
|
+
status: "diverged";
|
|
212
|
+
remote: string;
|
|
213
|
+
stderr: string;
|
|
214
|
+
} | {
|
|
215
|
+
status: "unreachable";
|
|
216
|
+
remote: string;
|
|
217
|
+
stderr: string;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Fetch `chant/lifecycle` and say what happened, in the terms
|
|
221
|
+
* {@link LifecycleFetchStatus} defines.
|
|
222
|
+
*
|
|
223
|
+
* The refspec is deliberately un-forced (`chant/lifecycle:chant/lifecycle`,
|
|
224
|
+
* no leading `+`), so a local branch holding facts the remote does not have is
|
|
225
|
+
* never rewound by a read.
|
|
226
|
+
*
|
|
227
|
+
* git reports "non-fast-forward" for two states that could not be more
|
|
228
|
+
* different, which is why the rejection is not taken at face value (#2309
|
|
229
|
+
* review): a local branch *ahead* of the remote — the ordinary state right
|
|
230
|
+
* after an append whose push has not landed yet — and a local branch that has
|
|
231
|
+
* genuinely *forked*. Resolving the remote tip into a scratch ref and asking
|
|
232
|
+
* whether it is an ancestor of the local tip separates them. Reading a fork as
|
|
233
|
+
* the ledger is what destroys approvals; refusing an append that is merely
|
|
234
|
+
* ahead would break the retry that is supposed to repair a failed push.
|
|
235
|
+
*/
|
|
236
|
+
export declare function fetchLifecycleStatus(opts?: {
|
|
237
|
+
cwd?: string;
|
|
238
|
+
}): Promise<LifecycleFetchStatus>;
|
|
239
|
+
/**
|
|
240
|
+
* Thrown when the ledger branch cannot be read, rather than being reported as
|
|
241
|
+
* empty (#2303).
|
|
242
|
+
*/
|
|
243
|
+
export declare class LifecycleLedgerUnreadableError extends Error {
|
|
244
|
+
readonly reason: "unreachable" | "diverged";
|
|
245
|
+
readonly remote: string;
|
|
246
|
+
readonly stderr: string;
|
|
247
|
+
constructor(reason: "unreachable" | "diverged", remote: string, stderr: string, detail: string);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Bring the ledger branch into this checkout before reading or appending to
|
|
251
|
+
* it, and refuse when it cannot be (#2303).
|
|
252
|
+
*
|
|
253
|
+
* The gate's read is the one that has to be right: `evaluateGate` decides
|
|
254
|
+
* whether to walk through or to record a *new* pending fact purely from what
|
|
255
|
+
* the ledger says, so a read that reports history it cannot see as an empty
|
|
256
|
+
* ledger makes the second run of an already-approved commit record a second
|
|
257
|
+
* pending fact and gate again. That is what a GitLab CI retry did on
|
|
258
|
+
* INTENTIUS/choudoufu#1026 — two pending records for one commit, with
|
|
259
|
+
* different expiries — because a GitLab checkout fetches the pipeline's own
|
|
260
|
+
* ref at depth 20 and nothing else. `GIT_DEPTH: 0` does not help: GitLab
|
|
261
|
+
* fetches refspecs, not all branches.
|
|
262
|
+
*
|
|
263
|
+
* There was a separate, laxer guard for the read until #2309's review, on the
|
|
264
|
+
* reasoning that a checkout which already has the branch "has real history to
|
|
265
|
+
* read". That reasoning is only sound when the local branch *is* the remote's
|
|
266
|
+
* history, and it let the worst case through: on a fork, the gate read a
|
|
267
|
+
* ledger missing every remote approval, recorded a fresh pending fact, and
|
|
268
|
+
* pushed. The push was not protected either — a rejected non-fast-forward
|
|
269
|
+
* fetch still updates `refs/remotes/<remote>/chant/lifecycle` opportunistically
|
|
270
|
+
* in a full clone, so `pushLifecycle`'s `--force-with-lease` matched the tip
|
|
271
|
+
* it had just learned and forced. Verified on git 2.50.1: a remote holding a
|
|
272
|
+
* pending fact and an approval ended up holding neither.
|
|
273
|
+
*
|
|
274
|
+
* So there is one rule now, for readers and writers alike:
|
|
275
|
+
*
|
|
276
|
+
* - `diverged` always refuses. A fork is not the ledger, and nothing good
|
|
277
|
+
* comes of reading one as if it were.
|
|
278
|
+
* - `unreachable` refuses only when the checkout has no local history at all,
|
|
279
|
+
* which is the case that would otherwise read as an empty ledger. With
|
|
280
|
+
* local history and no answer from the remote, the read proceeds and the
|
|
281
|
+
* push's lease fails safely on its own — refusing there would strand every
|
|
282
|
+
* offline run.
|
|
283
|
+
* - `fetched`, `no-remote`, `absent` and `ahead` all proceed. `ahead` is the
|
|
284
|
+
* ordinary state right after an append whose push has not landed, and is
|
|
285
|
+
* exactly what a retry needs to be able to repair.
|
|
286
|
+
*/
|
|
287
|
+
export declare function requireLifecycleLedger(opts?: {
|
|
288
|
+
cwd?: string;
|
|
289
|
+
}): Promise<void>;
|
|
173
290
|
/**
|
|
174
291
|
* Thrown by {@link updateRefCAS}/{@link deleteRefCAS} when `ref` no longer
|
|
175
292
|
* points at the `oldValue` the caller last observed — another writer moved
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/lifecycle/git.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/lifecycle/git.ts"],"names":[],"mappings":"AAwGA,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC1D,OAAO,CAAC,MAAM,CAAC,CAuKjB;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQxB;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE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c,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lifecycle/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** The hash a plan digest is taken with, and the prefix every digest carries. */
|
|
2
|
+
export declare const PLAN_DIGEST_ALGORITHM = "sha256";
|
|
3
|
+
/**
|
|
4
|
+
* Hash a plan's change set into a stable identity.
|
|
5
|
+
*
|
|
6
|
+
* `kind` names the shape `subject` is in (`"terraform-plan"`,
|
|
7
|
+
* `"lifecycle-diff"`), and is hashed alongside it so two different kinds of
|
|
8
|
+
* plan can never collide into the same digest by coincidence — a gate bound
|
|
9
|
+
* to a terraform plan must not be satisfiable by a lifecycle diff that
|
|
10
|
+
* happened to serialize identically.
|
|
11
|
+
*
|
|
12
|
+
* `subject` is canonicalised by {@link sortedJsonReplacer}, so object key
|
|
13
|
+
* order — which neither terraform's JSON writer nor `JSON.parse` guarantees
|
|
14
|
+
* across versions — does not change the answer. It is the caller's job to
|
|
15
|
+
* hand in a projection that already excludes the volatile fields this
|
|
16
|
+
* module's doc comment lists.
|
|
17
|
+
*/
|
|
18
|
+
export declare function computePlanDigest(kind: string, subject: unknown): string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether `raw` is a digest this code produced. Used at the `chant approve
|
|
21
|
+
* --plan` boundary, so a typo, a truncated copy-paste or a plan *file* path
|
|
22
|
+
* is refused before it is written into an immutable resolution that would
|
|
23
|
+
* then never match anything.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isPlanDigest(raw: unknown): raw is string;
|
|
26
|
+
/**
|
|
27
|
+
* A digest as it reads in a message, and the one place that decides how an
|
|
28
|
+
* absent one reads. Records written before #2300 carry no digest at all, and
|
|
29
|
+
* "(none — recorded before plan-bound gates)" is what a refusal has to say
|
|
30
|
+
* about them instead of printing `undefined`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function describePlanDigest(digest: string | undefined): string;
|
|
33
|
+
//# sourceMappingURL=plan-digest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-digest.d.ts","sourceRoot":"","sources":["../../src/lifecycle/plan-digest.ts"],"names":[],"mappings":"AAyCA,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAK9C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAGxE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAErE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-ledger.d.ts","sourceRoot":"","sources":["../../src/lifecycle/run-ledger.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAqC,MAAM,eAAe,CAAC;AAStG,0EAA0E;AAC1E,eAAO,MAAM,eAAe,UAAU,CAAC;AAMvC,8FAA8F;AAC9F,wBAAgB,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,MAAM,CAEjE;AAQD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC,EACzC,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,KAAK,EAAE;IACL,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC5B,GACA,gBAAgB,
|
|
1
|
+
{"version":3,"file":"run-ledger.d.ts","sourceRoot":"","sources":["../../src/lifecycle/run-ledger.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAqC,MAAM,eAAe,CAAC;AAStG,0EAA0E;AAC1E,eAAO,MAAM,eAAe,UAAU,CAAC;AAMvC,8FAA8F;AAC9F,wBAAgB,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,MAAM,CAEjE;AAQD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC,EACzC,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,KAAK,EAAE;IACL,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC5B,GACA,gBAAgB,CAqClB;AAED;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,gBAAgB,EACvB,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,CAAC,CAsBlD;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,WAAW,EAAE,MAAM,EACnB,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC;IAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CA4BxD"}
|
|
@@ -79,7 +79,7 @@ export interface LexiconUpgradeResult {
|
|
|
79
79
|
semverLabel: SemverLabel | null;
|
|
80
80
|
/** URL of the opened/updated PR (pull-request mode). */
|
|
81
81
|
prUrl?: string;
|
|
82
|
-
/** URL of the opened issue (issue mode). */
|
|
82
|
+
/** URL of the opened or edited issue (issue mode; sticky per lexicon, #2297). */
|
|
83
83
|
issueUrl?: string;
|
|
84
84
|
/** Full markdown summary, used as PR/issue body or printed in report mode. */
|
|
85
85
|
summary: string;
|
|
@@ -99,8 +99,20 @@ export type CheckRollingFn = (opts: {
|
|
|
99
99
|
force?: boolean;
|
|
100
100
|
verbose?: boolean;
|
|
101
101
|
}) => Promise<RollingUpgradeResult>;
|
|
102
|
-
/**
|
|
103
|
-
|
|
102
|
+
/**
|
|
103
|
+
* Minimal shell-exec interface for gh/git invocations.
|
|
104
|
+
*
|
|
105
|
+
* `opts` carries the environment `postOrUpdateGithubIssue` resolves the issue
|
|
106
|
+
* credential into (chant #2320) — the same `GhExec` shape reconcile.ts
|
|
107
|
+
* declares, so the two stay one signature and this can keep being passed
|
|
108
|
+
* straight through. Every other call site here forwards nothing and passes
|
|
109
|
+
* nothing. A mock runner is free to ignore the argument; the default one
|
|
110
|
+
* hands it to `execAsync`, which is what makes CHANT_FORGEJO_TOKEN actually
|
|
111
|
+
* reach `gh` on a cross-instance Forgejo run.
|
|
112
|
+
*/
|
|
113
|
+
export type GhRunner = (cmd: string, opts?: {
|
|
114
|
+
env?: NodeJS.ProcessEnv;
|
|
115
|
+
}) => Promise<{
|
|
104
116
|
stdout: string;
|
|
105
117
|
stderr: string;
|
|
106
118
|
}>;
|
|
@@ -159,6 +171,18 @@ export declare function buildUpgradeSummary(opts: {
|
|
|
159
171
|
output: string;
|
|
160
172
|
}>;
|
|
161
173
|
}): string;
|
|
174
|
+
/**
|
|
175
|
+
* The hidden marker that makes this lexicon's upgrade-status issue findable
|
|
176
|
+
* across re-runs (#2297): written as the issue body's first line, matched by
|
|
177
|
+
* `startswith` — the same recipe reconcile.ts's `issueMarker` names for a
|
|
178
|
+
* reconcile finding, kept as its own function because the two activities own
|
|
179
|
+
* different issues. Keyed on `lexicon`, not on the validation outcome: a
|
|
180
|
+
* lexicon has one upgrade-status issue that flips between "validation
|
|
181
|
+
* failed" and "upgrade ready" as reality changes, rather than a second issue
|
|
182
|
+
* for the other outcome. `lexicon` is a closed set of known identifiers
|
|
183
|
+
* (see `SupportedLexicon`), so unlike `issueMarker` this needs no slugifying.
|
|
184
|
+
*/
|
|
185
|
+
export declare function lexiconUpgradeIssueMarker(lexicon: SupportedLexicon): string;
|
|
162
186
|
/**
|
|
163
187
|
* Run the lexicon upgrade check for one lexicon and surface the result.
|
|
164
188
|
*
|
|
@@ -176,6 +200,12 @@ export declare function buildUpgradeSummary(opts: {
|
|
|
176
200
|
* - Semver label: "minor" (additive) or "breaking" (changed/removed).
|
|
177
201
|
* - Validation failure falls back to issue mode.
|
|
178
202
|
*
|
|
203
|
+
* In issue mode (#2297): one OPEN issue per lexicon, found by a hidden
|
|
204
|
+
* marker and edited in place on every re-run — the same sticky recipe
|
|
205
|
+
* reconcile.ts's `issue` mode uses, via the shared `postOrUpdateGithubIssue`.
|
|
206
|
+
* Never closed by this activity; see that function's doc comment for the
|
|
207
|
+
* close decision, which applies here unchanged.
|
|
208
|
+
*
|
|
179
209
|
* Never auto-merges or auto-publishes.
|
|
180
210
|
*/
|
|
181
211
|
export declare function lexiconUpgrade(args: LexiconUpgradeArgs): Promise<LexiconUpgradeResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexicon-upgrade.d.ts","sourceRoot":"","sources":["../../../src/op/activities/lexicon-upgrade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAMH,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAmB,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"lexicon-upgrade.d.ts","sourceRoot":"","sources":["../../../src/op/activities/lexicon-upgrade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAMH,OAAO,KAAK,EAAE,kBAAkB,EAAE,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|
28
28
|
*/
|
|
29
29
|
drifted: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* This diff's identity (#2300) — the change set `chant lifecycle diff`
|
|
32
|
+
* reported, hashed. `ApplyOp` hands it to its gate step's `plan`, so an
|
|
33
|
+
* approval binds to the change set the approver read rather than to the
|
|
34
|
+
* next run of the Op.
|
|
35
|
+
*
|
|
36
|
+
* Computed over {@link normalizeDiffChangeSet}'s canonical form of
|
|
37
|
+
* `output`, so incidental whitespace does not read as a changed plan, while
|
|
38
|
+
* any added, removed or reworded row does.
|
|
39
|
+
*/
|
|
40
|
+
planDigest: string;
|
|
30
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* The change set half of a `chant lifecycle diff` render, canonicalised for
|
|
44
|
+
* digesting (#2300).
|
|
45
|
+
*
|
|
46
|
+
* The diff render is line-oriented: section headers and the resource rows
|
|
47
|
+
* under them. Two runs over an unchanged environment print the same lines, so
|
|
48
|
+
* the lines are the change set. Normalising is deliberately minimal — CRLF to
|
|
49
|
+
* LF, trailing whitespace off each line, blank lines dropped — because
|
|
50
|
+
* anything more aggressive would start discarding rows, and a digest that
|
|
51
|
+
* discards rows is a digest that approves changes nobody saw.
|
|
52
|
+
*
|
|
53
|
+
* Unlike a terraform plan there is no timestamp to strip: the diff render
|
|
54
|
+
* carries none. If one is ever added it has to be dropped here, or every
|
|
55
|
+
* approval would be stale the moment it was written.
|
|
56
|
+
*/
|
|
57
|
+
export declare function normalizeDiffChangeSet(output: string): string[];
|
|
31
58
|
/**
|
|
32
59
|
* Run `chant lifecycle diff <env>` and return the output + structured drift
|
|
33
60
|
* flag. Read-only; intended for use inside watch/observation Ops.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/op/activities/lifecycle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/op/activities/lifecycle.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,qBAAqB;IACpC,wDAAwD;IACxD,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,qBAAqB,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAIxG;AAED,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;;;;;OASG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAM/D;AAkCD;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,iBAAiB,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAa/G"}
|