@intentius/chant 0.124.32 → 0.124.34

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 (320) hide show
  1. package/dist/ci-jobs.d.ts +4 -0
  2. package/dist/ci-jobs.d.ts.map +1 -1
  3. package/dist/ci-jobs.js +9 -2
  4. package/dist/cli/handlers/build.d.ts.map +1 -1
  5. package/dist/cli/handlers/build.js +18 -3
  6. package/dist/cli/handlers/lifecycle-health.d.ts +16 -0
  7. package/dist/cli/handlers/lifecycle-health.d.ts.map +1 -0
  8. package/dist/cli/handlers/lifecycle-health.js +150 -0
  9. package/dist/cli/handlers/lifecycle.d.ts +26 -0
  10. package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
  11. package/dist/cli/handlers/lifecycle.js +1 -1
  12. package/dist/cli/handlers/pr.d.ts +2 -0
  13. package/dist/cli/handlers/pr.d.ts.map +1 -1
  14. package/dist/cli/handlers/pr.js +124 -2
  15. package/dist/cli/handlers/promote.d.ts.map +1 -1
  16. package/dist/cli/handlers/promote.js +277 -74
  17. package/dist/cli/handlers/release.d.ts +16 -1
  18. package/dist/cli/handlers/release.d.ts.map +1 -1
  19. package/dist/cli/handlers/release.js +83 -11
  20. package/dist/cli/main.d.ts.map +1 -1
  21. package/dist/cli/main.js +99 -22
  22. package/dist/cli/parse-args.d.ts.map +1 -1
  23. package/dist/cli/parse-args.js +30 -1
  24. package/dist/cli/registry.d.ts +21 -5
  25. package/dist/cli/registry.d.ts.map +1 -1
  26. package/dist/components/deploy-inputs.d.ts +91 -0
  27. package/dist/components/deploy-inputs.d.ts.map +1 -0
  28. package/dist/components/deploy-inputs.js +184 -0
  29. package/dist/components/driver.d.ts.map +1 -1
  30. package/dist/components/driver.js +9 -0
  31. package/dist/components/gate-plan.d.ts +8 -0
  32. package/dist/components/gate-plan.d.ts.map +1 -1
  33. package/dist/components/gate-plan.js +6 -0
  34. package/dist/components/pr-pipeline.d.ts +33 -10
  35. package/dist/components/pr-pipeline.d.ts.map +1 -1
  36. package/dist/components/pr-pipeline.js +42 -11
  37. package/dist/components/pr-run.d.ts +1 -1
  38. package/dist/components/pr-run.d.ts.map +1 -1
  39. package/dist/components/promote-rounds.d.ts +102 -0
  40. package/dist/components/promote-rounds.d.ts.map +1 -0
  41. package/dist/components/promote-rounds.js +174 -0
  42. package/dist/components/release-compile.d.ts +37 -2
  43. package/dist/components/release-compile.d.ts.map +1 -1
  44. package/dist/components/release-compile.js +64 -8
  45. package/dist/components/release-gate.d.ts +30 -0
  46. package/dist/components/release-gate.d.ts.map +1 -1
  47. package/dist/components/release-gate.js +92 -42
  48. package/dist/components/release-promote.d.ts +17 -3
  49. package/dist/components/release-promote.d.ts.map +1 -1
  50. package/dist/components/release-promote.js +79 -18
  51. package/dist/components/verbs/bom-writer.d.ts +1 -1
  52. package/dist/components/verbs/bom-writer.d.ts.map +1 -1
  53. package/dist/components/verbs/lockfile-sbom-generator.d.ts +20 -0
  54. package/dist/components/verbs/lockfile-sbom-generator.d.ts.map +1 -1
  55. package/dist/components/verbs/lockfile-sbom-generator.js +41 -4
  56. package/dist/components/wave-plan.d.ts +10 -0
  57. package/dist/components/wave-plan.d.ts.map +1 -1
  58. package/dist/components/wave-plan.js +32 -4
  59. package/dist/graph-declared.d.ts +4 -0
  60. package/dist/graph-declared.d.ts.map +1 -1
  61. package/dist/graph-declared.js +11 -1
  62. package/dist/graph-detail.d.ts.map +1 -1
  63. package/dist/graph-detail.js +32 -7
  64. package/dist/health.d.ts +110 -0
  65. package/dist/health.d.ts.map +1 -0
  66. package/dist/health.js +105 -0
  67. package/dist/health.schema.json +191 -0
  68. package/dist/lexicon.d.ts +27 -0
  69. package/dist/lexicon.d.ts.map +1 -1
  70. package/dist/lifecycle/merge-record.d.ts +104 -0
  71. package/dist/lifecycle/merge-record.d.ts.map +1 -0
  72. package/dist/lifecycle/merge-record.js +102 -0
  73. package/dist/lifecycle/publish-attachments.d.ts +8 -5
  74. package/dist/lifecycle/publish-attachments.d.ts.map +1 -1
  75. package/dist/lifecycle/publish-attachments.js +27 -13
  76. package/dist/lifecycle/publish-npm.d.ts +3 -2
  77. package/dist/lifecycle/publish-npm.d.ts.map +1 -1
  78. package/dist/lifecycle/publish-npm.js +4 -3
  79. package/dist/lifecycle/release-at.d.ts +40 -0
  80. package/dist/lifecycle/release-at.d.ts.map +1 -0
  81. package/dist/lifecycle/release-at.js +83 -0
  82. package/dist/lifecycle/release-cut.d.ts.map +1 -1
  83. package/dist/lifecycle/release-cut.js +23 -12
  84. package/dist/lifecycle/release-publish.d.ts +28 -12
  85. package/dist/lifecycle/release-publish.d.ts.map +1 -1
  86. package/dist/lifecycle/release-publish.js +29 -17
  87. package/dist/lifecycle/release-store.d.ts +25 -2
  88. package/dist/lifecycle/release-store.d.ts.map +1 -1
  89. package/dist/lifecycle/release-store.js +40 -13
  90. package/dist/lifecycle/run-ledger.d.ts.map +1 -1
  91. package/dist/lifecycle/run-ledger.js +1 -0
  92. package/dist/lint/rules/op/index.d.ts +2 -1
  93. package/dist/lint/rules/op/index.d.ts.map +1 -1
  94. package/dist/lint/rules/op/index.js +4 -2
  95. package/dist/lint/rules/op/ops018-shell-image-digest.d.ts +10 -0
  96. package/dist/lint/rules/op/ops018-shell-image-digest.d.ts.map +1 -0
  97. package/dist/lint/rules/op/ops018-shell-image-digest.js +38 -0
  98. package/dist/op/activities/activity-contracts.d.ts +5 -0
  99. package/dist/op/activities/activity-contracts.d.ts.map +1 -1
  100. package/dist/op/activities/activity-contracts.js +3 -0
  101. package/dist/op/activities/shell.d.ts +38 -0
  102. package/dist/op/activities/shell.d.ts.map +1 -1
  103. package/dist/op/activities/shell.js +89 -3
  104. package/dist/op/builders.d.ts +7 -0
  105. package/dist/op/builders.d.ts.map +1 -1
  106. package/dist/op/builders.js +7 -0
  107. package/dist/op/runtime.d.ts +2 -0
  108. package/dist/op/runtime.d.ts.map +1 -1
  109. package/dist/pr-loop.d.ts +14 -3
  110. package/dist/pr-loop.d.ts.map +1 -1
  111. package/dist/pr-loop.js +15 -5
  112. package/dist/pr-report-url.d.ts +2 -2
  113. package/dist/pr-report-url.d.ts.map +1 -1
  114. package/dist/runner-start.d.ts +179 -0
  115. package/dist/runner-start.d.ts.map +1 -0
  116. package/dist/runner-start.js +277 -0
  117. package/dist/wave-runtime.mjs +236 -229
  118. package/dist/workspace/__fixtures__/contract-repo.d.ts.map +1 -1
  119. package/dist/workspace/__fixtures__/contract-repo.js +13 -2
  120. package/dist/workspace/check.schema.json +88 -2
  121. package/dist/workspace/checks/ci-workflow.d.ts +17 -0
  122. package/dist/workspace/checks/ci-workflow.d.ts.map +1 -0
  123. package/dist/workspace/checks/ci-workflow.js +123 -0
  124. package/dist/workspace/checks/security.d.ts +50 -0
  125. package/dist/workspace/checks/security.d.ts.map +1 -0
  126. package/dist/workspace/checks/security.js +305 -0
  127. package/dist/workspace/checks.d.ts +2 -0
  128. package/dist/workspace/checks.d.ts.map +1 -1
  129. package/dist/workspace/checks.js +8 -0
  130. package/dist/workspace/ci-builds.d.ts +163 -0
  131. package/dist/workspace/ci-builds.d.ts.map +1 -0
  132. package/dist/workspace/ci-builds.js +315 -0
  133. package/dist/workspace/ci-green-cli.d.ts +2 -1
  134. package/dist/workspace/ci-green-cli.d.ts.map +1 -1
  135. package/dist/workspace/ci-green-cli.js +25 -5
  136. package/dist/workspace/ci-green-forge.d.ts +12 -0
  137. package/dist/workspace/ci-green-forge.d.ts.map +1 -1
  138. package/dist/workspace/ci-green-forge.js +12 -0
  139. package/dist/workspace/ci-green-workflow.d.ts +55 -1
  140. package/dist/workspace/ci-green-workflow.d.ts.map +1 -1
  141. package/dist/workspace/ci-green-workflow.js +128 -1
  142. package/dist/workspace/ci-green.d.ts +89 -4
  143. package/dist/workspace/ci-green.d.ts.map +1 -1
  144. package/dist/workspace/ci-green.js +310 -23
  145. package/dist/workspace/ci-init.d.ts +100 -0
  146. package/dist/workspace/ci-init.d.ts.map +1 -0
  147. package/dist/workspace/ci-init.js +434 -0
  148. package/dist/workspace/ci-last-green.schema.json +49 -0
  149. package/dist/workspace/ci-list.schema.json +35 -1
  150. package/dist/workspace/ci-run-index.d.ts +1 -1
  151. package/dist/workspace/ci-run-index.d.ts.map +1 -1
  152. package/dist/workspace/ci-run-index.schema.json +1 -1
  153. package/dist/workspace/ci-run.d.ts +12 -6
  154. package/dist/workspace/ci-run.d.ts.map +1 -1
  155. package/dist/workspace/ci-run.js +72 -16
  156. package/dist/workspace/ci-runner-start.d.ts +77 -0
  157. package/dist/workspace/ci-runner-start.d.ts.map +1 -0
  158. package/dist/workspace/ci-runner-start.js +185 -0
  159. package/dist/workspace/ci-serve.d.ts +76 -7
  160. package/dist/workspace/ci-serve.d.ts.map +1 -1
  161. package/dist/workspace/ci-serve.js +153 -19
  162. package/dist/workspace/ci-workflow.d.ts +91 -0
  163. package/dist/workspace/ci-workflow.d.ts.map +1 -0
  164. package/dist/workspace/ci-workflow.js +33 -0
  165. package/dist/workspace/declaration.d.ts +35 -0
  166. package/dist/workspace/declaration.d.ts.map +1 -1
  167. package/dist/workspace/declaration.js +12 -2
  168. package/dist/workspace/declaration.schema.json +51 -0
  169. package/dist/workspace/init.js +2 -2
  170. package/dist/workspace/ls.d.ts +2 -0
  171. package/dist/workspace/ls.d.ts.map +1 -1
  172. package/dist/workspace/ls.js +1 -1
  173. package/dist/workspace/ls.schema.json +2 -1
  174. package/dist/workspace/member-pipeline.d.ts +1 -0
  175. package/dist/workspace/member-pipeline.d.ts.map +1 -1
  176. package/dist/workspace/member-pipeline.js +2 -0
  177. package/dist/workspace/merge-record.schema.json +49 -0
  178. package/dist/workspace/pr-report.schema.json +3 -3
  179. package/dist/workspace/reason-codes.d.ts +26 -0
  180. package/dist/workspace/reason-codes.d.ts.map +1 -1
  181. package/dist/workspace/reason-codes.js +28 -0
  182. package/dist/workspace/release-candidates.d.ts +129 -0
  183. package/dist/workspace/release-candidates.d.ts.map +1 -0
  184. package/dist/workspace/release-candidates.js +233 -0
  185. package/dist/workspace/release-candidates.schema.json +353 -0
  186. package/dist/workspace/release-workflow.d.ts +31 -0
  187. package/dist/workspace/release-workflow.d.ts.map +1 -0
  188. package/dist/workspace/release-workflow.js +150 -0
  189. package/dist/workspace/security.d.ts +40 -0
  190. package/dist/workspace/security.d.ts.map +1 -0
  191. package/dist/workspace/security.js +99 -0
  192. package/package.json +8 -1
  193. package/src/__fixtures__/pr-loop/pr-plan.note.golden.md +1 -1
  194. package/src/ci-jobs.ts +11 -2
  195. package/src/cli/handlers/build.test.ts +36 -0
  196. package/src/cli/handlers/build.ts +18 -3
  197. package/src/cli/handlers/lifecycle-health.test.ts +123 -0
  198. package/src/cli/handlers/lifecycle-health.ts +157 -0
  199. package/src/cli/handlers/lifecycle.ts +1 -1
  200. package/src/cli/handlers/pr-deploy-inputs.test.ts +209 -0
  201. package/src/cli/handlers/pr-record.test.ts +201 -0
  202. package/src/cli/handlers/pr.test.ts +22 -0
  203. package/src/cli/handlers/pr.ts +127 -4
  204. package/src/cli/handlers/promote.test.ts +17 -0
  205. package/src/cli/handlers/promote.ts +296 -84
  206. package/src/cli/handlers/release-cut-at.e2e.test.ts +115 -0
  207. package/src/cli/handlers/release-publish-targets.e2e.test.ts +2 -2
  208. package/src/cli/handlers/release-verify.e2e.test.ts +12 -10
  209. package/src/cli/handlers/release.e2e.test.ts +19 -28
  210. package/src/cli/handlers/release.ts +81 -11
  211. package/src/cli/main.ts +99 -22
  212. package/src/cli/parse-args.ts +22 -1
  213. package/src/cli/registry.ts +21 -5
  214. package/src/components/deploy-inputs.test.ts +108 -0
  215. package/src/components/deploy-inputs.ts +225 -0
  216. package/src/components/driver.ts +11 -0
  217. package/src/components/gate-plan.ts +9 -0
  218. package/src/components/pr-pipeline.ts +56 -15
  219. package/src/components/pr-run.ts +1 -1
  220. package/src/components/promote-rounds.test.ts +220 -0
  221. package/src/components/promote-rounds.ts +232 -0
  222. package/src/components/release-compile.test.ts +34 -0
  223. package/src/components/release-compile.ts +89 -8
  224. package/src/components/release-gate.test.ts +47 -0
  225. package/src/components/release-gate.ts +111 -46
  226. package/src/components/release-promote.test.ts +55 -2
  227. package/src/components/release-promote.ts +93 -23
  228. package/src/components/verbs/bom-writer.ts +1 -1
  229. package/src/components/verbs/lockfile-sbom-generator.test.ts +36 -0
  230. package/src/components/verbs/lockfile-sbom-generator.ts +43 -5
  231. package/src/components/wave-plan.ts +32 -4
  232. package/src/graph-declared-exports.test.ts +40 -0
  233. package/src/graph-declared.ts +9 -1
  234. package/src/graph-detail.test.ts +57 -0
  235. package/src/graph-detail.ts +33 -7
  236. package/src/health.schema.json +191 -0
  237. package/src/health.test.ts +62 -0
  238. package/src/health.ts +178 -0
  239. package/src/lexicon.ts +41 -1
  240. package/src/lifecycle/merge-record.test.ts +111 -0
  241. package/src/lifecycle/merge-record.ts +154 -0
  242. package/src/lifecycle/publish-attachments.ts +25 -13
  243. package/src/lifecycle/publish-npm.ts +4 -3
  244. package/src/lifecycle/publish-targets.test.ts +34 -4
  245. package/src/lifecycle/release-at.test.ts +48 -0
  246. package/src/lifecycle/release-at.ts +100 -0
  247. package/src/lifecycle/release-cut.test.ts +41 -0
  248. package/src/lifecycle/release-cut.ts +22 -11
  249. package/src/lifecycle/release-publish.test.ts +43 -13
  250. package/src/lifecycle/release-publish.ts +38 -18
  251. package/src/lifecycle/release-store.ts +57 -13
  252. package/src/lifecycle/run-ledger.test.ts +13 -0
  253. package/src/lifecycle/run-ledger.ts +1 -0
  254. package/src/lint/rules/op/index.ts +4 -2
  255. package/src/lint/rules/op/ops018-shell-image-digest.test.ts +60 -0
  256. package/src/lint/rules/op/ops018-shell-image-digest.ts +48 -0
  257. package/src/op/activities/activity-contracts.ts +3 -0
  258. package/src/op/activities/shell-container.e2e.test.ts +67 -0
  259. package/src/op/activities/shell.test.ts +44 -1
  260. package/src/op/activities/shell.ts +110 -3
  261. package/src/op/builders.ts +7 -0
  262. package/src/op/runtime.ts +2 -0
  263. package/src/op/step-console.test.ts +4 -2
  264. package/src/pr-loop.test.ts +29 -0
  265. package/src/pr-loop.ts +26 -7
  266. package/src/pr-report-url.ts +2 -2
  267. package/src/runner-start-bundle.test.ts +29 -0
  268. package/src/runner-start.test.ts +179 -0
  269. package/src/runner-start.ts +329 -0
  270. package/src/workspace/__fixtures__/contract-repo.ts +11 -2
  271. package/src/workspace/check-contract.test.ts +4 -2
  272. package/src/workspace/check.schema.json +88 -2
  273. package/src/workspace/checks/ci-workflow.test.ts +150 -0
  274. package/src/workspace/checks/ci-workflow.ts +129 -0
  275. package/src/workspace/checks/security.test.ts +138 -0
  276. package/src/workspace/checks/security.ts +305 -0
  277. package/src/workspace/checks.ts +8 -0
  278. package/src/workspace/ci-builds.e2e.test.ts +208 -0
  279. package/src/workspace/ci-builds.test.ts +174 -0
  280. package/src/workspace/ci-builds.ts +385 -0
  281. package/src/workspace/ci-green-builds.test.ts +180 -0
  282. package/src/workspace/ci-green-cli.test.ts +54 -0
  283. package/src/workspace/ci-green-cli.ts +26 -5
  284. package/src/workspace/ci-green-forge.ts +24 -0
  285. package/src/workspace/ci-green-workflow.test.ts +84 -1
  286. package/src/workspace/ci-green-workflow.ts +139 -2
  287. package/src/workspace/ci-green.test.ts +5 -2
  288. package/src/workspace/ci-green.ts +359 -27
  289. package/src/workspace/ci-init.test.ts +159 -0
  290. package/src/workspace/ci-init.ts +445 -0
  291. package/src/workspace/ci-last-green.schema.json +49 -0
  292. package/src/workspace/ci-list.schema.json +35 -1
  293. package/src/workspace/ci-report-url.test.ts +6 -1
  294. package/src/workspace/ci-run-index.schema.json +1 -1
  295. package/src/workspace/ci-run-index.ts +1 -1
  296. package/src/workspace/ci-run.test.ts +24 -7
  297. package/src/workspace/ci-run.ts +78 -16
  298. package/src/workspace/ci-runner-start.test.ts +151 -0
  299. package/src/workspace/ci-runner-start.ts +193 -0
  300. package/src/workspace/ci-serve-builds.test.ts +86 -0
  301. package/src/workspace/ci-serve.test.ts +59 -0
  302. package/src/workspace/ci-serve.ts +177 -22
  303. package/src/workspace/ci-workflow.ts +71 -0
  304. package/src/workspace/declaration.schema.json +51 -0
  305. package/src/workspace/declaration.test.ts +17 -0
  306. package/src/workspace/declaration.ts +53 -3
  307. package/src/workspace/init.ts +2 -2
  308. package/src/workspace/ls.schema.json +2 -1
  309. package/src/workspace/ls.ts +3 -2
  310. package/src/workspace/member-pipeline.ts +2 -1
  311. package/src/workspace/merge-record.schema.json +49 -0
  312. package/src/workspace/pr-report.schema.json +3 -3
  313. package/src/workspace/reason-codes.test.ts +4 -0
  314. package/src/workspace/reason-codes.ts +28 -0
  315. package/src/workspace/release-candidates.schema.json +353 -0
  316. package/src/workspace/release-candidates.test.ts +106 -0
  317. package/src/workspace/release-candidates.ts +315 -0
  318. package/src/workspace/release-workflow.ts +167 -0
  319. package/src/workspace/security.test.ts +70 -0
  320. package/src/workspace/security.ts +118 -0
