@intentius/chant 0.124.63 → 0.124.65

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.
Files changed (185) hide show
  1. package/dist/cli/handlers/approve.d.ts +8 -0
  2. package/dist/cli/handlers/approve.d.ts.map +1 -1
  3. package/dist/cli/handlers/approve.js +27 -4
  4. package/dist/cli/handlers/pr.d.ts.map +1 -1
  5. package/dist/cli/handlers/pr.js +2 -1
  6. package/dist/cli/handlers/release.d.ts +6 -4
  7. package/dist/cli/handlers/release.d.ts.map +1 -1
  8. package/dist/cli/handlers/release.js +101 -16
  9. package/dist/cli/handlers/run.d.ts +30 -1
  10. package/dist/cli/handlers/run.d.ts.map +1 -1
  11. package/dist/cli/handlers/run.js +108 -7
  12. package/dist/cli/main.d.ts.map +1 -1
  13. package/dist/cli/main.js +34 -7
  14. package/dist/cli/parse-args.d.ts.map +1 -1
  15. package/dist/cli/parse-args.js +19 -0
  16. package/dist/cli/registry.d.ts +10 -2
  17. package/dist/cli/registry.d.ts.map +1 -1
  18. package/dist/components/cli-support.d.ts +19 -1
  19. package/dist/components/cli-support.d.ts.map +1 -1
  20. package/dist/components/cli-support.js +11 -3
  21. package/dist/components/component.d.ts +19 -0
  22. package/dist/components/component.d.ts.map +1 -1
  23. package/dist/components/component.schema.json +17 -0
  24. package/dist/components/index.d.ts +1 -1
  25. package/dist/components/index.d.ts.map +1 -1
  26. package/dist/components/release-run.d.ts +48 -0
  27. package/dist/components/release-run.d.ts.map +1 -0
  28. package/dist/components/release-run.js +166 -0
  29. package/dist/components/starter-plugin.d.ts +1 -0
  30. package/dist/components/starter-plugin.d.ts.map +1 -1
  31. package/dist/components/starter-plugin.js +5 -1
  32. package/dist/components/unchanged-inputs.d.ts +81 -0
  33. package/dist/components/unchanged-inputs.d.ts.map +1 -0
  34. package/dist/components/unchanged-inputs.js +122 -0
  35. package/dist/components/verbs/index.d.ts +1 -0
  36. package/dist/components/verbs/index.d.ts.map +1 -1
  37. package/dist/components/verbs/index.js +1 -0
  38. package/dist/components/verbs/release-image.d.ts +36 -0
  39. package/dist/components/verbs/release-image.d.ts.map +1 -0
  40. package/dist/components/verbs/release-image.js +33 -0
  41. package/dist/config.d.ts +18 -0
  42. package/dist/config.d.ts.map +1 -1
  43. package/dist/config.js +1 -0
  44. package/dist/gate-statement.schema.json +4 -2
  45. package/dist/lifecycle/delivery-metrics.d.ts.map +1 -1
  46. package/dist/lifecycle/delivery-metrics.js +4 -2
  47. package/dist/lifecycle/gate-ledger.d.ts +11 -2
  48. package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
  49. package/dist/lifecycle/gate-ledger.js +6 -0
  50. package/dist/lifecycle/gate-seal.d.ts +20 -4
  51. package/dist/lifecycle/gate-seal.d.ts.map +1 -1
  52. package/dist/lifecycle/gate-seal.js +18 -5
  53. package/dist/lifecycle/gate-statement.d.ts +27 -2
  54. package/dist/lifecycle/gate-statement.d.ts.map +1 -1
  55. package/dist/lifecycle/gate-statement.js +37 -2
  56. package/dist/lifecycle/git.d.ts.map +1 -1
  57. package/dist/lifecycle/git.js +6 -1
  58. package/dist/lifecycle/ledger-read.js +1 -1
  59. package/dist/lifecycle/plan-stale.d.ts.map +1 -1
  60. package/dist/lifecycle/plan-stale.js +1 -2
  61. package/dist/lifecycle/publish-declaration.d.ts +20 -0
  62. package/dist/lifecycle/publish-declaration.d.ts.map +1 -1
  63. package/dist/lifecycle/publish-declaration.js +24 -1
  64. package/dist/lifecycle/publish-forge.d.ts.map +1 -1
  65. package/dist/lifecycle/publish-forge.js +1 -2
  66. package/dist/lifecycle/publish-git-ssh.d.ts +82 -0
  67. package/dist/lifecycle/publish-git-ssh.d.ts.map +1 -0
  68. package/dist/lifecycle/publish-git-ssh.js +180 -0
  69. package/dist/lifecycle/publish-homebrew.d.ts +11 -0
  70. package/dist/lifecycle/publish-homebrew.d.ts.map +1 -1
  71. package/dist/lifecycle/publish-homebrew.js +96 -5
  72. package/dist/lifecycle/publish-marketplace.d.ts +36 -2
  73. package/dist/lifecycle/publish-marketplace.d.ts.map +1 -1
  74. package/dist/lifecycle/publish-marketplace.js +173 -30
  75. package/dist/lifecycle/publish-tauri.d.ts.map +1 -1
  76. package/dist/lifecycle/publish-tauri.js +1 -2
  77. package/dist/lifecycle/query.d.ts +2 -2
  78. package/dist/lifecycle/query.d.ts.map +1 -1
  79. package/dist/lifecycle/query.js +3 -3
  80. package/dist/lifecycle/release-cut.d.ts +82 -6
  81. package/dist/lifecycle/release-cut.d.ts.map +1 -1
  82. package/dist/lifecycle/release-cut.js +209 -20
  83. package/dist/lifecycle/release-ledger.d.ts +11 -0
  84. package/dist/lifecycle/release-ledger.d.ts.map +1 -1
  85. package/dist/lifecycle/release-publish.d.ts +13 -0
  86. package/dist/lifecycle/release-publish.d.ts.map +1 -1
  87. package/dist/lifecycle/release-publish.js +5 -0
  88. package/dist/lifecycle/release-revocation.d.ts +4 -3
  89. package/dist/lifecycle/release-revocation.d.ts.map +1 -1
  90. package/dist/lifecycle/release-revocation.js +5 -4
  91. package/dist/lifecycle/release-store.d.ts +49 -3
  92. package/dist/lifecycle/release-store.d.ts.map +1 -1
  93. package/dist/lifecycle/release-store.js +22 -3
  94. package/dist/op/gate.d.ts +1 -1
  95. package/dist/op/gate.d.ts.map +1 -1
  96. package/dist/op/gate.js +2 -1
  97. package/dist/op/op-waves-run.js +5 -3
  98. package/dist/pr-forge.d.ts.map +1 -1
  99. package/dist/pr-forge.js +26 -6
  100. package/dist/release-floors.d.ts +1 -1
  101. package/dist/release-floors.js +1 -1
  102. package/dist/wave-runtime.mjs +284 -283
  103. package/dist/workspace/ci-green.d.ts.map +1 -1
  104. package/dist/workspace/ci-green.js +1 -2
  105. package/dist/workspace/ci-quarantine-report.d.ts.map +1 -1
  106. package/dist/workspace/ci-quarantine-report.js +1 -2
  107. package/dist/workspace/ci-quarantine.d.ts.map +1 -1
  108. package/dist/workspace/ci-quarantine.js +1 -2
  109. package/dist/workspace/delivery-metrics.schema.json +1 -1
  110. package/dist/workspace/intent.d.ts.map +1 -1
  111. package/dist/workspace/intent.js +1 -2
  112. package/dist/workspace/release-candidates.d.ts +9 -1
  113. package/dist/workspace/release-candidates.d.ts.map +1 -1
  114. package/dist/workspace/release-candidates.js +16 -5
  115. package/dist/workspace/release-candidates.schema.json +7 -0
  116. package/dist/workspace/releases.schema.json +54 -2
  117. package/package.json +1 -1
  118. package/src/cli/handlers/approve-external-signature.test.ts +105 -3
  119. package/src/cli/handlers/approve.ts +34 -4
  120. package/src/cli/handlers/pr.ts +2 -1
  121. package/src/cli/handlers/release.ts +91 -16
  122. package/src/cli/handlers/run-unchanged.e2e.test.ts +112 -0
  123. package/src/cli/handlers/run.ts +117 -7
  124. package/src/cli/main.ts +34 -7
  125. package/src/cli/parse-args.ts +15 -0
  126. package/src/cli/registry.ts +10 -2
  127. package/src/components/cli-support.test.ts +53 -0
  128. package/src/components/cli-support.ts +26 -4
  129. package/src/components/component.schema.json +17 -0
  130. package/src/components/component.ts +20 -0
  131. package/src/components/index.ts +1 -0
  132. package/src/components/registry.test.ts +1 -1
  133. package/src/components/release-run.test.ts +127 -0
  134. package/src/components/release-run.ts +188 -0
  135. package/src/components/starter-plugin.ts +5 -0
  136. package/src/components/unchanged-inputs.test.ts +98 -0
  137. package/src/components/unchanged-inputs.ts +151 -0
  138. package/src/components/verbs/index.ts +1 -0
  139. package/src/components/verbs/release-image.ts +52 -0
  140. package/src/config.ts +8 -0
  141. package/src/gate-statement.schema.json +4 -2
  142. package/src/lifecycle/delivery-metrics.ts +4 -2
  143. package/src/lifecycle/gate-ledger.ts +17 -2
  144. package/src/lifecycle/gate-seal.ts +24 -6
  145. package/src/lifecycle/gate-statement.ts +40 -4
  146. package/src/lifecycle/git.test.ts +15 -0
  147. package/src/lifecycle/git.ts +5 -1
  148. package/src/lifecycle/ledger-read.ts +1 -1
  149. package/src/lifecycle/plan-stale.test.ts +3 -4
  150. package/src/lifecycle/plan-stale.ts +1 -2
  151. package/src/lifecycle/publish-declaration.ts +24 -1
  152. package/src/lifecycle/publish-forge.ts +1 -2
  153. package/src/lifecycle/publish-git-ssh.ts +202 -0
  154. package/src/lifecycle/publish-homebrew.test.ts +181 -2
  155. package/src/lifecycle/publish-homebrew.ts +101 -6
  156. package/src/lifecycle/publish-marketplace.test.ts +158 -6
  157. package/src/lifecycle/publish-marketplace.ts +192 -31
  158. package/src/lifecycle/publish-resume.test.ts +40 -0
  159. package/src/lifecycle/publish-tauri.ts +1 -2
  160. package/src/lifecycle/query.ts +3 -3
  161. package/src/lifecycle/release-cut-lane.test.ts +195 -0
  162. package/src/lifecycle/release-cut-override.test.ts +225 -0
  163. package/src/lifecycle/release-cut.test.ts +45 -0
  164. package/src/lifecycle/release-cut.ts +262 -21
  165. package/src/lifecycle/release-ledger.ts +11 -0
  166. package/src/lifecycle/release-publish.ts +18 -0
  167. package/src/lifecycle/release-revocation.ts +5 -4
  168. package/src/lifecycle/release-store.ts +73 -5
  169. package/src/op/gate.ts +2 -1
  170. package/src/op/op-waves-run.ts +4 -2
  171. package/src/pr-forge.ts +25 -6
  172. package/src/pr-requires.test.ts +9 -0
  173. package/src/release-floors.ts +1 -1
  174. package/src/workspace/ci-green.ts +1 -2
  175. package/src/workspace/ci-quarantine-report.test.ts +2 -3
  176. package/src/workspace/ci-quarantine-report.ts +1 -2
  177. package/src/workspace/ci-quarantine.test.ts +2 -3
  178. package/src/workspace/ci-quarantine.ts +1 -2
  179. package/src/workspace/delivery-metrics.schema.json +1 -1
  180. package/src/workspace/delivery-metrics.test.ts +8 -0
  181. package/src/workspace/intent.ts +1 -2
  182. package/src/workspace/release-candidates.schema.json +7 -0
  183. package/src/workspace/release-candidates.ts +19 -5
  184. package/src/workspace/releases.schema.json +54 -2
  185. package/src/workspace/trust/gate-seal.test.ts +44 -0
