@intentius/chant 0.124.88 → 0.124.90

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 (377) hide show
  1. package/dist/actor.d.ts +36 -1
  2. package/dist/actor.d.ts.map +1 -1
  3. package/dist/actor.js +39 -1
  4. package/dist/chant-install.d.ts.map +1 -1
  5. package/dist/chant-install.js +1 -2
  6. package/dist/ci-base.d.ts +30 -0
  7. package/dist/ci-base.d.ts.map +1 -0
  8. package/dist/ci-base.js +33 -0
  9. package/dist/ci-comment-commands.d.ts +193 -0
  10. package/dist/ci-comment-commands.d.ts.map +1 -0
  11. package/dist/ci-comment-commands.js +353 -0
  12. package/dist/ci-comment-replies.d.ts +40 -0
  13. package/dist/ci-comment-replies.d.ts.map +1 -0
  14. package/dist/ci-comment-replies.js +59 -0
  15. package/dist/ci-evidence-from-job.d.ts +25 -0
  16. package/dist/ci-evidence-from-job.d.ts.map +1 -1
  17. package/dist/ci-evidence-from-job.js +43 -2
  18. package/dist/ci-evidence-jobs.d.ts +30 -1
  19. package/dist/ci-evidence-jobs.d.ts.map +1 -1
  20. package/dist/ci-evidence-jobs.js +46 -3
  21. package/dist/ci-image.d.ts +21 -4
  22. package/dist/ci-image.d.ts.map +1 -1
  23. package/dist/ci-image.js +62 -10
  24. package/dist/ci-job-guard.d.ts +42 -45
  25. package/dist/ci-job-guard.d.ts.map +1 -1
  26. package/dist/ci-job-guard.js +206 -3
  27. package/dist/ci-note-commands.d.ts +104 -4
  28. package/dist/ci-note-commands.d.ts.map +1 -1
  29. package/dist/ci-note-commands.js +131 -38
  30. package/dist/ci-product-words.d.ts +42 -0
  31. package/dist/ci-product-words.d.ts.map +1 -1
  32. package/dist/ci-product-words.js +25 -0
  33. package/dist/ci-product.d.ts +72 -1
  34. package/dist/ci-product.d.ts.map +1 -1
  35. package/dist/ci-product.js +73 -6
  36. package/dist/cli/commands/build.d.ts.map +1 -1
  37. package/dist/cli/commands/build.js +29 -2
  38. package/dist/cli/handlers/approve.d.ts.map +1 -1
  39. package/dist/cli/handlers/approve.js +2 -1
  40. package/dist/cli/handlers/ci-check.d.ts +1 -1
  41. package/dist/cli/handlers/ci-check.d.ts.map +1 -1
  42. package/dist/cli/handlers/ci-check.js +17 -7
  43. package/dist/cli/handlers/ci-evidence.d.ts.map +1 -1
  44. package/dist/cli/handlers/ci-evidence.js +33 -7
  45. package/dist/cli/handlers/components.d.ts.map +1 -1
  46. package/dist/cli/handlers/components.js +3 -1
  47. package/dist/cli/handlers/generated-check.d.ts +8 -0
  48. package/dist/cli/handlers/generated-check.d.ts.map +1 -1
  49. package/dist/cli/handlers/generated-check.js +31 -1
  50. package/dist/cli/handlers/lock.d.ts.map +1 -1
  51. package/dist/cli/handlers/lock.js +121 -4
  52. package/dist/cli/handlers/pr-comment.d.ts +33 -0
  53. package/dist/cli/handlers/pr-comment.d.ts.map +1 -0
  54. package/dist/cli/handlers/pr-comment.js +201 -0
  55. package/dist/cli/handlers/pr-env.d.ts.map +1 -1
  56. package/dist/cli/handlers/pr-env.js +6 -3
  57. package/dist/cli/handlers/pr-notes.d.ts.map +1 -1
  58. package/dist/cli/handlers/pr-notes.js +23 -1
  59. package/dist/cli/handlers/pr.d.ts +23 -1
  60. package/dist/cli/handlers/pr.d.ts.map +1 -1
  61. package/dist/cli/handlers/pr.js +71 -23
  62. package/dist/cli/handlers/promote.d.ts.map +1 -1
  63. package/dist/cli/handlers/promote.js +2 -1
  64. package/dist/cli/handlers/release.d.ts.map +1 -1
  65. package/dist/cli/handlers/release.js +11 -2
  66. package/dist/cli/handlers/run-wave.d.ts.map +1 -1
  67. package/dist/cli/handlers/run-wave.js +180 -4
  68. package/dist/cli/handlers/run.d.ts.map +1 -1
  69. package/dist/cli/handlers/run.js +2 -1
  70. package/dist/cli/main.d.ts.map +1 -1
  71. package/dist/cli/main.js +41 -2
  72. package/dist/cli/parse-args.d.ts.map +1 -1
  73. package/dist/cli/parse-args.js +31 -0
  74. package/dist/cli/registry.d.ts +19 -1
  75. package/dist/cli/registry.d.ts.map +1 -1
  76. package/dist/components/auto-release.d.ts.map +1 -1
  77. package/dist/components/auto-release.js +2 -1
  78. package/dist/components/pr-checks.d.ts +97 -6
  79. package/dist/components/pr-checks.d.ts.map +1 -1
  80. package/dist/components/pr-checks.js +107 -13
  81. package/dist/components/pr-pipeline.d.ts +19 -14
  82. package/dist/components/pr-pipeline.d.ts.map +1 -1
  83. package/dist/components/pr-pipeline.js +7 -13
  84. package/dist/components/product-pipeline.d.ts +96 -3
  85. package/dist/components/product-pipeline.d.ts.map +1 -1
  86. package/dist/components/product-pipeline.js +120 -14
  87. package/dist/components/product-plan.d.ts +203 -6
  88. package/dist/components/product-plan.d.ts.map +1 -1
  89. package/dist/components/product-plan.js +250 -43
  90. package/dist/drift-record.d.ts +7 -0
  91. package/dist/drift-record.d.ts.map +1 -1
  92. package/dist/drift-record.js +19 -0
  93. package/dist/floor-table.data.d.ts.map +1 -1
  94. package/dist/floor-table.data.js +63 -31
  95. package/dist/forge-check/contract.d.ts +11 -1
  96. package/dist/forge-check/contract.d.ts.map +1 -1
  97. package/dist/forge-check/contract.js +4 -1
  98. package/dist/forge-check/index.d.ts +2 -0
  99. package/dist/forge-check/index.d.ts.map +1 -1
  100. package/dist/forge-check/index.js +2 -0
  101. package/dist/gate-resume-run.d.ts +9 -1
  102. package/dist/gate-resume-run.d.ts.map +1 -1
  103. package/dist/gate-resume-run.js +26 -3
  104. package/dist/generated-check.d.ts +18 -4
  105. package/dist/generated-check.d.ts.map +1 -1
  106. package/dist/generated-check.js +37 -5
  107. package/dist/image-pins.d.ts +26 -0
  108. package/dist/image-pins.d.ts.map +1 -0
  109. package/dist/image-pins.js +19 -0
  110. package/dist/lexicon.d.ts +93 -4
  111. package/dist/lexicon.d.ts.map +1 -1
  112. package/dist/lifecycle/gate-applied.d.ts +9 -0
  113. package/dist/lifecycle/gate-applied.d.ts.map +1 -1
  114. package/dist/lifecycle/git.d.ts +11 -0
  115. package/dist/lifecycle/git.d.ts.map +1 -1
  116. package/dist/lifecycle/git.js +30 -3
  117. package/dist/lifecycle/publish-npm.d.ts +11 -0
  118. package/dist/lifecycle/publish-npm.d.ts.map +1 -1
  119. package/dist/lifecycle/publish-npm.js +27 -1
  120. package/dist/lifecycle/reach-locks.d.ts +131 -0
  121. package/dist/lifecycle/reach-locks.d.ts.map +1 -0
  122. package/dist/lifecycle/reach-locks.js +118 -0
  123. package/dist/lifecycle/release-cut.d.ts +3 -1
  124. package/dist/lifecycle/release-cut.d.ts.map +1 -1
  125. package/dist/lifecycle/release-cut.js +15 -0
  126. package/dist/lifecycle/release-images.d.ts.map +1 -1
  127. package/dist/lifecycle/release-images.js +1 -2
  128. package/dist/notify-product.d.ts +12 -3
  129. package/dist/notify-product.d.ts.map +1 -1
  130. package/dist/notify-product.js +10 -6
  131. package/dist/op/activities/source-release.d.ts.map +1 -1
  132. package/dist/op/activities/source-release.js +2 -1
  133. package/dist/op/activities/source-rollback.d.ts.map +1 -1
  134. package/dist/op/activities/source-rollback.js +2 -1
  135. package/dist/op/apply-status.d.ts +84 -0
  136. package/dist/op/apply-status.d.ts.map +1 -0
  137. package/dist/op/apply-status.js +106 -0
  138. package/dist/op/before-merge-decide.d.ts +102 -0
  139. package/dist/op/before-merge-decide.d.ts.map +1 -0
  140. package/dist/op/before-merge-decide.js +142 -0
  141. package/dist/op/before-merge-done.d.ts +56 -0
  142. package/dist/op/before-merge-done.d.ts.map +1 -0
  143. package/dist/op/before-merge-done.js +69 -0
  144. package/dist/op/before-merge-store.d.ts +20 -0
  145. package/dist/op/before-merge-store.d.ts.map +1 -0
  146. package/dist/op/before-merge-store.js +48 -0
  147. package/dist/op/before-merge.d.ts +150 -0
  148. package/dist/op/before-merge.d.ts.map +1 -0
  149. package/dist/op/before-merge.js +207 -0
  150. package/dist/op/follow-on-run.d.ts +117 -0
  151. package/dist/op/follow-on-run.d.ts.map +1 -0
  152. package/dist/op/follow-on-run.js +154 -0
  153. package/dist/op/follow-on-store.d.ts +17 -0
  154. package/dist/op/follow-on-store.d.ts.map +1 -0
  155. package/dist/op/follow-on-store.js +54 -0
  156. package/dist/op/gate.d.ts +6 -0
  157. package/dist/op/gate.d.ts.map +1 -1
  158. package/dist/op/gate.js +10 -1
  159. package/dist/op/index.d.ts +5 -1
  160. package/dist/op/index.d.ts.map +1 -1
  161. package/dist/op/index.js +2 -0
  162. package/dist/op/op-waves-after-plan.d.ts +13 -0
  163. package/dist/op/op-waves-after-plan.d.ts.map +1 -1
  164. package/dist/op/op-waves-evidence-jobs.d.ts +10 -2
  165. package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -1
  166. package/dist/op/op-waves-evidence-jobs.js +19 -5
  167. package/dist/op/op-waves-follow-on.d.ts +162 -0
  168. package/dist/op/op-waves-follow-on.d.ts.map +1 -0
  169. package/dist/op/op-waves-follow-on.js +355 -0
  170. package/dist/op/op-waves-render-spec.d.ts +100 -0
  171. package/dist/op/op-waves-render-spec.d.ts.map +1 -0
  172. package/dist/op/op-waves-render-spec.js +162 -0
  173. package/dist/op/op-waves-run.d.ts +148 -6
  174. package/dist/op/op-waves-run.d.ts.map +1 -1
  175. package/dist/op/op-waves-run.js +873 -100
  176. package/dist/op/op-waves-split.d.ts +122 -0
  177. package/dist/op/op-waves-split.d.ts.map +1 -0
  178. package/dist/op/op-waves-split.js +166 -0
  179. package/dist/op/op-waves.d.ts +24 -0
  180. package/dist/op/op-waves.d.ts.map +1 -1
  181. package/dist/op/op-waves.js +18 -1
  182. package/dist/op/schedule-overdue.d.ts +15 -1
  183. package/dist/op/schedule-overdue.d.ts.map +1 -1
  184. package/dist/op/schedule-overdue.js +77 -5
  185. package/dist/op/stage-hooks.d.ts +36 -1
  186. package/dist/op/stage-hooks.d.ts.map +1 -1
  187. package/dist/op/stage-hooks.js +17 -3
  188. package/dist/op/wave-stop.d.ts +67 -0
  189. package/dist/op/wave-stop.d.ts.map +1 -0
  190. package/dist/op/wave-stop.js +129 -0
  191. package/dist/planned-files.d.ts +76 -0
  192. package/dist/planned-files.d.ts.map +1 -0
  193. package/dist/planned-files.js +108 -0
  194. package/dist/pr-forge-job.d.ts +22 -0
  195. package/dist/pr-forge-job.d.ts.map +1 -0
  196. package/dist/pr-forge-job.js +46 -0
  197. package/dist/pr-loop.d.ts +3 -6
  198. package/dist/pr-loop.d.ts.map +1 -1
  199. package/dist/pr-loop.js +4 -81
  200. package/dist/pr-plan-note.d.ts +97 -0
  201. package/dist/pr-plan-note.d.ts.map +1 -1
  202. package/dist/pr-plan-note.js +94 -1
  203. package/dist/pr-post.d.ts +28 -3
  204. package/dist/pr-post.d.ts.map +1 -1
  205. package/dist/pr-post.js +146 -13
  206. package/dist/pr-status.d.ts +16 -0
  207. package/dist/pr-status.d.ts.map +1 -0
  208. package/dist/pr-status.js +90 -0
  209. package/dist/ref-gate-init.d.ts +16 -2
  210. package/dist/ref-gate-init.d.ts.map +1 -1
  211. package/dist/ref-gate-init.js +24 -13
  212. package/dist/release-floors.d.ts +39 -1
  213. package/dist/release-floors.d.ts.map +1 -1
  214. package/dist/release-floors.js +63 -25
  215. package/dist/render-module.d.ts +15 -0
  216. package/dist/render-module.d.ts.map +1 -0
  217. package/dist/render-module.js +73 -0
  218. package/dist/state-migration.d.ts.map +1 -1
  219. package/dist/state-migration.js +1 -2
  220. package/dist/wave-blocked.d.ts +7 -1
  221. package/dist/wave-blocked.d.ts.map +1 -1
  222. package/dist/wave-blocked.js +7 -2
  223. package/dist/wave-runtime.mjs +366 -350
  224. package/dist/workspace/ci-green-cli.d.ts.map +1 -1
  225. package/dist/workspace/ci-green-cli.js +3 -2
  226. package/dist/workspace/release-train.d.ts.map +1 -1
  227. package/dist/workspace/release-train.js +2 -1
  228. package/dist/workspace/release-workflow.d.ts +4 -3
  229. package/dist/workspace/release-workflow.d.ts.map +1 -1
  230. package/dist/workspace/release-workflow.js +10 -7
  231. package/dist/workspace/trust/check-evidence-report.d.ts +7 -2
  232. package/dist/workspace/trust/check-evidence-report.d.ts.map +1 -1
  233. package/dist/workspace/trust/check-evidence-report.js +15 -8
  234. package/dist/workspace/trust/ref-gate-cli.d.ts +10 -1
  235. package/dist/workspace/trust/ref-gate-cli.d.ts.map +1 -1
  236. package/dist/workspace/trust/ref-gate-cli.js +30 -10
  237. package/dist/workspace/workspace-run.d.ts.map +1 -1
  238. package/dist/workspace/workspace-run.js +2 -1
  239. package/package.json +1 -1
  240. package/src/actor.test.ts +68 -2
  241. package/src/actor.ts +61 -1
  242. package/src/chant-install.test.ts +2 -3
  243. package/src/chant-install.ts +1 -2
  244. package/src/ci-base.test.ts +41 -0
  245. package/src/ci-base.ts +43 -0
  246. package/src/ci-comment-commands.test.ts +439 -0
  247. package/src/ci-comment-commands.ts +428 -0
  248. package/src/ci-comment-replies.ts +78 -0
  249. package/src/ci-commit.test.ts +2 -3
  250. package/src/ci-evidence-from-job.test.ts +18 -0
  251. package/src/ci-evidence-from-job.ts +58 -2
  252. package/src/ci-evidence-jobs.ts +50 -5
  253. package/src/ci-image.test.ts +130 -10
  254. package/src/ci-image.ts +85 -12
  255. package/src/ci-job-guard.before-merge.test.ts +148 -0
  256. package/src/ci-job-guard.follow-on-record.test.ts +137 -0
  257. package/src/ci-job-guard.follow-on.test.ts +144 -0
  258. package/src/ci-job-guard.ts +221 -3
  259. package/src/ci-note-commands.test.ts +76 -1
  260. package/src/ci-note-commands.ts +198 -46
  261. package/src/ci-product-words.ts +59 -0
  262. package/src/ci-product.ts +90 -6
  263. package/src/cli/commands/build.test.ts +41 -0
  264. package/src/cli/commands/build.ts +27 -2
  265. package/src/cli/handlers/approve.ts +2 -1
  266. package/src/cli/handlers/ci-check.ts +19 -7
  267. package/src/cli/handlers/ci-evidence.ts +29 -8
  268. package/src/cli/handlers/components.ts +3 -1
  269. package/src/cli/handlers/generated-check.ts +31 -1
  270. package/src/cli/handlers/lock-reach.test.ts +103 -0
  271. package/src/cli/handlers/lock.ts +100 -4
  272. package/src/cli/handlers/pr-comment.ts +187 -0
  273. package/src/cli/handlers/pr-env.ts +6 -3
  274. package/src/cli/handlers/pr-notes.ts +30 -6
  275. package/src/cli/handlers/pr-record.test.ts +1 -1
  276. package/src/cli/handlers/pr.ts +64 -21
  277. package/src/cli/handlers/promote.ts +2 -1
  278. package/src/cli/handlers/release.e2e.test.ts +35 -0
  279. package/src/cli/handlers/release.ts +14 -2
  280. package/src/cli/handlers/run-wave.ts +170 -4
  281. package/src/cli/handlers/run.ts +2 -1
  282. package/src/cli/main.ts +41 -2
  283. package/src/cli/parse-args.ts +23 -0
  284. package/src/cli/registry.ts +19 -1
  285. package/src/components/auto-release.ts +2 -1
  286. package/src/components/pr-checks.ts +165 -17
  287. package/src/components/pr-pipeline.ts +22 -18
  288. package/src/components/product-pipeline.apply-status.test.ts +50 -0
  289. package/src/components/product-pipeline.ts +204 -17
  290. package/src/components/product-plan.test.ts +60 -4
  291. package/src/components/product-plan.ts +367 -50
  292. package/src/drift-record.test.ts +20 -0
  293. package/src/drift-record.ts +16 -0
  294. package/src/floor-table.data.ts +63 -31
  295. package/src/forge-check/contract.ts +12 -1
  296. package/src/forge-check/forge-check.test.ts +17 -0
  297. package/src/forge-check/index.ts +2 -0
  298. package/src/gate-resume-run.ts +27 -3
  299. package/src/generated-check.e2e.test.ts +21 -1
  300. package/src/generated-check.test.ts +66 -0
  301. package/src/generated-check.ts +51 -10
  302. package/src/image-pins.ts +31 -0
  303. package/src/lexicon.ts +89 -1
  304. package/src/lifecycle/gate-applied.ts +7 -0
  305. package/src/lifecycle/git.test.ts +48 -0
  306. package/src/lifecycle/git.ts +27 -4
  307. package/src/lifecycle/publish-npm.ts +31 -1
  308. package/src/lifecycle/reach-locks.test.ts +87 -0
  309. package/src/lifecycle/reach-locks.ts +169 -0
  310. package/src/lifecycle/release-cut.ts +17 -1
  311. package/src/lifecycle/release-images.test.ts +56 -0
  312. package/src/lifecycle/release-images.ts +1 -2
  313. package/src/notify-product.ts +19 -8
  314. package/src/op/activities/source-release.ts +2 -1
  315. package/src/op/activities/source-rollback.ts +2 -1
  316. package/src/op/apply-status.test.ts +83 -0
  317. package/src/op/apply-status.ts +132 -0
  318. package/src/op/before-merge-decide.ts +190 -0
  319. package/src/op/before-merge-done.ts +99 -0
  320. package/src/op/before-merge-store.ts +44 -0
  321. package/src/op/before-merge.test.ts +201 -0
  322. package/src/op/before-merge.ts +266 -0
  323. package/src/op/follow-on-run.ts +206 -0
  324. package/src/op/follow-on-store.ts +54 -0
  325. package/src/op/gate-resume.test.ts +27 -0
  326. package/src/op/gate.ts +16 -1
  327. package/src/op/index.ts +15 -0
  328. package/src/op/op-waves-after-plan.ts +13 -0
  329. package/src/op/op-waves-evidence-jobs.ts +21 -7
  330. package/src/op/op-waves-follow-on-record.test.ts +152 -0
  331. package/src/op/op-waves-follow-on.test.ts +247 -0
  332. package/src/op/op-waves-follow-on.ts +385 -0
  333. package/src/op/op-waves-notify-words.test.ts +18 -0
  334. package/src/op/op-waves-render-spec.test.ts +159 -0
  335. package/src/op/op-waves-render-spec.ts +171 -0
  336. package/src/op/op-waves-run.ts +973 -94
  337. package/src/op/op-waves-split-product.test.ts +288 -0
  338. package/src/op/op-waves-split-step.test.ts +298 -0
  339. package/src/op/op-waves-split.test.ts +196 -0
  340. package/src/op/op-waves-split.ts +189 -0
  341. package/src/op/op-waves.ts +31 -3
  342. package/src/op/schedule-overdue.test.ts +72 -1
  343. package/src/op/schedule-overdue.ts +84 -6
  344. package/src/op/stage-hooks.ts +52 -4
  345. package/src/op/wave-stop.test.ts +72 -0
  346. package/src/op/wave-stop.ts +139 -0
  347. package/src/planned-files.test.ts +80 -0
  348. package/src/planned-files.ts +134 -0
  349. package/src/pr-forge-job.test.ts +53 -0
  350. package/src/pr-forge-job.ts +46 -0
  351. package/src/pr-loop-narrowed.test.ts +2 -1
  352. package/src/pr-loop-words.test.ts +2 -1
  353. package/src/pr-loop.test.ts +1 -2
  354. package/src/pr-loop.ts +4 -80
  355. package/src/pr-plan-note.ts +155 -3
  356. package/src/pr-post-replan.test.ts +144 -0
  357. package/src/pr-post-subject.test.ts +230 -0
  358. package/src/pr-post.test.ts +2 -1
  359. package/src/pr-post.ts +151 -15
  360. package/src/pr-status.ts +91 -0
  361. package/src/ref-gate-init.ts +30 -11
  362. package/src/release-floors.ts +81 -25
  363. package/src/render-module.ts +73 -0
  364. package/src/state-migration-record.test.ts +2 -3
  365. package/src/state-migration.ts +1 -2
  366. package/src/wave-blocked.ts +9 -4
  367. package/src/workspace/ci-green-cli.ts +3 -2
  368. package/src/workspace/ci-green-workflow.test.ts +32 -1
  369. package/src/workspace/release-train.ts +2 -1
  370. package/src/workspace/release-workflow.test.ts +36 -5
  371. package/src/workspace/release-workflow.ts +10 -7
  372. package/src/workspace/trust/check-evidence-report.ts +15 -8
  373. package/src/workspace/trust/check-evidence.test.ts +5 -0
  374. package/src/workspace/trust/ref-gate-cli.ts +30 -8
  375. package/src/workspace/trust/ref-gate-pieces.test.ts +46 -1
  376. package/src/workspace/trust/ref-gate.test.ts +10 -0
  377. package/src/workspace/workspace-run.ts +2 -1
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Locks on what a change reaches (#4979): `chant lock --reach`.
3
+ *
4
+ * A pull request's plan locks (`ci.locks: plan`, #4293) come from what its
5
+ * plan selected, which the plan job, running the change's code, wrote. A
6
+ * product that knows from the change's files alone which of its targets a
7
+ * change reaches, such as terragucci's roots, units and instances, gives a
8
+ * reach line instead: one shell line, written in the pipeline at the target
9
+ * branch's commit, that prints the targets the change from `$BASE_SHA` to
10
+ * `$HEAD_SHA` reaches, one a line. It reads the change as data from git
11
+ * (`git diff`, `git show <sha>:<path>`) and runs none of its code.
12
+ *
13
+ * The lock job runs it in a checkout of the target branch's commit. chant
14
+ * first fetches the pull request's head from the forge (`refs/pull/<n>/head`,
15
+ * GitLab's `refs/merge-requests/<n>/head`) and checks it is still the commit
16
+ * the job was started for: a head that moved is left to the run of the push
17
+ * that moved it. The line's variables are `BASE_SHA`, `HEAD_SHA` and
18
+ * `PR_NUMBER`; it holds the job's environment, and the line is the
19
+ * pipeline's, so none of the change's code runs with the job's token.
20
+ *
21
+ * On GitLab a merge request's pipeline is built from the merge request's own
22
+ * files, so its lock job runs in the target branch's plan notes pipeline and
23
+ * locks every open merge request from the project (`--open`), and releases
24
+ * the locks of a merge request that is no longer open.
25
+ */
26
+ import type { ForgeKind } from "../pr-forge.js";
27
+ /** The variable the reach line is in: the pipeline's, set as the step's variable so no shell quoting carries it (#4979). */
28
+ export declare const LOCK_REACH_ENV = "CHANT_LOCK_REACH";
29
+ /** Where chant fetches the pull request's head to before the reach line runs (#4979). */
30
+ export declare const REACH_HEAD_REF = "refs/remotes/chant/pull-request-head";
31
+ /** The forge's ref for pull request `pr`'s head. */
32
+ export declare function pullRequestHeadRef(forge: ForgeKind, pr: number): string;
33
+ /** A process run, as `spawnSync` answers it. */
34
+ export type ReachRun = (argv: string[], o: {
35
+ cwd?: string;
36
+ env?: Record<string, string | undefined>;
37
+ }) => {
38
+ status: number | null;
39
+ stdout: string;
40
+ stderr: string;
41
+ };
42
+ /** What {@link reachedTargets} takes. */
43
+ export interface ReachInput {
44
+ forge: ForgeKind;
45
+ pr: number;
46
+ /** The head the job was started for. */
47
+ head: string;
48
+ /** The target branch's commit the change is measured from. */
49
+ base: string;
50
+ /** The reach line. */
51
+ line: string;
52
+ cwd?: string;
53
+ /** The line's environment, to which `BASE_SHA`, `HEAD_SHA` and `PR_NUMBER` are added. Default the process's. */
54
+ env?: Record<string, string | undefined>;
55
+ run?: ReachRun;
56
+ }
57
+ /** The targets a change reaches, sorted; or that its head moved; or why the line could not say. */
58
+ export type Reached = {
59
+ targets: string[];
60
+ } | {
61
+ moved: string;
62
+ } | {
63
+ error: string;
64
+ };
65
+ /**
66
+ * The targets the change of pull request `pr` reaches (#4979): fetch its
67
+ * head, check it is `head`, and run the reach line. Blank lines are left
68
+ * out; a line holding a control character fails the read, so a target name
69
+ * never carries one into the lock file.
70
+ */
71
+ export declare function reachedTargets(i: ReachInput): Reached;
72
+ /** One open pull request as {@link reachOpen} locks it. */
73
+ export interface ReachOpenPull {
74
+ number: number;
75
+ headSha: string;
76
+ base: string;
77
+ fork: boolean;
78
+ }
79
+ /** What one open pull request's lock came to. */
80
+ export type ReachOpenOutcome = {
81
+ pr: number;
82
+ kind: "locked";
83
+ targets: string[];
84
+ released: string[];
85
+ } | {
86
+ pr: number;
87
+ kind: "held";
88
+ text: string;
89
+ } | {
90
+ pr: number;
91
+ kind: "skipped";
92
+ text: string;
93
+ } | {
94
+ pr: number;
95
+ kind: "failed";
96
+ text: string;
97
+ };
98
+ /** What {@link reachOpen} takes besides the reach input of each pull request. */
99
+ export interface ReachOpenInput extends Omit<ReachInput, "pr" | "head"> {
100
+ /** The branch the pull requests merge into. */
101
+ branch: string;
102
+ open: readonly ReachOpenPull[];
103
+ /** Take the locks of one pull request; `held` names what another holds. */
104
+ take(pr: number, head: string, targets: string[]): Promise<{
105
+ ok: true;
106
+ released: string[];
107
+ } | {
108
+ ok: false;
109
+ held: string;
110
+ }>;
111
+ /** The pull requests that hold a lock now. */
112
+ holders(): Promise<number[]>;
113
+ /** Whether a holder outside the open list is open still (one that merges into another branch). */
114
+ isOpen(pr: number): Promise<boolean>;
115
+ /** Release every lock of a pull request that is no longer open. */
116
+ release(pr: number): Promise<string[]>;
117
+ }
118
+ /**
119
+ * `chant lock --reach --open` (#4979), GitLab's lock job in the target
120
+ * branch's plan notes pipeline: lock what each open merge request from the
121
+ * project that merges into `branch` reaches, then release the locks of every
122
+ * holder that is not open any more. A fork's merge request takes no lock.
123
+ */
124
+ export declare function reachOpen(i: ReachOpenInput): Promise<{
125
+ outcomes: ReachOpenOutcome[];
126
+ released: Array<{
127
+ pr: number;
128
+ targets: string[];
129
+ }>;
130
+ }>;
131
+ //# sourceMappingURL=reach-locks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reach-locks.d.ts","sourceRoot":"","sources":["../../src/lifecycle/reach-locks.ts"],"names":[],"mappings":"AAAA;;;;;;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C,MAAM,EAAE,CAAC,CAAC;IAC7B,kGAAkG;IAClG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACrC,mEAAmE;IACnE,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CACxC;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAgChJ"}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Locks on what a change reaches (#4979): `chant lock --reach`.
3
+ *
4
+ * A pull request's plan locks (`ci.locks: plan`, #4293) come from what its
5
+ * plan selected, which the plan job, running the change's code, wrote. A
6
+ * product that knows from the change's files alone which of its targets a
7
+ * change reaches, such as terragucci's roots, units and instances, gives a
8
+ * reach line instead: one shell line, written in the pipeline at the target
9
+ * branch's commit, that prints the targets the change from `$BASE_SHA` to
10
+ * `$HEAD_SHA` reaches, one a line. It reads the change as data from git
11
+ * (`git diff`, `git show <sha>:<path>`) and runs none of its code.
12
+ *
13
+ * The lock job runs it in a checkout of the target branch's commit. chant
14
+ * first fetches the pull request's head from the forge (`refs/pull/<n>/head`,
15
+ * GitLab's `refs/merge-requests/<n>/head`) and checks it is still the commit
16
+ * the job was started for: a head that moved is left to the run of the push
17
+ * that moved it. The line's variables are `BASE_SHA`, `HEAD_SHA` and
18
+ * `PR_NUMBER`; it holds the job's environment, and the line is the
19
+ * pipeline's, so none of the change's code runs with the job's token.
20
+ *
21
+ * On GitLab a merge request's pipeline is built from the merge request's own
22
+ * files, so its lock job runs in the target branch's plan notes pipeline and
23
+ * locks every open merge request from the project (`--open`), and releases
24
+ * the locks of a merge request that is no longer open.
25
+ */
26
+ import { spawnSync } from "node:child_process";
27
+ /** The variable the reach line is in: the pipeline's, set as the step's variable so no shell quoting carries it (#4979). */
28
+ export const LOCK_REACH_ENV = "CHANT_LOCK_REACH";
29
+ /** Where chant fetches the pull request's head to before the reach line runs (#4979). */
30
+ export const REACH_HEAD_REF = "refs/remotes/chant/pull-request-head";
31
+ /** A target name a reach line may print: no control characters, at most 512 characters. */
32
+ const TARGET_LINE = /^[^\u0000-\u001f\u007f]{1,512}$/;
33
+ const SHA = /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/;
34
+ /** The forge's ref for pull request `pr`'s head. */
35
+ export function pullRequestHeadRef(forge, pr) {
36
+ return forge === "gitlab" ? `refs/merge-requests/${pr}/head` : `refs/pull/${pr}/head`;
37
+ }
38
+ const defaultRun = (argv, o) => {
39
+ const r = spawnSync(argv[0], argv.slice(1), { encoding: "utf8", ...(o.cwd ? { cwd: o.cwd } : {}), ...(o.env ? { env: o.env } : {}) });
40
+ return { status: r.status, stdout: r.stdout ?? "", stderr: r.error ? r.error.message : (r.stderr ?? "") };
41
+ };
42
+ /**
43
+ * The targets the change of pull request `pr` reaches (#4979): fetch its
44
+ * head, check it is `head`, and run the reach line. Blank lines are left
45
+ * out; a line holding a control character fails the read, so a target name
46
+ * never carries one into the lock file.
47
+ */
48
+ export function reachedTargets(i) {
49
+ const run = i.run ?? defaultRun;
50
+ const name = i.forge === "gitlab" ? `merge request !${i.pr}` : `pull request ${i.pr}`;
51
+ if (!SHA.test(i.head))
52
+ return { error: `--head ${JSON.stringify(i.head)} is not a commit sha` };
53
+ if (!SHA.test(i.base))
54
+ return { error: `--base ${JSON.stringify(i.base)} is not a commit sha` };
55
+ if (!i.line.trim())
56
+ return { error: `the reach line in ${LOCK_REACH_ENV} is empty` };
57
+ const fetched = run(["git", "fetch", "-q", "--no-tags", "origin", `+${pullRequestHeadRef(i.forge, i.pr)}:${REACH_HEAD_REF}`], { ...(i.cwd ? { cwd: i.cwd } : {}) });
58
+ if (fetched.status !== 0)
59
+ return { error: `could not fetch ${name}'s head (${fetched.stderr.trim() || `git exited ${fetched.status}`})` };
60
+ const now = run(["git", "rev-parse", REACH_HEAD_REF], { ...(i.cwd ? { cwd: i.cwd } : {}) }).stdout.trim();
61
+ if (now !== i.head)
62
+ return { moved: `${name} moved to ${now.slice(0, 12) || "another commit"} after ${i.head.slice(0, 12)}, so the run of that push locks it` };
63
+ const env = { ...(i.env ?? process.env), BASE_SHA: i.base, HEAD_SHA: i.head, PR_NUMBER: String(i.pr) };
64
+ const out = run(["sh", "-c", i.line], { ...(i.cwd ? { cwd: i.cwd } : {}), env });
65
+ if (out.status !== 0)
66
+ return { error: `the reach line exited ${out.status ?? "on a signal"}${out.stderr.trim() ? `: ${out.stderr.trim().split("\n").slice(-3).join(" ")}` : ""}` };
67
+ const targets = new Set();
68
+ for (const raw of out.stdout.split("\n")) {
69
+ const t = raw.trim();
70
+ if (t === "")
71
+ continue;
72
+ if (!TARGET_LINE.test(t))
73
+ return { error: `the reach line printed ${JSON.stringify(t.slice(0, 80))}, which is not a target name: one a line, no control characters, at most 512 characters` };
74
+ targets.add(t);
75
+ }
76
+ return { targets: [...targets].sort() };
77
+ }
78
+ /**
79
+ * `chant lock --reach --open` (#4979), GitLab's lock job in the target
80
+ * branch's plan notes pipeline: lock what each open merge request from the
81
+ * project that merges into `branch` reaches, then release the locks of every
82
+ * holder that is not open any more. A fork's merge request takes no lock.
83
+ */
84
+ export async function reachOpen(i) {
85
+ const outcomes = [];
86
+ const open = new Set();
87
+ for (const p of i.open) {
88
+ open.add(p.number);
89
+ if (p.fork) {
90
+ outcomes.push({ pr: p.number, kind: "skipped", text: `!${p.number} comes from a fork, so it takes no lock` });
91
+ continue;
92
+ }
93
+ if (p.base !== i.branch) {
94
+ outcomes.push({ pr: p.number, kind: "skipped", text: `!${p.number} merges into ${p.base}, not ${i.branch}` });
95
+ continue;
96
+ }
97
+ const r = reachedTargets({ ...i, pr: p.number, head: p.headSha });
98
+ if ("error" in r) {
99
+ outcomes.push({ pr: p.number, kind: "failed", text: r.error });
100
+ continue;
101
+ }
102
+ if ("moved" in r) {
103
+ outcomes.push({ pr: p.number, kind: "skipped", text: r.moved });
104
+ continue;
105
+ }
106
+ const took = await i.take(p.number, p.headSha, r.targets);
107
+ outcomes.push(took.ok ? { pr: p.number, kind: "locked", targets: r.targets, released: took.released } : { pr: p.number, kind: "held", text: took.held });
108
+ }
109
+ const released = [];
110
+ for (const pr of await i.holders()) {
111
+ if (open.has(pr) || (await i.isOpen(pr)))
112
+ continue;
113
+ const targets = await i.release(pr);
114
+ if (targets.length > 0)
115
+ released.push({ pr, targets });
116
+ }
117
+ return { outcomes, released };
118
+ }
@@ -66,7 +66,9 @@ export declare function greenOverrideSubject(commit: string): string;
66
66
  /** The rule an override of a cut names (#4693): `ci-green`, or `ci-green-<lane>` for a lane's tag. */
67
67
  export declare function greenOverrideRule(lane: string | null): string;
68
68
  /** The stable codes a cut refuses with. */
69
- export type ReleaseCutCode = "not-a-git-repository" | "release-commit-not-green" | "release-commit-revoked" | "release-worktree-dirty" | "release-no-environments" | "release-no-components" | "release-build-inputs-differ" | "release-image-invalid" | "release-image-unknown-component" | "release-image-name-taken" | "release-image-build-failed" | "release-version-no-label" | "release-version-label-invalid" | "release-version-no-package" | "release-version-invalid" | "release-unsigned" | "release-signer-refused" | "declaration-invalid";
69
+ export type ReleaseCutCode = "not-a-git-repository" | "release-commit-not-green" | "release-commit-revoked" | "release-worktree-dirty" | "release-no-environments" | "release-no-components" | "release-build-inputs-differ" | "release-image-invalid" | "release-image-unknown-component" | "release-image-name-taken" | "release-image-build-failed" | "release-version-no-label" | "release-version-label-invalid" | "release-version-no-package" | "release-version-invalid" | "release-unsigned" | "release-signer-refused" | "declaration-invalid"
70
+ /** #4941: the npm target's image check, run by the cut (./publish-npm.ts `checkPackageImages`). */
71
+ | "publish-npm-carries-image" | "publish-npm-pack-failed";
70
72
  export declare class ReleaseCutError extends Error {
71
73
  readonly code: ReleaseCutCode;
72
74
  readonly fix?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"release-cut.d.ts","sourceRoot":"","sources":["../../src/lifecycle/release-cut.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AASH,OAAO,EAUL,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAGnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAEpF,mGAAmG;AACnG,eAAO,MAAM,sBAAsB,aAAa,CAAC;AACjD,4HAA4H;AAC5H,eAAO,MAAM,0BAA0B,aAAa,CAAC;AAErD,oFAAoF;AACpF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,sGAAsG;AACtG,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAE7D;AAKD,2CAA2C;AAC3C,MAAM,MAAM,cAAc,GACtB,sBAAsB,GACtB,0BAA0B,GAC1B,wBAAwB,GACxB,wBAAwB,GACxB,yBAAyB,GACzB,uBAAuB,GACvB,6BAA6B,GAC7B,uBAAuB,GACvB,iCAAiC,GACjC,0BAA0B,GAC1B,4BAA4B,GAC5B,0BAA0B,GAC1B,+BAA+B,GAC/B,4BAA4B,GAC5B,yBAAyB,GACzB,kBAAkB,GAClB,wBAAwB,GACxB,qBAAqB,CAAC;AAE1B,qBAAa,eAAgB,SAAQ,KAAK;IAEtC,QAAQ,CAAC,IAAI,EAAE,cAAc;IAE7B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM;IACrB,wGAAwG;IACxG,QAAQ,CAAC,QAAQ;IALnB,YACW,IAAI,EAAE,cAAc,EAC7B,OAAO,EAAE,MAAM,EACN,GAAG,CAA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;;;GAaG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAsFpE"}
@@ -514,6 +514,21 @@ export async function cutRelease(req) {
514
514
  }
515
515
  const { targets, templates } = targetsOf(compiled);
516
516
  const release = makeRelease({ member: p.member, commit, artifactDigests: artifacts, targets });
517
+ // #4941: an npm package that would carry an image archive stops the cut here, before anything is recorded or
518
+ // tagged, rather than the publish job once the label is spent. The check is the npm target's own plan check.
519
+ if (release.artifactDigests.some((a) => a.kind === "image" && a.path !== "")) {
520
+ const { loadChantConfig } = await import("../config.js");
521
+ const { checkDeclaredPackageImages } = await import("./publish-npm.js");
522
+ const { PublishTargetError } = await import("./release-publish.js");
523
+ try {
524
+ checkDeclaredPackageImages((await loadChantConfig(cwd)).config.release?.publish ?? [], release, cwd);
525
+ }
526
+ catch (err) {
527
+ if (err instanceof PublishTargetError)
528
+ throw new ReleaseCutError(err.code, `no release was cut: ${err.message}`, err.fix);
529
+ throw err;
530
+ }
531
+ }
517
532
  const timestamp = (req.now ?? (() => new Date()))().toISOString();
518
533
  const signed = { releaseDigest: release.releaseDigest, label: req.label, actor: req.actor, timestamp };
519
534
  let signature = null;
@@ -1 +1 @@
1
- {"version":3,"file":"release-images.d.ts","sourceRoot":"","sources":["../../src/lifecycle/release-images.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAMH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEhE,gFAAgF;AAChF,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAE3D,gKAAgK;AAChK,eAAO,MAAM,oBAAoB,aAAa,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,aAAa,CAAC;AAEzD,oIAAoI;AACpI,eAAO,MAAM,wBAAwB,aA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,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAEpD;AAED,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,iBAAiB,CAAC,GAAG,MAAM,EAAE,CAG7F;AAED,uGAAuG;AACvG,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAOvF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,iBAAiB,CAAC,EAAE,OAAO,EAAE,SAAS,kBAAkB,EAAE,GAAG,MAAM,GAAG,IAAI,CAY/I"}
@@ -37,7 +37,6 @@
37
37
  import { spawnSync } from "node:child_process";
38
38
  import { existsSync, mkdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
39
39
  import { dirname, isAbsolute, posix, relative, resolve } from "node:path";
40
- import { NEXT_RELEASE } from "../release-floors.js";
41
40
  /** The variable that names the digests file a release's package build reads. */
42
41
  export const RELEASE_DIGESTS_ENV = "CHANT_RELEASE_DIGESTS";
43
42
  /** The first chant with `release.images`, `CHANT_RELEASE_DIGESTS`, `chant release images` and an npm target's `pins` (#4657). Products feature-detect on it. */
@@ -49,7 +48,7 @@ export const RELEASE_IMAGES_FLOOR = "0.124.71";
49
48
  */
50
49
  export const RELEASE_IMAGE_DOCKERFILE_FLOOR = "0.124.78";
51
50
  /** The first chant whose Dockerfile entry in `release.images` takes `args`, build arguments beside the two chant passes (#4908). */
52
- export const RELEASE_IMAGE_ARGS_FLOOR = NEXT_RELEASE;
51
+ export const RELEASE_IMAGE_ARGS_FLOOR = "0.124.88";
53
52
  /** The platforms a Dockerfile entry builds by default. Building arm64 on amd64 needs QEMU's binfmt handlers. */
54
53
  export const RELEASE_IMAGE_PLATFORMS = ["linux/amd64", "linux/arm64"];
55
54
  /** The buildx builder a Dockerfile entry builds with, created with the `docker-container` driver when missing: the default driver cannot rewrite timestamps in an OCI archive. */
@@ -13,6 +13,7 @@
13
13
  */
14
14
  import { type CiProductNotifyWords, type CiProductWords } from "./ci-product-words.js";
15
15
  import type { NotifyFields, SendNotifyOptions } from "./notify.js";
16
+ import { type DriftRunStack } from "./drift-issue.js";
16
17
  /**
17
18
  * The first chant whose Slack and Teams messages take a product's words, a
18
19
  * drift event's `rerunUrl` and the relay's name (#4818): `notify.message` in
@@ -33,12 +34,19 @@ export declare function productNotifySource(words: CiProductWords): string;
33
34
  export declare function productSendOptions(words: CiProductWords, options?: SendNotifyOptions): SendNotifyOptions;
34
35
  /** What a drift notice concerns. */
35
36
  export interface DriftNotifyInput {
36
- /** The members whose refresh found drift. */
37
- changed: string[];
37
+ /** The members whose refresh found drift. Left out, the {@link stacks} with drift records, in their order. */
38
+ changed?: string[];
38
39
  missing?: string[];
39
40
  /** The members whose refresh failed, so drift there is unknown. */
40
41
  failed?: string[];
42
+ /** The run's fingerprint. Left out, `driftRunFingerprint` of the {@link stacks}. */
41
43
  fingerprint?: string;
44
+ /**
45
+ * Each member's drift records, as the run read them (#4944). The notice
46
+ * then names the members with drift and carries the run's fingerprint, so
47
+ * a product passes what it read instead of computing either.
48
+ */
49
+ stacks?: readonly DriftRunStack[];
42
50
  project?: string;
43
51
  environment?: string;
44
52
  reportUrl?: string;
@@ -46,7 +54,8 @@ export interface DriftNotifyInput {
46
54
  /**
47
55
  * A `drift` event under `words`: `2 stacks drifted: shop-dev, shop-prod` for
48
56
  * plywood, `1 member drifted: net` for chant, with the failed refreshes
49
- * named after them.
57
+ * named after them. Given `stacks`, the drifted members and the
58
+ * fingerprint come from their records (#4944).
50
59
  */
51
60
  export declare function driftNotifyFields(words: CiProductWords, input: DriftNotifyInput): NotifyFields;
52
61
  //# sourceMappingURL=notify-product.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notify-product.d.ts","sourceRoot":"","sources":["../src/notify-product.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAA6B,KAAK,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC/G,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,aAAa,CAAC;AAErD,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,GAAG,oBAAoB,CAE9E;AAED,oFAAoF;AACpF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAEjE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,GAAE,iBAAsB,GAAG,iBAAiB,CAK5G;AAED,oCAAoC;AACpC,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,gBAAgB,GAAG,YAAY,CAqB9F"}
1
+ {"version":3,"file":"notify-product.d.ts","sourceRoot":"","sources":["../src/notify-product.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAA6B,KAAK,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC/G,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAA0C,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAE3F;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,aAAa,CAAC;AAErD,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,GAAG,oBAAoB,CAE9E;AAED,oFAAoF;AACpF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAEjE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,GAAE,iBAAsB,GAAG,iBAAiB,CAK5G;AAED,oCAAoC;AACpC,MAAM,WAAW,gBAAgB;IAC/B,8GAA8G;IAC9G,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,oFAAoF;IACpF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,gBAAgB,GAAG,YAAY,CAuB9F"}
@@ -12,6 +12,7 @@
12
12
  * ```
13
13
  */
14
14
  import { CHANT_WORDS, isChantWords } from "./ci-product-words.js";
15
+ import { driftIssueRecords, driftRunFingerprint } from "./drift-issue.js";
15
16
  /**
16
17
  * The first chant whose Slack and Teams messages take a product's words, a
17
18
  * drift event's `rerunUrl` and the relay's name (#4818): `notify.message` in
@@ -43,24 +44,27 @@ export function productSendOptions(words, options = {}) {
43
44
  /**
44
45
  * A `drift` event under `words`: `2 stacks drifted: shop-dev, shop-prod` for
45
46
  * plywood, `1 member drifted: net` for chant, with the failed refreshes
46
- * named after them.
47
+ * named after them. Given `stacks`, the drifted members and the
48
+ * fingerprint come from their records (#4944).
47
49
  */
48
50
  export function driftNotifyFields(words, input) {
49
51
  const [one, many] = words.noun;
50
- const n = input.changed.length;
52
+ const changed = input.changed ?? (input.stacks ?? []).filter((s) => driftIssueRecords(s.records).length > 0).map((s) => s.stack);
53
+ const fingerprint = input.fingerprint ?? (input.stacks ? driftRunFingerprint(input.stacks) : undefined);
54
+ const n = changed.length;
51
55
  const failed = input.failed ?? [];
52
- const what = n > 0 ? `${n} ${n === 1 ? one : many} drifted: ${input.changed.join(", ")}` : `no ${many} drifted`;
56
+ const what = n > 0 ? `${n} ${n === 1 ? one : many} drifted: ${changed.join(", ")}` : `no ${many} drifted`;
53
57
  const summary = failed.length > 0 ? `${what}; ${failed.length} ${failed.length === 1 ? one : many} could not be refreshed: ${failed.join(", ")}` : what;
54
58
  return {
55
59
  source: productNotifySource(words),
56
60
  event: "drift",
57
61
  summary,
58
- targets: input.changed,
62
+ targets: changed,
59
63
  drift: {
60
- changed: input.changed,
64
+ changed,
61
65
  ...(input.missing?.length ? { missing: input.missing } : {}),
62
66
  ...(failed.length > 0 ? { failed } : {}),
63
- ...(input.fingerprint ? { fingerprint: input.fingerprint } : {}),
67
+ ...(fingerprint ? { fingerprint } : {}),
64
68
  },
65
69
  ...(input.project !== undefined ? { project: input.project } : {}),
66
70
  ...(input.environment !== undefined ? { environment: input.environment } : {}),
@@ -1 +1 @@
1
- {"version":3,"file":"source-release.d.ts","sourceRoot":"","sources":["../../../src/op/activities/source-release.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,OAAO,EAAmC,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIxF,MAAM,WAAW,iBAAiB;IAChC,mGAAmG;IACnG,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,GAAG,CAAC,EA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Q,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,mEAAmE;AACnE,wBAAsB,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAmDzF"}
@@ -21,6 +21,7 @@ import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
21
21
  import { join, resolve } from "node:path";
22
22
  import { sortedJsonReplacer } from "../../utils.js";
23
23
  import { archiveSourceTree, sha256Digest } from "../source-archive.js";
24
+ import { actorFromEnv } from "../../actor.js";
24
25
  /** Archive a directory of a commit (default HEAD); see ../source-archive.ts. */
25
26
  export async function sourceArchive(args) {
26
27
  return archiveSourceTree({ dir: args.path, ref: args.ref, out: args.out, cwd: args.cwd });
@@ -79,7 +80,7 @@ export async function releaseRecord(args) {
79
80
  await pushLifecycle(opts);
80
81
  return { recorded: false, digest: plan.digest, env, component, approver };
81
82
  }
82
- const actor = args.actor || process.env.GITHUB_ACTOR || process.env.GITLAB_USER_LOGIN || process.env.USER;
83
+ const actor = args.actor || actorFromEnv(process.env, "");
83
84
  if (!actor)
84
85
  throw new Error("releaseRecord: no actor: pass one, or set GITHUB_ACTOR, GITLAB_USER_LOGIN or USER");
85
86
  const { runId, runOrigin } = resolveRunId(args.runId);
@@ -1 +1 @@
1
- {"version":3,"file":"source-rollback.d.ts","sourceRoot":"","sources":["../../../src/op/activities/source-rollback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OAAO,KAAK,EAAoB,aAAa,EAAc,MAAM,gCAAgC,CAAC;AAMlG,MAAM,WAAW,uBAAuB;IACtC,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,2GAA2G;IAC3G,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,GAAG,CAAC,EAAE,MAAM,CAAC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IAClB,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,qDAAqD;AACrD,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAkDjH"}
1
+ {"version":3,"file":"source-rollback.d.ts","sourceRoot":"","sources":["../../../src/op/activities/source-rollback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OAAO,KAAK,EAAoB,aAAa,EAAc,MAAM,gCAAgC,CAAC;AAOlG,MAAM,WAAW,uBAAuB;IACtC,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,2GAA2G;IAC3G,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,yBAAyB;IACxC,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,iHAAiH;IACjH,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,OAAO,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,aAAa,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;CACb;AAKD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,aAAa,EAAE,EACxB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,EAAE,CAAC,EAAE,MAAM,GACV;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,QAAQ,EAAE,aAAa,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAmBxE;AAED,kIAAkI;AAClI,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CA0D3G;AAID,MAAM,WAAW,yBAAyB;IACxC,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2FAA2F;IAC3F,QAAQ,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,2BAA2B;IAC1C,4DAA4D;IAC5D,QAAQ,EAAE,OAAO,CAAC;IAClB,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,qDAAqD;AACrD,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAkDjH"}
@@ -24,6 +24,7 @@ import { execFileSync } from "node:child_process";
24
24
  import { realpathSync } from "node:fs";
25
25
  import { join, resolve } from "node:path";
26
26
  import { archiveSourceTree } from "../source-archive.js";
27
+ import { actorFromEnv } from "../../actor.js";
27
28
  import { readReleasePlan, releasePlan, releasePlanDigest } from "./source-release.js";
28
29
  /** A record's reference, the way `restores` and `promotedFrom` name one. */
29
30
  const refTo = (r) => ({ env: r.env, runId: r.runId, timestamp: r.timestamp });
@@ -147,7 +148,7 @@ export async function releaseRollbackRecord(args) {
147
148
  if (latest?.digest === rollback.to && latest.restores?.runId === rollback.restores.runId && latest.restores.timestamp === rollback.restores.timestamp) {
148
149
  return { recorded: false, digest: rollback.to, env, component, approver };
149
150
  }
150
- const actor = args.actor || process.env.GITHUB_ACTOR || process.env.GITLAB_USER_LOGIN || process.env.USER;
151
+ const actor = args.actor || actorFromEnv(process.env, "");
151
152
  if (!actor)
152
153
  throw new Error("releaseRollbackRecord: no actor: pass one, or set GITHUB_ACTOR, GITLAB_USER_LOGIN or USER");
153
154
  const { runId, runOrigin } = resolveRunId(args.runId);
@@ -0,0 +1,84 @@
1
+ /**
2
+ * The apply statuses of an Op waves run (#4987): `<product>/apply` on the
3
+ * commit the waves applied, after each wave and after the last.
4
+ *
5
+ * A job of its own posts each one, `apply-status-<n>`, after wave n's jobs,
6
+ * at the default branch's commit with the wave jobs' outcome files. It runs
7
+ * none of the change's code: a before-merge run's wave jobs run the pull
8
+ * request's head, and this job holds the status token they do not need.
9
+ * The commit is the push's, or a before-merge run's decided head.
10
+ *
11
+ * What it posts, from the outcomes of waves 1 to n (`applyOutcomeOf`):
12
+ *
13
+ * - every run applied or had nothing to apply: `wave n of N applied`,
14
+ * pending, until the last wave, whose status is the one success;
15
+ * - a run waits at its gate: pending, `wave n of N waits for an approval`
16
+ * (failed on GitLab, which refuses to move a running status back to
17
+ * pending and keeps the pipeline running while one is left running; a
18
+ * retry posts a new one);
19
+ * - a run failed, or was blocked by one that did: failed, with the counts.
20
+ *
21
+ * A wave that wrote no outcome (its job stopped before its command, or the
22
+ * waves stopped before it) gets no status: the one before it stands, and
23
+ * the run's own jobs say what stopped.
24
+ *
25
+ * A `rest` wave's status job (#4992) posts for the wave its run ran, which
26
+ * a follow-on run names in `CHANT_WAVES_WAVE`, counted out of the waves the
27
+ * plan found, from the rest wave's note (./op-waves-follow-on.ts): a run
28
+ * that started a follow-on is not the last, so its status stays pending.
29
+ * The last run's status adds up every run of the chain (#4998): the
30
+ * earlier runs' outcomes come in the note's `chain`.
31
+ *
32
+ * Kept free of the forge client and git, so the generators import the
33
+ * names and the command line alone.
34
+ */
35
+ import type { ForgeStatusState, PrForge } from "../pr-forge.js";
36
+ /** The apply statuses option of an Op waves pipeline (#4987), `OpWavesPipelineOptions.applyStatus`. */
37
+ export interface OpWavesApplyStatus {
38
+ /** The status's name, such as `terragucci/apply`: `productStatusContext(words, "apply", member)`. */
39
+ context: string;
40
+ }
41
+ /** The job after wave `wave` that posts its apply status. */
42
+ export declare function applyStatusJobName(wave: number): string;
43
+ /** Whether `context` is a status name a forge keeps: no spaces, quotes or shell characters, at most 255 characters. */
44
+ export declare function assertApplyStatusContext(context: string): void;
45
+ /**
46
+ * The status job's command, through the product's bin: `chant run wave --op
47
+ * <op> --wave <n> --of <count> --apply-status <context> --at <sha> --forge
48
+ * <forge>`. It names the op and the wave count rather than the spec file,
49
+ * which a spec rendered at run time (#4982) leaves uncommitted.
50
+ */
51
+ export declare function applyStatusCommand(spec: {
52
+ name: string;
53
+ waves: readonly unknown[];
54
+ }, wave: number | string, context: string, forge: "github" | "forgejo" | "gitlab", at: string, bin?: string): string;
55
+ /** The status one wave's job posts, or none. */
56
+ export interface OpWaveApplyStatus {
57
+ state: Extract<ForgeStatusState, "running" | "success" | "failed">;
58
+ description: string;
59
+ }
60
+ /**
61
+ * The apply status after wave `wave` of `of`, from the outcome files under
62
+ * `dirs`. Undefined when wave `wave` wrote no outcome.
63
+ */
64
+ export declare function opWaveApplyStatus(dirs: readonly string[], wave: number, of: number, forge: "github" | "forgejo" | "gitlab"): OpWaveApplyStatus | undefined;
65
+ /** What {@link postOpWaveApplyStatus} posts with. */
66
+ export interface PostApplyStatusInput {
67
+ forge: Pick<PrForge, "kind" | "setStatus" | "runUrl">;
68
+ /** The directories the wave jobs' outcome files were downloaded into. */
69
+ dirs: readonly string[];
70
+ wave: number;
71
+ of: number;
72
+ context: string;
73
+ /** The commit the waves applied: the push's, or a before-merge run's decided head. */
74
+ at: string;
75
+ /** GitLab: the pipeline the status belongs to, when `at` is the pipeline's own commit; else GitLab files it under the commit's newest pipeline. */
76
+ pipelineId?: number;
77
+ }
78
+ /**
79
+ * Post the apply status after wave `wave` on `at` (#4987), linked to the
80
+ * run. Resolves to the line the job logs; a wave with no outcome posts
81
+ * nothing. The forge's refusal is thrown.
82
+ */
83
+ export declare function postOpWaveApplyStatus(i: PostApplyStatusInput): Promise<string>;
84
+ //# sourceMappingURL=apply-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply-status.d.ts","sourceRoot":"","sources":["../../src/op/apply-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG7D,uGAAuG;AACvG,MAAM,WAAW,kBAAkB;IACjC,qGAAqG;IACrG,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,6DAA6D;AAC7D,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,uHAAuH;AACvH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE9D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,OAAO,EAAE,CAAA;CAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAOtM;AAED,gDAAgD;AAChD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,OAAO,CAAC,gBAAgB,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,C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