package/dist/ci-jobs.d.ts CHANGED
@@ -199,6 +199,10 @@ export declare const GITLAB_SCHEDULE_SOURCE = "$CI_PIPELINE_SOURCE == \"schedule
199
199
  export declare const GITLAB_FULL_HISTORY: {
200
200
  readonly GIT_DEPTH: "0";
201
201
  };
202
+ /** The tags a build request is pushed as (#4169), as a glob for a trigger. */
203
+ export declare const BUILD_REQUEST_TAGS = "ci/build/**";
204
+ /** The `rules:` if-expression for a build request's tag (#4169). */
205
+ export declare const GITLAB_BUILD_REQUEST_RULE = "$CI_COMMIT_TAG =~ /^ci\\/build\\//";
202
206
  /** The `rules:` if-expression for a push to `branch`, a quoted name or an expression such as `$CI_DEFAULT_BRANCH`. */
203
207
  export declare function gitlabPushRule(branch: string): string;
204
208
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ci-jobs.d.ts","sourceRoot":"","sources":["../src/ci-jobs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAItF;;;;GAIG;A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GE_REQUEST_SOURCE = '$CI_PIPELINE_SOURCE == "merge_reques
356
356
  export const GITLAB_SCHEDULE_SOURCE = '$CI_PIPELINE_SOURCE == "schedule"';