@@ -77,6 +77,23 @@
77
77
  "lifecycle": { "type": "string", "minLength": 1, "description": "The git remote this environment's approvals, effect receipts and ledger records are pushed to." }
78
78
  }
79
79
  }
80
+ },
81
+ "inputs": {
82
+ "type": "object",
83
+ "description": "Optional: what a deploy of this component is made from (#4695). A run under a release (chant run --components --release) skips the component when these are the same as in the release the environment runs it from, and records the skip; --deploy-unchanged deploys it anyway. Omitted, the component deploys with every release. Read by chant 0.124.65 and newer.",
84
+ "additionalProperties": false,
85
+ "properties": {
86
+ "paths": {
87
+ "type": "array",
88
+ "description": "Git pathspecs, relative to the member's directory, that the component is built and deployed from. A change to any file they match between the two releases' commits deploys it. Magic such as :(exclude) and :(top) is git's.",
89
+ "items": { "type": "string", "minLength": 1 }
90
+ },
91
+ "params": {
92
+ "type": "array",
93
+ "description": "Build parameters, by name, whose values in the environment's target the component deploys from. A value that differs between the two releases deploys it.",
94
+ "items": { "type": "string", "minLength": 1 }
95
+ }
96
+ }
80
97
  }
81
98
  },
82
99
  "$defs": {
@@ -4,7 +4,7 @@
4
4
  * leaves have real implementations over an injectable `CloudExecutor` (#557);
5
5
  * every other verb remains a typed stub. See https://intentius.io/chant/components/orchestration/
6
6
  */
7
- export { type Archetype, type Wiring, type StackOutputReference, type BuildSpec, type Step, type Gate, type Phase, type Component, type ComponentEnvironmentDeclaration, phase, gate, stackOutput, inferArchetype, projectToJson, isComponent, } from "./component.js";
7
+ export { type Archetype, type Wiring, type StackOutputReference, type BuildSpec, type Step, type Gate, type Phase, type Component, type ComponentEnvironmentDeclaration, type ComponentInputs, phase, gate, stackOutput, inferArchetype, projectToJson, isComponent, } from "./component.js";
8
8
  export { type DiscoveredComponent, type ComponentDiscoveryResult, discoverComponents, } from "./discover.js";
9
9
  export { type ListedComponent, type ListComponentsResult, type DescribedComponent, type DescribeComponentResult, type ComponentGraphResult, type GenerateLexicon, type GenerateComponentsResult, type RunComponentsOptions, type RunComponentsResult, type ResolvedComponentTargets, listComponents, describeComponent, computeComponentGraph, generateComponentsPipeline, runComponents, findComponentGate, resolveComponentTargets, } from "./cli-support.js";
10
10
  export { renderDriverHuman, renderDriverJson } from "./driver-output.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,IAAI,EACT,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,+BAA+B,EACpC,KAAK,EACL,IAAI,EACJ,WAAW,EACX,cAAc,EACd,aAAa,EACb,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,aAAa,EACb,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,cAAc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BAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,IAAI,EACT,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,+BAA+B,EACpC,KAAK,eAAe,EACpB,KAAK,EACL,IAAI,EACJ,WAAW,EACX,cAAc,EACd,aAAa,EACb,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,aAAa,EACb,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,k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A0B,EAC1B,KAAK,gCAAgC,GACtC,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * A run of a release's own artifacts (#4694): `chant run --components <c>
3
+ * --env <e> --release <label>` deploys what the cut recorded, without
4
+ * building it again.
5
+ *
6
+ * The run is at the release's commit (`resolveRunRelease`, ../cli/handlers/run.ts),
7
+ * so each component's composition is the one the cut compiled. Before
8
+ * anything runs, each component the release recorded an artifact for has its
9
+ * build steps (`BUILD_STEP_KINDS`) taken out, as a promote takes them out
10
+ * (`withoutBuildSteps`, ./promote.ts), and a step that reads the output of
11
+ * one is refused:
12
+ *
13
+ * - an image handed to the cut (`chant release cut --image`, the artifact's
14
+ * `ref`) is already in its registry. Each `release-image` step of the
15
+ * component is given it, and each publish step is replaced by a
16
+ * `release-image` step that hands on the same image, since there is no
17
+ * archive to publish from;
18
+ * - an archive the cut built is published from where the cut wrote it, so the
19
+ * publish step stays and reads that file. A run where the file is not there
20
+ * is refused.
21
+ *
22
+ * A component with build steps whose artifact the release did not record, and
23
+ * one with a `release-image` step when the release recorded no image for it,
24
+ * are refused: the first would build again, the second has no image to run.
25
+ * A component with neither build steps nor a `release-image` step runs as
26
+ * declared. Every refusal is returned before anything runs.
27
+ */
28
+ import type { DriverComponent } from "./driver.js";
29
+ import type { Release } from "../lifecycle/release-store.js";
30
+ /** What a component's run under a release will do, for the run to print. */
31
+ export interface ReleaseRunNote {
32
+ component: string;
33
+ /** The build step kinds taken out. */
34
+ removed: string[];
35
+ /** The image the component runs, when one was handed to the cut. */
36
+ image?: string;
37
+ }
38
+ /**
39
+ * The compositions to run under `release`, or every reason a component can't
40
+ * be run from it. `memberDir` is where the cut's archive paths are read from.
41
+ */
42
+ export declare function releaseRunComponents(components: readonly DriverComponent[], release: Pick<Release, "releaseDigest" | "artifactDigests">, memberDir: string, label?: string | null): {
43
+ components: DriverComponent[];
44
+ notes: ReleaseRunNote[];
45
+ } | {
46
+ errors: string[];
47
+ };
48
+ //# sourceMappingURL=release-run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-run.d.ts","sourceRoot":"","sources":["../../src/components/release-run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAuC,MAAM,UAAU,CAAC;AACrF,OAAO,KAAK,EAAE,OAAO,EAAmB,MAAM,4BAA4B,CAAC;AA+E3E,4EAA4E;AAC5E,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,SAAS,eAAe,EAAE,EACtC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,iBAAiB,CAAC,EAC3D,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,MAAM,GAAG,IAAW,GAC1B;IAAE,UAAU,EAAE,eAAe,EAAE,CAAC;IAAC,KAAK,EAAE,cAAc,EAAE,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CA2DnF"}
@@ -0,0 +1,166 @@
1
+ /**
2
+ * A run of a release's own artifacts (#4694): `chant run --components <c>
3
+ * --env <e> --release <label>` deploys what the cut recorded, without
4
+ * building it again.
5
+ *
6
+ * The run is at the release's commit (`resolveRunRelease`, ../cli/handlers/run.ts),
7
+ * so each component's composition is the one the cut compiled. Before
8
+ * anything runs, each component the release recorded an artifact for has its
9
+ * build steps (`BUILD_STEP_KINDS`) taken out, as a promote takes them out
10
+ * (`withoutBuildSteps`, ./promote.ts), and a step that reads the output of
11
+ * one is refused:
12
+ *
13
+ * - an image handed to the cut (`chant release cut --image`, the artifact's
14
+ * `ref`) is already in its registry. Each `release-image` step of the
15
+ * component is given it, and each publish step is replaced by a
16
+ * `release-image` step that hands on the same image, since there is no
17
+ * archive to publish from;
18
+ * - an archive the cut built is published from where the cut wrote it, so the
19
+ * publish step stays and reads that file. A run where the file is not there
20
+ * is refused.
21
+ *
22
+ * A component with build steps whose artifact the release did not record, and
23
+ * one with a `release-image` step when the release recorded no image for it,
24
+ * are refused: the first would build again, the second has no image to run.
25
+ * A component with neither build steps nor a `release-image` step runs as
26
+ * declared. Every refusal is returned before anything runs.
27
+ */
28
+ import { existsSync } from "node:fs";
29
+ import { isAbsolute, resolve } from "node:path";
30
+ import { BUILD_STEP_KINDS, PUBLISH_STEP_KINDS } from "./promote.js";
31
+ import { parseWiringRef } from "../lint/rules/comp/support.js";
32
+ import { RELEASE_IMAGE_KIND } from "./verbs/release-image.js";
33
+ const isGate = (s) => s.kind === "gate";
34
+ const isPhase = (s) => typeof s.phase === "string" && Array.isArray(s.steps);
35
+ /** Every step of a composition, nested phases included. */
36
+ function stepsOf(phases) {
37
+ const out = [];
38
+ const walk = (phase) => {
39
+ for (const s of phase.steps) {
40
+ if (isPhase(s))
41
+ walk(s);
42
+ else if (!isGate(s))
43
+ out.push(s);
44
+ }
45
+ };
46
+ phases.forEach(walk);
47
+ return out;
48
+ }
49
+ /** The same phases with every step `fn` maps, nested phases included. */
50
+ function mapSteps(phases, fn) {
51
+ const map = (phase) => ({
52
+ ...phase,
53
+ steps: phase.steps.map((s) => (isPhase(s) ? map(s) : isGate(s) ? s : fn(s))),
54
+ });
55
+ return phases.map(map);
56
+ }
57
+ /** Every `@Phase.field` a step's fields read. */
58
+ function priorStepReads(step) {
59
+ const out = [];
60
+ const walk = (v) => {
61
+ if (typeof v === "string") {
62
+ const ref = parseWiringRef(v);
63
+ if (ref?.kind === "prior-step")
64
+ out.push({ phase: ref.phaseName, field: ref.field });
65
+ }
66
+ else if (Array.isArray(v))
67
+ v.forEach(walk);
68
+ else if (v && typeof v === "object" && !("stackOutput" in v))
69
+ Object.values(v).forEach(walk);
70
+ };
71
+ const { kind: _kind, ...fields } = step;
72
+ walk(fields);
73
+ return out;
74
+ }
75
+ /**
76
+ * `component` without its build steps, a phase left with nothing dropped, or
77
+ * why it can't be: a step left reads an output of a phase that held only
78
+ * build steps.
79
+ */
80
+ function withoutBuilds(component) {
81
+ const removed = [];
82
+ const emptied = new Set();
83
+ const strip = (phase) => {
84
+ const steps = [];
85
+ let lost = false;
86
+ for (const s of phase.steps) {
87
+ if (isPhase(s)) {
88
+ const nested = strip(s);
89
+ if (nested)
90
+ steps.push(nested);
91
+ }
92
+ else if (!isGate(s) && BUILD_STEP_KINDS.includes(s.kind)) {
93
+ removed.push(s.kind);
94
+ lost = true;
95
+ }
96
+ else
97
+ steps.push(s);
98
+ }
99
+ if (lost && !steps.some((s) => !isGate(s)))
100
+ emptied.add(phase.phase);
101
+ return steps.length > 0 ? { ...phase, steps } : undefined;
102
+ };
103
+ const deploy = component.deploy.map(strip).filter((p) => p !== undefined);
104
+ for (const step of stepsOf(deploy)) {
105
+ const read = priorStepReads(step).find((r) => emptied.has(r.phase));
106
+ if (read) {
107
+ return { error: `component "${component.name}" reads "@${read.phase}.${read.field}", an output of a build step a run under a release does not run` };
108
+ }
109
+ }
110
+ return { component: { ...component, deploy }, removed };
111
+ }
112
+ /**
113
+ * The compositions to run under `release`, or every reason a component can't
114
+ * be run from it. `memberDir` is where the cut's archive paths are read from.
115
+ */
116
+ export function releaseRunComponents(components, release, memberDir, label = null) {
117
+ const name = label ?? release.releaseDigest;
118
+ const errors = [];
119
+ const out = [];
120
+ const notes = [];
121
+ for (const component of components) {
122
+ const artifacts = release.artifactDigests.filter((a) => a.component === component.name);
123
+ const handed = artifacts.find((a) => typeof a.ref === "string");
124
+ const steps = stepsOf(component.deploy);
125
+ const builds = steps.some((s) => BUILD_STEP_KINDS.includes(s.kind));
126
+ const wantsImage = steps.some((s) => s.kind === RELEASE_IMAGE_KIND);
127
+ if (wantsImage && !handed) {
128
+ errors.push(`component "${component.name}" runs the image release ${name} recorded for it (a release-image step), and the release recorded none; ` +
129
+ `hand the cut its image: chant release cut <label> --image ${component.name}=<repository>@sha256:<hex>`);
130
+ continue;
131
+ }
132
+ if (!builds && !handed) {
133
+ out.push(component);
134
+ continue;
135
+ }
136
+ if (artifacts.length === 0) {
137
+ errors.push(`component "${component.name}" builds an artifact, and release ${name} recorded none for it, so the run would build it again; ` +
138
+ `cut a release that builds it, or hand the cut its image with --image`);
139
+ continue;
140
+ }
141
+ if (!handed) {
142
+ const missing = artifacts.filter((a) => a.path === "" || !existsSync(isAbsolute(a.path) ? a.path : resolve(memberDir, a.path)));
143
+ if (missing.length > 0) {
144
+ errors.push(`component "${component.name}": release ${name} built ${missing.map((a) => a.path || a.kind).join(", ")}, which is not here, so the run can't publish the release's own artifact; ` +
145
+ `run where the cut built it, or push the image and hand the cut its digest with --image`);
146
+ continue;
147
+ }
148
+ }
149
+ // An image handed to the cut is in its registry already: a publish step hands it on rather than pushing an archive.
150
+ const filled = handed
151
+ ? mapSteps(component.deploy, (s) => s.kind === RELEASE_IMAGE_KIND
152
+ ? { ...s, uri: handed.ref, digest: handed.digest }
153
+ : PUBLISH_STEP_KINDS.includes(s.kind)
154
+ ? { kind: RELEASE_IMAGE_KIND, uri: handed.ref, digest: handed.digest, replaces: s.kind }
155
+ : s)
156
+ : component.deploy;
157
+ const stripped = withoutBuilds({ ...component, deploy: filled });
158
+ if ("error" in stripped) {
159
+ errors.push(stripped.error);
160
+ continue;
161
+ }
162
+ out.push(stripped.component);
163
+ notes.push({ component: component.name, removed: stripped.removed, ...(handed ? { image: handed.ref } : {}) });
164
+ }
165
+ return errors.length > 0 ? { errors } : { components: out, notes };
166
+ }
@@ -45,6 +45,7 @@ export declare const STARTER_VERB_FAMILIES: {
45
45
  readonly escapeHatch: readonly ["shell"];
46
46
  readonly cloudflare: readonly ["wrangler-deploy", "wrangler-versions-promote", "r2-sync"];
47
47
  readonly engineOutputs: readonly ["member-outputs"];
48
+ readonly release: readonly ["release-image"];
48
49
  };
49
50
  /**
50
51
  * The built-in capability plugin carrying the entire Phase 1 starter verb
@@ -1 +1 @@
1
- {"version":3,"file":"starter-plugin.d.ts","sourceRoot":"","sources":["../../src/components/starter-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAyBH,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE/E;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB;aAChC,KAAK,YAAG,cAAc,EAAE,aAAa,EAAE,WAAW;aAIlD,IAAI,YAAG,eAAe;aAEtB,OAAO,YAAG,eAAe,EAAE,kBAAkB;aAC7C,mBAAmB,YAAG,MAAM,EAAE,mBAAmB,EAAE,QAAQ;aAC3D,iBAAiB,YAAG,sBAAsB,EAAE,WAAW;aAIvD,UAAU,YAAG,sBAAsB,EAAE,eAAe,EAAE,aAAa;aAGnE,OAAO,YAAG,eAAe;aACzB,WAAW,YAAG,OAAO;aAMrB,UAAU,YAAG,iBAAiB,EAAE,2BAA2B,EAAE,SAAS;aAItE,aAAa,YAAG,gBAAgB;CACxB,CAAC;AAkCX;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBAUrC,CAAC"}
1
+ {"version":3,"file":"starter-plugin.d.ts","sourceRoot":"","sources":["../../src/components/starter-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AA0BH,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE/E;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB;aAChC,KAAK,YAAG,cAAc,EAAE,aAAa,EAAE,WAAW;aAIlD,IAAI,YAAG,eAAe;aAEtB,OAAO,YAAG,eAAe,EAAE,kBAAkB;aAC7C,mBAAmB,YAAG,MAAM,EAAE,mBAAmB,EAAE,QAAQ;aAC3D,iBAAiB,YAAG,sBAAsB,EAAE,WAAW;aAIvD,UAAU,YAAG,sBAAsB,EAAE,eAAe,EAAE,aAAa;aAGnE,OAAO,YAAG,eAAe;aACzB,WAAW,YAAG,OAAO;aAMrB,UAAU,YAAG,iBAAiB,EAAE,2BAA2B,EAAE,SAAS;aAItE,aAAa,YAAG,gBAAgB;aAGhC,OAAO,YAAG,eAAe;CACjB,CAAC;AAmCX;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBAUrC,CAAC"}
@@ -25,7 +25,7 @@
25
25
  * from verb modules, so neither needed to change for this migration —
26
26
  * the compatibility guarantee #559 asks for.
27
27
  */
28
- import { dockerBuildCapability, zipPackageCapability, jvmBuildCapability, generateSbomCapability, publishImageCapability, publishArtifactCapability, signCapability, attestProvenanceCapability, verifyCapability, scanVulnerabilitiesCapability, vulnGateCapability, waitClusterHealthyCapability, waitEndpointCapability, healthGateCapability, shellCapability, ensureSecretCapability, wranglerDeployCapability, wranglerVersionsPromoteCapability, r2SyncCapability, memberOutputsStarterCapability, } from "./verbs/index.js";
28
+ import { dockerBuildCapability, zipPackageCapability, jvmBuildCapability, generateSbomCapability, publishImageCapability, publishArtifactCapability, signCapability, attestProvenanceCapability, verifyCapability, scanVulnerabilitiesCapability, vulnGateCapability, waitClusterHealthyCapability, waitEndpointCapability, healthGateCapability, shellCapability, ensureSecretCapability, wranglerDeployCapability, wranglerVersionsPromoteCapability, r2SyncCapability, memberOutputsStarterCapability, releaseImageCapability, } from "./verbs/index.js";
29
29
  import { ownPackageVersion } from "./capability-plugin.js";
30
30
  /**
31
31
  * Every `kind` in the starter verb set, grouped by family, per epic #551 and
@@ -63,6 +63,9 @@ export const STARTER_VERB_FAMILIES = {
63
63
  // (#4455). One agnostic verb; each engine's lexicon contributes a source
64
64
  // (`CapabilityPlugin.engineOutputSources`).
65
65
  engineOutputs: ["member-outputs"],
66
+ // The image a release recorded for the component, handed to the cut by
67
+ // digest (#4694); a run under the release fills it in.
68
+ release: ["release-image"],
66
69
  };
67
70
  /**
68
71
  * Every starter-set verb, in the same registration order Phase 1's
@@ -93,6 +96,7 @@ function starterCapabilities() {
93
96
  wranglerVersionsPromoteCapability,
94
97
  r2SyncCapability,
95
98
  memberOutputsStarterCapability,
99
+ releaseImageCapability,
96
100
  ];
97
101
  }
98
102
  /**
@@ -0,0 +1,81 @@
1
+ /**
2
+ * A component a release leaves alone (#4695): one whose declared inputs are
3
+ * the same as in the release the environment runs it from.
4
+ *
5
+ * Some deploys cost something even when nothing changed. Arugula's hub drops
6
+ * every relayed terminal when it restarts, and `fly-release` stamps each
7
+ * release's commit on the Machine, so every release would restart it. A
8
+ * component declares what it is made from (`inputs` on the component):
9
+ *
10
+ * ```ts
11
+ * inputs: {
12
+ * paths: ["../crates/control", "../web", ":(exclude)../web/e2e", "../Cargo.lock", "src/control.component.ts", "src/control.fly.ts"],
13
+ * params: ["region"],
14
+ * }
15
+ * ```
16
+ *
17
+ * and a run under a release (`chant run --components --release`) compares
18
+ * them with the release named by the environment's latest record of the
19
+ * component. The component is unchanged when:
20
+ *
21
+ * - git sees no change between the two releases' commits to a file the
22
+ * `paths` match, read as pathspecs from the member's directory;
23
+ * - each of the `params` has the same value in the two releases' targets for
24
+ * the environment;
25
+ * - the deploy files the two targets record for the component
26
+ * (`releaseTemplatesDigest`) are the same, so a change to what the
27
+ * component deploys is never skipped for want of a listed path.
28
+ *
29
+ * Anything that can't be compared deploys: no record of the component in the
30
+ * environment, a record made from no release, a release that isn't stored, a
31
+ * commit git doesn't have. `--deploy-unchanged` deploys it anyway.
32
+ *
33
+ * A skip is recorded ({@link unchangedRecord}): a release record of this
34
+ * release for the component that repeats the digest of the deploy it keeps
35
+ * and names that deploy in `unchangedSince`.
36
+ */
37
+ import type { ComponentInputs } from "./component.js";
38
+ import type { Release } from "../lifecycle/release-store.js";
39
+ import type { ReleaseRecord, ReleaseRecordInput, RunOrigin } from "../lifecycle/release-ledger.js";
40
+ /** The first chant that reads a component's `inputs` and writes `unchangedSince` on a release record (#4695). */
41
+ export declare const UNCHANGED_INPUTS_FLOOR = "0.124.65";
42
+ /** Whether a component's inputs are the same as in the release the environment runs it from. */
43
+ export type InputsVerdict = {
44
+ unchanged: true;
45
+ /** The environment's record of the deploy that stays. */
46
+ since: ReleaseRecord;
47
+ /** The environment's record already names this release: there is nothing new to record. */
48
+ recorded: boolean;
49
+ } | {
50
+ unchanged: false;
51
+ reason: string;
52
+ };
53
+ /** The files `paths` match that differ between two commits, or null when git can't tell. */
54
+ export type ChangedPaths = (from: string, to: string, paths: readonly string[]) => string[] | null;
55
+ /** {@link ChangedPaths} through `git diff`, with the pathspecs read from `memberDir`. */
56
+ export declare function gitChangedPaths(memberDir: string): ChangedPaths;
57
+ /** Compare `component`'s declared inputs in `release` with the release the environment's `current` record names. */
58
+ export declare function compareInputs(input: {
59
+ component: string;
60
+ inputs: ComponentInputs;
61
+ env: string;
62
+ release: Release;
63
+ /** The environment's latest record of the component, if it has one. */
64
+ current: ReleaseRecord | undefined;
65
+ readRelease: (digest: string) => Promise<Release | null>;
66
+ changedPaths: ChangedPaths;
67
+ }): Promise<InputsVerdict>;
68
+ /**
69
+ * The record of a skip (#4695): this release, for `since`'s component in its
70
+ * environment, repeating what that deploy recorded of its artifact and naming
71
+ * it in `unchangedSince`. Who approved that deploy is not repeated, since
72
+ * nothing was approved now.
73
+ */
74
+ export declare function unchangedRecord(since: ReleaseRecord, run: {
75
+ releaseDigest: string;
76
+ runId: string;
77
+ runOrigin?: RunOrigin;
78
+ timestamp: string;
79
+ actor: string;
80
+ }): ReleaseRecordInput;
81
+ //# sourceMappingURL=unchanged-inputs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unchanged-inputs.d.ts","sourceRoot":"","sources":["../../src/components/unchanged-inputs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EA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AE,GACrG,kBAAkB,CAiBpB"}
@@ -0,0 +1,122 @@
1
+ /**
2
+ * A component a release leaves alone (#4695): one whose declared inputs are
3
+ * the same as in the release the environment runs it from.
4
+ *
5
+ * Some deploys cost something even when nothing changed. Arugula's hub drops
6
+ * every relayed terminal when it restarts, and `fly-release` stamps each
7
+ * release's commit on the Machine, so every release would restart it. A
8
+ * component declares what it is made from (`inputs` on the component):
9
+ *
10
+ * ```ts
11
+ * inputs: {
12
+ * paths: ["../crates/control", "../web", ":(exclude)../web/e2e", "../Cargo.lock", "src/control.component.ts", "src/control.fly.ts"],
13
+ * params: ["region"],
14
+ * }
15
+ * ```
16
+ *
17
+ * and a run under a release (`chant run --components --release`) compares
18
+ * them with the release named by the environment's latest record of the
19
+ * component. The component is unchanged when:
20
+ *
21
+ * - git sees no change between the two releases' commits to a file the
22
+ * `paths` match, read as pathspecs from the member's directory;
23
+ * - each of the `params` has the same value in the two releases' targets for
24
+ * the environment;
25
+ * - the deploy files the two targets record for the component
26
+ * (`releaseTemplatesDigest`) are the same, so a change to what the
27
+ * component deploys is never skipped for want of a listed path.
28
+ *
29
+ * Anything that can't be compared deploys: no record of the component in the
30
+ * environment, a record made from no release, a release that isn't stored, a
31
+ * commit git doesn't have. `--deploy-unchanged` deploys it anyway.
32
+ *
33
+ * A skip is recorded ({@link unchangedRecord}): a release record of this
34
+ * release for the component that repeats the digest of the deploy it keeps
35
+ * and names that deploy in `unchangedSince`.
36
+ */
37
+ import { execFileSync } from "node:child_process";
38
+ import { releaseTemplatesDigest } from "./release-promote.js";
39
+ import { NEXT_RELEASE } from "../release-floors.js";
40
+ /** The first chant that reads a component's `inputs` and writes `unchangedSince` on a release record (#4695). */
41
+ export const UNCHANGED_INPUTS_FLOOR = NEXT_RELEASE;
42
+ /** {@link ChangedPaths} through `git diff`, with the pathspecs read from `memberDir`. */
43
+ export function gitChangedPaths(memberDir) {
44
+ return (from, to, paths) => {
45
+ try {
46
+ const out = execFileSync("git", ["diff", "--name-only", "--no-renames", from, to, "--", ...paths], {
47
+ cwd: memberDir,
48
+ encoding: "utf-8",
49
+ stdio: ["ignore", "pipe", "pipe"],
50
+ });
51
+ return out.split("\n").filter((l) => l !== "");
52
+ }
53
+ catch {
54
+ return null;
55
+ }
56
+ };
57
+ }
58
+ const shortDigest = (d) => d.replace(/^jcs1-sha256:/, "").slice(0, 12);
59
+ /** Compare `component`'s declared inputs in `release` with the release the environment's `current` record names. */
60
+ export async function compareInputs(input) {
61
+ const { component, inputs, env, release, current } = input;
62
+ const paths = inputs.paths ?? [];
63
+ const params = inputs.params ?? [];
64
+ if (paths.length === 0 && params.length === 0)
65
+ return { unchanged: false, reason: "it declares no paths or params in inputs" };
66
+ if (!current)
67
+ return { unchanged: false, reason: `"${env}" has no deploy of it` };
68
+ if (current.releaseDigest === undefined)
69
+ return { unchanged: false, reason: `the deploy "${env}" runs (run ${current.runId}) was not made from a release` };
70
+ if (current.releaseDigest === release.releaseDigest)
71
+ return { unchanged: true, since: current, recorded: true };
72
+ const prior = await input.readRelease(current.releaseDigest).catch(() => null);
73
+ if (!prior)
74
+ return { unchanged: false, reason: `release ${shortDigest(current.releaseDigest)}, which "${env}" runs it from, is not stored here` };
75
+ const before = prior.targets.find((t) => t.env === env);
76
+ const now = release.targets.find((t) => t.env === env);
77
+ if (!before || !now)
78
+ return { unchanged: false, reason: `release ${shortDigest((before ? release : prior).releaseDigest)} has no target for "${env}"` };
79
+ for (const name of params) {
80
+ const a = before.params.find((p) => p.name === name)?.value;
81
+ const b = now.params.find((p) => p.name === name)?.value;
82
+ if (a !== b)
83
+ return { unchanged: false, reason: `param ${name} is ${JSON.stringify(b)}, was ${JSON.stringify(a)}` };
84
+ }
85
+ if (releaseTemplatesDigest(before, component) !== releaseTemplatesDigest(now, component)) {
86
+ return { unchanged: false, reason: `the files its deploy reads in the "${env}" target changed` };
87
+ }
88
+ if (paths.length > 0 && prior.commit !== release.commit) {
89
+ const changed = input.changedPaths(prior.commit, release.commit, paths);
90
+ if (changed === null) {
91
+ return { unchanged: false, reason: `git can't compare ${prior.commit.slice(0, 12)} and ${release.commit.slice(0, 12)} here; fetch the history between them` };
92
+ }
93
+ if (changed.length > 0) {
94
+ return { unchanged: false, reason: `${changed.length} input file(s) changed since ${prior.commit.slice(0, 12)}, such as ${changed[0]}` };
95
+ }
96
+ }
97
+ return { unchanged: true, since: current, recorded: false };
98
+ }
99
+ /**
100
+ * The record of a skip (#4695): this release, for `since`'s component in its
101
+ * environment, repeating what that deploy recorded of its artifact and naming
102
+ * it in `unchangedSince`. Who approved that deploy is not repeated, since
103
+ * nothing was approved now.
104
+ */
105
+ export function unchangedRecord(since, run) {
106
+ return {
107
+ component: since.component,
108
+ env: since.env,
109
+ digest: since.digest,
110
+ gitSha: since.gitSha,
111
+ ...(since.manifestDigest !== undefined ? { manifestDigest: since.manifestDigest } : {}),
112
+ ...(since.inputDigest !== undefined ? { inputDigest: since.inputDigest } : {}),
113
+ ...(since.digestKind !== undefined ? { digestKind: since.digestKind } : {}),
114
+ ...(since.releaseVersion !== undefined ? { releaseVersion: since.releaseVersion } : {}),
115
+ runId: run.runId,
116
+ ...(run.runOrigin ? { runOrigin: run.runOrigin } : {}),
117
+ timestamp: run.timestamp,
118
+ actor: run.actor,
119
+ releaseDigest: run.releaseDigest,
120
+ unchangedSince: { env: since.env, runId: since.runId, timestamp: since.timestamp },
121
+ };
122
+ }
@@ -53,6 +53,7 @@ export * from "./run-agent.js";
53
53
  export * from "./wrangler.js";