357
357
  /** A job variable that makes the runner clone the whole history, which a job reading the base commit needs. */
358
358
  export const GITLAB_FULL_HISTORY = { GIT_DEPTH: "0" };
359
+ /** The tags a build request is pushed as (#4169), as a glob for a trigger. */
360
+ export const BUILD_REQUEST_TAGS = "ci/build/**";
361
+ /** The `rules:` if-expression for a build request's tag (#4169). */
362
+ export const GITLAB_BUILD_REQUEST_RULE = "$CI_COMMIT_TAG =~ /^ci\\/build\\//";
359
363
  /** The `rules:` if-expression for a push to `branch`, a quoted name or an expression such as `$CI_DEFAULT_BRANCH`. */
360
364
  export function gitlabPushRule(branch) {
361
365
  return `$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == ${branch}`;
@@ -398,11 +402,14 @@ export function gitlabRules(subject, trigger, selector) {
398
402
  return { if: `${GITLAB_MERGE_REQUEST_SOURCE} && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "${branch}"` };
399
403
  });
400
404
  }
401
- case "push":
402
- return pushBranches(trigger.branches).map((branch) => {
405
+ case "push": {
406
+ const rules = pushBranches(trigger.branches).map((branch) => {
403
407
  assertGitlabBranch(subject, branch);
404
408
  return { if: gitlabPushRule(JSON.stringify(branch)) };
405
409
  });
410
+ // #4169: a newest build also runs at each build request's tag.
411
+ return trigger.build === "newest" ? [...rules, { if: GITLAB_BUILD_REQUEST_RULE }] : rules;
412
+ }
406
413
  }
407
414
  }