54
54
  export * from "./r2-sync.js";
55
55
  export * from "./member-outputs.js";
56
+ export * from "./release-image.js";
56
57
  export * from "./vuln-scan.js";
57
58
  export * from "./vex.js";
58
59
  export * from "./license-policy.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/verbs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,S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C,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
@@ -53,6 +53,7 @@ export * from "./run-agent.js";
53
53
  export * from "./wrangler.js";
54
54
  export * from "./r2-sync.js";
55
55
  export * from "./member-outputs.js";
56
+ export * from "./release-image.js";
56
57
  export * from "./vuln-scan.js";
57
58
  export * from "./vex.js";
58
59
  export * from "./license-policy.js";
@@ -0,0 +1,36 @@
1
+ /**
2
+ * `release-image`: the image a release recorded for this component (#4694).
3
+ *
4
+ * A component whose image is built elsewhere, as by a CI job with a toolchain
5
+ * the deploy machine lacks, declares no build and no publish. The image is
6
+ * handed to the cut by digest (`chant release cut --image
7
+ * <component>=<repository>@sha256:<hex>`), and the step stands where a publish
8
+ * step would, so the steps after it read the image as they would a publish's:
9
+ *
10
+ * ```ts
11
+ * phase("Image", [{ kind: "release-image" }]),
12
+ * phase("Release", [{ kind: "fly-release", plan: "dist/fly.json", image: "@Image.uri", digest: "@Image.digest" }]),
13
+ * ```
14
+ *
15
+ * The step has nothing of its own to give. A run under a release
16
+ * (`chant run --components <c> --env <e> --release <label>`) fills in the
17
+ * image the release recorded (../release-run.ts), and a run of a release
18
+ * that recorded none is refused before anything runs. Outside a release the
19
+ * step fails, so a deploy never runs an image no release named.
20
+ */
21
+ import type { Capability } from "../capability.js";
22
+ export interface ReleaseImageInput {
23
+ /** The image, `<repository>@sha256:<hex>`. Filled in by a run under a release; not written by the component. */
24
+ uri?: string;
25
+ /** The image's digest. Filled in with `uri`. */
26
+ digest?: string;
27
+ }
28
+ export interface ReleaseImageOutput {
29
+ /** The image reference a deploy step runs. */
30
+ uri: string;
31
+ digest: string;
32
+ }
33
+ /** The kind of the step. */
34
+ export declare const RELEASE_IMAGE_KIND = "release-image";
35
+ export declare const releaseImageCapability: Capability<ReleaseImageInput, ReleaseImageOutput>;
36
+ //# sourceMappingURL=release-image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-image.d.ts","sourceRoot":"","sources":["../../../src/components/verbs/release-image.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,WAAW,iBAAiB;IAChC,gHAAgH;IAChH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,8CAA8C;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,4BAA4B;AAC5B,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAElD,eAAO,MAAM,sBAAsB,EAAE,UAAU,CAAC,iBAAiB,EAAE,kBAAkB,CAYpF,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * `release-image`: the image a release recorded for this component (#4694).
3
+ *
4
+ * A component whose image is built elsewhere, as by a CI job with a toolchain
5
+ * the deploy machine lacks, declares no build and no publish. The image is
6
+ * handed to the cut by digest (`chant release cut --image
7
+ * <component>=<repository>@sha256:<hex>`), and the step stands where a publish
8
+ * step would, so the steps after it read the image as they would a publish's:
9
+ *
10
+ * ```ts
11
+ * phase("Image", [{ kind: "release-image" }]),
12
+ * phase("Release", [{ kind: "fly-release", plan: "dist/fly.json", image: "@Image.uri", digest: "@Image.digest" }]),
13
+ * ```
14
+ *
15
+ * The step has nothing of its own to give. A run under a release
16
+ * (`chant run --components <c> --env <e> --release <label>`) fills in the
17
+ * image the release recorded (../release-run.ts), and a run of a release
18
+ * that recorded none is refused before anything runs. Outside a release the
19
+ * step fails, so a deploy never runs an image no release named.
20
+ */
21
+ /** The kind of the step. */
22
+ export const RELEASE_IMAGE_KIND = "release-image";
23
+ export const releaseImageCapability = {
24
+ kind: RELEASE_IMAGE_KIND,
25
+ rollbackPolicy: "none-by-design",
26
+ async run(ctx, input) {
27
+ if (typeof input?.uri !== "string" || typeof input.digest !== "string") {
28
+ throw new Error(`release-image: "${ctx.component}" deploys the image a release recorded for it, and this run names no release. ` +
29
+ `Run it under one: chant run --components ${ctx.component} --env ${ctx.env} --release <label>`);
30
+ }
31
+ return { uri: input.uri, digest: input.digest };
32
+ },
33
+ };