408
415
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/build.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAuMlD,wBAAsB,QAAQ,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsJnE"}
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/build.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAsNlD,wBAAsB,QAAQ,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsJnE"}
@@ -14,8 +14,12 @@ import { resolvePromotionSource } from "../../components/promote-order.js";
14
14
  * flags the generated jobs pass to pr-plan and pr-apply. `--pr-build` and
15
15
  * `--pr-build-command` (#4088) add the build and lint steps before both.
16
16
  * `reportUrl` is `--report-url`, else the workspace's `ci.reportUrl` (#4160).
17
+ * `requireReview` is `--require-review`, or a workspace that opts into the
18
+ * `review-rules` security group (#4168); off otherwise. `requireRunnerStart`
19
+ * is `--require-runner-start`, or the `isolated-runners` group. `--apply-on-merge`
20
+ * (#4168) writes the apply job on merge in place of the record job.
17
21
  */
18
- function prLoopOption(args, reportUrl) {
22
+ function prLoopOption(args, reportUrl, requireReview = false, requireRunnerStart = false) {
19
23
  return {
20
24
  ...(args.gate ? { gate: args.gate } : {}),
21
25
  ...(args.branch ? { branch: args.branch } : {}),
@@ -23,6 +27,9 @@ function prLoopOption(args, reportUrl) {
23
27
  ...(reportUrl ? { reportUrl } : {}),
24
28
  ...(args.prBuild ? { build: true } : {}),
25
29
  ...(args.prBuildCommand ? { buildCommand: args.prBuildCommand } : {}),
30
+ ...(args.requireReview === true || requireReview ? { requireReview: true } : {}),
31
+ ...(args.requireRunnerStart === true || requireRunnerStart ? { requireRunnerStart: true } : {}),
32
+ ...(args.applyOnMerge ? { applyOnMerge: true } : {}),
26
33
  };
27
34
  }
28
35
  /**
@@ -97,6 +104,14 @@ async function runGenerateComponents(ctx) {
97
104
  return 1;
98
105
  }
99
106
  }
107
+ // #4168: the review-rules group turns on --require-review in the generated apply. Read only inside a workspace.
108
+ let reviewRules = false;
109
+ let isolatedRunners = false;
110
+ if (found && args.prLoop) {
111
+ const groups = (await import("../../workspace/security.js")).securityGroupsAt(resolve(args.path));
112
+ reviewRules = groups.has("review-rules");
113
+ isolatedRunners = groups.has("isolated-runners");
114
+ }
100
115
  if (found) {
101
116
  memberPipeline = await import("../../workspace/member-pipeline.js");
102
117
  try {
@@ -111,7 +126,7 @@ async function runGenerateComponents(ctx) {
111
126
  params: args.param,
112
127
  paramsFile: args.paramsFile,
113
128
  ...(args.waveGate ? { waveGate: { gate: args.waveGate, ...(args.canary?.length ? { canary: args.canary } : {}), ...(args.base ? { base: args.base } : {}) } } : {}),
114
- ...(args.prLoop ? { prLoop: prLoopOption(args, reportUrl) } : {}),
129
+ ...(args.prLoop ? { prLoop: prLoopOption(args, reportUrl, reviewRules, isolatedRunners) } : {}),
115
130
  ...(args.image ? { image: args.image } : {}),
116
131
  ...(args.beforeScript?.length ? { beforeScript: args.beforeScript } : {}),
117
132
  });
@@ -138,7 +153,7 @@ async function runGenerateComponents(ctx) {
138
153
  ? { gatedWaves: { gate: args.waveGate, ...(args.canary?.length ? { canary: args.canary } : {}), ...(args.base ? { base: args.base } : {}) } }
139
154
  : {}),
140
155
  // #3183: a plan job per pull request and an apply job per merge.
141
- ...(args.prLoop ? { prLoop: prLoopOption(args, reportUrl) } : {}),
156
+ ...(args.prLoop ? { prLoop: prLoopOption(args, reportUrl, reviewRules, isolatedRunners) } : {}),
142
157
  // #4002: the job image and the lines that install what it lacks, chant itself included.
143
158
  ...(args.image ? { image: args.image } : {}),
144
159
  ...(args.beforeScript?.length ? { beforeScript: args.beforeScript } : {}),
@@ -0,0 +1,16 @@
1
+ /**
2
+ * `chant lifecycle health <env> [lexicon] [--json]` (#4177): whether each
3
+ * declared resource that has a health read is up, separate from drift.
4
+ *
5
+ * It builds the project as `lifecycle diff` does, so the entity names are the
6
+ * graph's node ids, then asks each lexicon with a health read about the
7
+ * entities whose types it names. An environment's declared endpoint is applied
8
+ * for the read, as on the other live reads (#1166).
9
+ *
10
+ * The JSON is the {@link HEALTH_SCHEMA} shape. A single-stack project prints
11
+ * `lexicons` at the top level; a multi-stack one nests them under `stacks`,
12
+ * the same split `lifecycle diff --live --json` makes.
13
+ */
14
+ import type { CommandContext } from "../registry.js";
15
+ export declare function runLifecycleHealth(ctx: CommandContext): Promise<number>;
16
+ //# sourceMappingURL=lifecycle-health.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle-health.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/lifecycle-health.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAaH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAKlD,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiH7E"}
@@ -0,0 +1,150 @@
1
+ /**
2
+ * `chant lifecycle health <env> [lexicon] [--json]` (#4177): whether each
3
+ * declared resource that has a health read is up, separate from drift.
4
+ *
5
+ * It builds the project as `lifecycle diff` does, so the entity names are the
6
+ * graph's node ids, then asks each lexicon with a health read about the
7
+ * entities whose types it names. An environment's declared endpoint is applied
8
+ * for the read, as on the other live reads (#1166).
9
+ *
10
+ * The JSON is the {@link HEALTH_SCHEMA} shape. A single-stack project prints
11
+ * `lexicons` at the top level; a multi-stack one nests them under `stacks`,
12
+ * the same split `lifecycle diff --live --json` makes.
13
+ */
14
+ import { resolve } from "node:path";
15
+ import { build } from "../../build.js";
16
+ import { loadChantConfig } from "../../config.js";
17
+ import { isObservableDeclarable } from "../../declarable.js";
18
+ import { HEALTH_SCHEMA, healthApplicable, observeHealthFor, summarizeHealth } from "../../health.js";
19
+ import { applyLiveEndpoint } from "../../live-endpoint.js";
20
+ import { CHANT_VERSION } from "../version.js";
21
+ import { commandBuildParams } from "../build-params-cli.js";
22
+ import { resolveBuildModes, resolveProjectBuildOptions } from "../build-options.js";
23
+ import { formatBold, formatError, formatWarning } from "../format.js";
24
+ import { resolveStackTargets } from "./lifecycle.js";
25
+ export async function runLifecycleHealth(ctx) {
26
+ const { args, plugins } = ctx;
27
+ const environment = args.extraPositional;
28
+ const lexiconFilter = args.extraPositional2;
29
+ if (!environment) {
30
+ console.error(formatError({ message: "Environment is required: chant lifecycle health <environment> [lexicon]" }));
31
+ return 1;
32
+ }
33
+ const readers = plugins.filter((p) => p.observeHealth && (p.healthTypes?.length ?? 0) > 0 && (!lexiconFilter || p.name === lexiconFilter));
34
+ if (readers.length === 0) {
35
+ console.error(formatWarning({
36
+ message: lexiconFilter
37
+ ? `${lexiconFilter}: no health read in this lexicon`
38
+ : "No configured lexicon has a health read (aws, azure and gcp do)",
39
+ }));
40
+ return 1;
41
+ }
42
+ const projectRoot = resolve(".");
43
+ const { config } = await loadChantConfig(projectRoot);
44
+ const declaredParams = await commandBuildParams(config.buildParams, args);
45
+ if (!declaredParams)
46
+ return 1;
47
+ const targets = resolveStackTargets(args, config);
48
+ const buildOptions = resolveProjectBuildOptions({
49
+ config,
50
+ configDir: projectRoot,
51
+ plugins,
52
+ modes: resolveBuildModes(config, { fold: args.fold, sandbox: args.sandbox }),
53
+ buildParams: declaredParams,
54
+ });
55
+ const serializers = readers.map((p) => p.serializer);
56
+ const endpoint = applyLiveEndpoint(config.environments, environment, readers);
57
+ if (endpoint.notice)
58
+ console.error(formatWarning({ message: endpoint.notice }));
59
+ const perStack = {};
60
+ let single;
61
+ let anyBuildError = false;
62
+ const observedAt = new Date().toISOString();
63
+ try {
64
+ for (const target of targets) {
65
+ const buildResult = await build(target.root, serializers, undefined, buildOptions);
66
+ if (buildResult.errors.length > 0) {
67
+ console.error(formatError({
68
+ message: `Build failed for ${target.stack ? `stack "${target.stack}"` : "project"}; fix errors before reading health`,
69
+ }));
70
+ anyBuildError = true;
71
+ continue;
72
+ }
73
+ const byLexicon = {};
74
+ for (const plugin of readers) {
75
+ const declared = new Map();
76
+ for (const [name, entity] of buildResult.entities) {
77
+ if (entity.lexicon === plugin.name && isObservableDeclarable(entity)) {
78
+ declared.set(name, {
79
+ entityType: entity.entityType,
80
+ props: (entity.props != null ? entity.props : {}),
81
+ });
82
+ }
83
+ }
84
+ const entities = healthApplicable(plugin, declared);
85
+ if (entities.size === 0)
86
+ continue;
87
+ const raw = buildResult.outputs.get(plugin.name);
88
+ const buildOutput = raw === undefined ? "" : typeof raw === "string" ? raw : raw.primary;
89
+ byLexicon[plugin.name] = await observeHealthFor(plugin, {
90
+ environment,
91
+ buildOutput,
92
+ entities,
93
+ ...(target.stack ? { stack: target.stack } : {}),
94
+ ...(target.region ? { region: target.region } : {}),
95
+ });
96
+ }
97
+ if (target.stack)
98
+ perStack[target.stack] = byLexicon;
99
+ else
100
+ single = byLexicon;
101
+ }
102
+ }
103
+ finally {
104
+ endpoint.restore();
105
+ }
106
+ const all = single ? [single] : Object.values(perStack);
107
+ const summary = summarizeHealth(all.flatMap((b) => Object.values(b)));
108
+ if (args.json) {
109
+ console.log(JSON.stringify({
110
+ schema: HEALTH_SCHEMA,
111
+ chantVersion: CHANT_VERSION,
112
+ environment,
113
+ observedAt,
114
+ ...(single ? { lexicons: single } : { stacks: perStack }),
115
+ summary,
116
+ }));
117
+ }
118
+ else {
119
+ if (single)
120
+ renderHealth(single);
121
+ else
122
+ for (const [stack, byLexicon] of Object.entries(perStack)) {
123
+ console.log(`\n${formatBold(`■ stack ${stack}`)}`);
124
+ renderHealth(byLexicon);
125
+ }
126
+ const total = summary.healthy + summary.unhealthy + summary.unknown + summary.unobserved + summary.absent;
127
+ if (total === 0) {
128
+ console.error(formatWarning({ message: "No declared resource has a health read" }));
129
+ }
130
+ else {
131
+ console.error(`${summary.healthy} healthy, ${summary.unhealthy} unhealthy, ${summary.unknown} unknown` +
132
+ (summary.unobserved > 0 ? `, ${summary.unobserved} not observed` : "") +
133
+ (summary.absent > 0 ? `, ${summary.absent} not deployed` : ""));
134
+ }
135
+ }
136
+ return anyBuildError ? 1 : 0;
137
+ }
138
+ function renderHealth(byLexicon) {
139
+ for (const [lexicon, result] of Object.entries(byLexicon)) {
140
+ console.log(formatBold(lexicon));
141
+ for (const [name, entry] of Object.entries(result.entities)) {
142
+ console.log(` ${entry.state.padEnd(9)} ${name} (${entry.type}): ${entry.detail}`);
143
+ }
144
+ for (const [name, hole] of Object.entries(result.unobserved)) {
145
+ console.log(` ${"not read".padEnd(9)} ${name}${hole.type ? ` (${hole.type})` : ""}: ${hole.reason}${hole.detail ? `, ${hole.detail}` : ""}`);
146
+ }
147
+ for (const name of result.absent)
148
+ console.log(` ${"absent".padEnd(9)} ${name}: not deployed`);
149
+ }
150
+ }
@@ -10,6 +10,31 @@ import type { ChantConfig } from "../../config.js";
10
10
  * so their build digests stay consistent.
11
11
  */
12
12
  export declare function resolveBuildRoot(args: ParsedArgs, config: ChantConfig): string;
13
+ /** One stack a lifecycle command operates on: its build root and, for a
14
+ * multi-stack project, the deployed CloudFormation stack name it observes
15
+ * against. */
16
+ interface StackTarget {
17
+ /** The deployed stack name to observe (undefined ⇒ single-stack convention:
18
+ * the stack named after the environment). */
19
+ stack?: string;
20
+ /** Build root to synthesize this stack from, scoped so its logical ids match
21
+ * what the stack actually deploys. */
22
+ root: string;
23
+ /** Region the stack is deployed in, from `stacks[].region` (#1261). Without
24
+ * it every stack is observed against the ambient region, so a multi-region
25
+ * estate snapshots only the stacks that happen to share it and reports the
26
+ * rest as "no valid resources or artifacts returned". */
27
+ region?: string;
28
+ }
29
+ /**
30
+ * The stacks a lifecycle command (`snapshot`/`diff`) iterates. A multi-stack
31
+ * project declares them via `stacks` in chant.config (#932) — each built from
32
+ * its own `src` and observed against its own live stack `name`. A single-stack
33
+ * project (no `stacks`) resolves to one target built from `sourceDir`/root and
34
+ * observed as the stack named after the environment (unchanged behavior). An
35
+ * explicit `--src` always wins and forces a single scoped target.
36
+ */
37
+ export declare function resolveStackTargets(args: ParsedArgs, config: ChantConfig): StackTarget[];
13
38
  /**
14
39
  * chant lifecycle snapshot <environment> [lexicon]
15
40
  */
@@ -93,4 +118,5 @@ export declare function runLifecycleUnknown(ctx: CommandContext): Promise<number
93
118
  * an empty list as if it meant "nothing downstream".
94
119
  */
95
120
  export declare function runLifecycleAffected(ctx: CommandContext): Promise<number>;
121
+ export {};
96
122
  //# sourceMappingURL=lifecycle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/lifecycle.ts"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAKlD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM,CAE9E;AAmCD;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAyH/E;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA4C3E;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA8B/E;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA+L3E;AA+sBD;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAwR3E;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA2L/E;AAsBD;;GAEG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiB1E;AAgBD;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,E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H,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA+L3E;AA+sBD;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAwR3E;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA2L/E;AAsBD;;GAEG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiB1E;AAgBD;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAmE7E;AAiCD;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAM9E;AAkBD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA8D/E"}
@@ -48,7 +48,7 @@ export function resolveBuildRoot(args, config) {
48
48
  * observed as the stack named after the environment (unchanged behavior). An
49
49
  * explicit `--src` always wins and forces a single scoped target.
50
50
  */
51
- function resolveStackTargets(args, config) {
51
+ export function resolveStackTargets(args, config) {
52
52
  if (args.src)
53
53
  return [{ root: resolve(args.src) }];
54
54
  if (config.stacks && config.stacks.length > 0) {
@@ -70,4 +70,6 @@ export declare const PR_REPORT_DIR = ".chant/pr";
70
70
  export declare function runComponentsPrPlan(ctx: CommandContext): Promise<number>;
71
71
  /** chant components pr-apply --base <ref> [--pr <n>] [--env <env>] [--gate <name>] [--forge <kind>] [--require-review] [--output <dir>] [--json] [--events-json] [--report-url <url>] */
72
72
  export declare function runComponentsPrApply(ctx: CommandContext): Promise<number>;
73
+ /** chant components pr-record --base <ref> [--pr <n>] [--env <env>] [--gate <name>] [--forge <kind>] [--output <dir>] [--json] [--events-json] [--report-url <url>] */
74
+ export declare function runComponentsPrRecord(ctx: CommandContext): Promise<number>;
73
75
  //# sourceMappingURL=pr.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pr.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/pr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAuDH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAMlD,qDAAqD;AACrD,eAAO,MAAM,aAAa,cAAc,CAAC;AAoSzC,mKAAmK;AACnK,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAGxE;AAyDD,yLAAyL;AACzL,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAGzE"}
1
+ {"version":3,"file":"pr.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/pr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAuDH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAMlD,qDAAqD;AACrD,eAAO,MAAM,aAAa,cAAc,CAAC;AAqSzC,mKAAmK;AACnK,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAGxE;AAyDD,yLAAyL;AACzL,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAGzE;AAuPD,uKAAuK;AACvK,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAG1E"}
@@ -239,6 +239,7 @@ function settleOf(status) {
239
239
  switch (status) {
240
240
  case "nothing":
241
241
  case "planned":
242
+ case "recorded":
242
243
  case "applied":
243
244
  return "ok";
244
245
  case "refused":
@@ -415,6 +416,13 @@ export function runComponentsPrApply(ctx) {
415
416
  return withStageEvents("pr-apply", ctx, (events) => prApply(ctx, events));
416
417
  }
417
418
  async function prApply(ctx, stage) {
419
+ // #4168: the review-rules security group turns --require-review on, read from the declaration at base.
420
+ const { securityGroupsAt } = await import("../../workspace/security.js");
421
+ const reviewRules = !ctx.args.requireReview && securityGroupsAt(process.cwd(), ctx.args.base).has("review-rules");
422
+ if (reviewRules && !ctx.args.forge)
423
+ return fail("the workspace opts into review-rules, which reads the pull request's reviews, so pr-apply needs --forge <kind>");
424
+ if (reviewRules)
425
+ ctx = { ...ctx, args: { ...ctx.args, requireReview: true } };
418
426
  const { args } = ctx;
419
427
  if (args.requireReview && !args.forge)
420
428
  return fail("--require-review reads the pull request's reviews, so it needs --forge <kind>");
@@ -641,12 +649,126 @@ async function prApply(ctx, stage) {
641
649
  console.error(formatSuccess(`applied the plan ${report.digest} approved by ${(approval.approvedBy ?? []).join(", ")}`));
642
650
  return code;
643
651
  }
652
+ /** chant components pr-record --base <ref> [--pr <n>] [--env <env>] [--gate <name>] [--forge <kind>] [--output <dir>] [--json] [--events-json] [--report-url <url>] */
653
+ export function runComponentsPrRecord(ctx) {
654
+ if (refusesEventsWithJson(ctx.args, "the stage's report"))
655
+ return Promise.resolve(1);
656
+ return withStageEvents("pr-record", ctx, (events) => prRecord(ctx, events));
657
+ }
658
+ /**
659
+ * The record stage (#4168 step 1): what a merge does unless apply on merge
660
+ * is opted in. It plans the members the change reaches on the merged
661
+ * commit, stores the change set, decides the pull request's gate against
662
+ * it without writing to the ledger, and writes the merge record
663
+ * (`../../lifecycle/merge-record.ts`). It applies nothing and refuses
664
+ * nothing. A plan that differs from the approved one is recorded, and the
665
+ * `chant/record` status fails (decision 1). It exits 1 only when a member
666
+ * failed to plan.
667
+ */
668
+ async function prRecord(ctx, stage) {
669
+ const { args } = ctx;
670
+ const p = await prepare(ctx, "record");
671
+ if (typeof p === "number")
672
+ return p;
673
+ let pr = args.pr ?? null;
674
+ if (pr === null && p.forge) {
675
+ try {
676
+ pr = await p.forge.pullRequestFor(p.head);
677
+ }
678
+ catch (err) {
679
+ console.error(formatWarning({ message: `could not ask ${p.forge.kind} which pull request merged ${p.head}, so the record names none: ${err instanceof Error ? err.message : String(err)}` }));
680
+ }
681
+ }
682
+ const op = pr === null ? "pr-unknown" : prOp(pr, p.member);
683
+ const upload = openUpload(stage, "record", pr, p);
684
+ const events = await openCliRunEvents(args, { kind: "component", name: `pr-record ${op}`, cwd: resolve(".") }, upload?.line);
685
+ stage.stream = events;
686
+ events?.emit({ type: "run-start", waves: p.plan.waves });
687
+ const set = await planAll(p, events?.emit);
688
+ const nothing = p.plan.order.length === 0;
689
+ let approval = { status: "pending" };
690
+ if (!nothing && !set.failed) {
691
+ await storeChangeSetForGate(ctx, p, set.doc);
692
+ if (pr !== null) {
693
+ try {
694
+ const check = await emitGateStep(events?.emit, { op, gate: p.gate }, () => decidePrGate(readOnlyLedger(gitGateLedgerPort()), { op, gate: p.gate, digest: set.doc.digest }));
695
+ approval = approvalOf(check);
696
+ }
697
+ catch (err) {
698
+ console.error(formatWarning({ message: `could not read the gate ledger, so the record says no approval: ${err instanceof Error ? err.message : String(err)}` }));
699
+ }
700
+ }
701
+ }
702
+ // #4000: the record keeps an approval by someone who wrote the change, which review rules would not count.
703
+ let authorApproved;
704
+ if (pr !== null && p.forge && approval.status === "approved") {
705
+ try {
706
+ const authors = (await p.forge.authors(pr)).map((login) => p.forge.principalOf(login));
707
+ authorApproved = approversWhoAuthored(approval.approvedBy ?? [], authors);
708
+ }
709
+ catch (err) {
710
+ console.error(formatWarning({ message: `could not read the authors of #${pr}: ${err instanceof Error ? err.message : String(err)}` }));
711
+ }
712
+ }
713
+ const status = nothing ? "nothing" : set.failed ? "plan-failed" : "recorded";
714
+ const report = prReport({
715
+ stage: "record",
716
+ pr,
717
+ env: p.env,
718
+ ...(p.member ? { member: p.member } : {}),
719
+ base: p.base,
720
+ head: p.head,
721
+ op,
722
+ gate: p.gate,
723
+ plan: p.plan,
724
+ signal: p.signal,
725
+ set,
726
+ approval,
727
+ status,
728
+ ...(status === "plan-failed" ? { message: "A member failed to plan on the merged commit, so the record has no plan to compare with the approved one. Nothing was applied." } : {}),
729
+ ...(status === "recorded" && approval.status === "changed"
730
+ ? { message: `${describePlanChanged({ op, gate: p.gate, digest: set.doc.digest, approval })} The merge stands and nothing was applied; the release gate decides before this deploys.` }
731
+ : {}),
732
+ });
733
+ const { mergeSourceOf, writeMergeRecord, MERGE_RECORD_SCHEMA_ID, MERGE_RECORD_CONTRACT } = await import("../../lifecycle/merge-record.js");
734
+ const { pushLifecycleReport } = await import("../../lifecycle/git.js");
735
+ try {
736
+ const written = await writeMergeRecord({
737
+ $schema: MERGE_RECORD_SCHEMA_ID,
738
+ contract: MERGE_RECORD_CONTRACT,
739
+ commit: p.head,
740
+ base: p.base,
741
+ env: p.env,
742
+ ...(p.member ? { member: p.member } : {}),
743
+ source: mergeSourceOf(resolve("."), p.head, pr),
744
+ op: pr === null ? null : op,
745
+ gate: p.gate,
746
+ digest: nothing ? null : set.doc.digest,
747
+ plan: nothing ? "nothing" : set.failed ? "plan-failed" : approval.status === "approved" ? "approved" : approval.status === "changed" ? "changed" : "unapproved",
748
+ ...(approval.status === "changed" && approval.approved ? { approvedDigest: approval.approved } : {}),
749
+ approvedBy: approval.status === "approved" ? (approval.approvedBy ?? []) : [],
750
+ ...(authorApproved && authorApproved.length > 0 ? { authorApproved } : {}),
751
+ components: p.plan.order,
752
+ recordedAt: new Date().toISOString(),
753
+ });
754
+ if (written.written) {
755
+ const pushed = await pushLifecycleReport();
756
+ if (pushed.pushWarning)
757
+ console.error(formatWarning({ message: pushed.pushWarning }));
758
+ }
759
+ }
760
+ catch (err) {
761
+ console.error(formatWarning({ message: `could not write the merge record for ${p.head}: ${err instanceof Error ? err.message : String(err)}` }));
762
+ }
763
+ const stop = stopper(ctx, p, events, upload);
764
+ return stop(report, status === "plan-failed" ? 1 : 0);
765
+ }
644
766
  /** How a stage stops: settle its events, write and publish the report, say how it ended, and return `code`. */
645
767
  function stopper(ctx, p, events, upload) {
646
768
  return async (report, code, settle) => {
647
- events?.settle(settle ?? settleOf(report.status), report.status === "plan-failed" || report.status === "failed" ? report.message ?? `pr-apply ${report.status}` : undefined);
769
+ events?.settle(settle ?? settleOf(report.status), report.status === "plan-failed" || report.status === "failed" ? report.message ?? `pr-${report.stage} ${report.status}` : undefined);
648
770
  await finish(ctx, p, report, upload);
649
- console.error((code === 0 ? formatInfo : (m) => formatWarning({ message: m }))(`pr-apply: ${report.status}${report.refusal ? ` (${report.refusal})` : ""}`));
771
+ console.error((code === 0 ? formatInfo : (m) => formatWarning({ message: m }))(`pr-${report.stage}: ${report.status}${report.refusal ? ` (${report.refusal})` : ""}`));
650
772
  if (report.message)
651
773
  console.error(report.message);
652
774
  printMembers(report);
@@ -1 +1 @@
1
- {"version":3,"file":"promote.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/promote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA+CH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAwkBlD,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA2E/E;AAED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsChF;AAsCD,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA6BhF"}
1
+ {"version":3,"file":"promote.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/promote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA+CH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA4xBlD,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA2E/E;AAED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsChF;AAsCD,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA6BhF"}