@intentius/chant-lexicon-pulumi 0.124.98 → 0.124.99

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 (316) hide show
  1. package/dist/adopt.d.ts +0 -1
  2. package/dist/capability-plugin.d.ts +0 -1
  3. package/dist/change-set.d.ts +0 -1
  4. package/dist/changed-units.d.ts +0 -1
  5. package/dist/check-step.d.ts +0 -1
  6. package/dist/ci-setup.d.ts +0 -1
  7. package/dist/codegen/docs-cli.d.ts +0 -1
  8. package/dist/codegen/docs.d.ts +0 -1
  9. package/dist/codegen/package.d.ts +0 -1
  10. package/dist/composites/pulumi-adopt-op.d.ts +0 -1
  11. package/dist/composites/pulumi-watch-op.d.ts +0 -1
  12. package/dist/config.d.ts +0 -1
  13. package/dist/describe-resources.d.ts +0 -1
  14. package/dist/drift-read.d.ts +0 -1
  15. package/dist/drift-record.d.ts +0 -1
  16. package/dist/engine-events.d.ts +0 -1
  17. package/dist/engine-graph.d.ts +0 -1
  18. package/dist/exit-codes.d.ts +0 -1
  19. package/dist/index.d.ts +0 -1
  20. package/dist/init-templates.d.ts +0 -1
  21. package/dist/integrity.json +2 -2
  22. package/dist/lint/audit-catalog.d.ts +0 -1
  23. package/dist/lint/post-synth/index.d.ts +0 -1
  24. package/dist/lint/post-synth/member-read-helpers.d.ts +0 -1
  25. package/dist/lint/post-synth/pul001.d.ts +0 -1
  26. package/dist/lint/post-synth/pul002.d.ts +0 -1
  27. package/dist/lint/post-synth/pul003.d.ts +0 -1
  28. package/dist/lint/post-synth/pul004.d.ts +0 -1
  29. package/dist/lint/post-synth/pul005.d.ts +0 -1
  30. package/dist/lint/post-synth/pul006.d.ts +0 -1
  31. package/dist/lint/post-synth/pul007.d.ts +0 -1
  32. package/dist/lint/post-synth/pul008.d.ts +0 -1
  33. package/dist/lint/post-synth/pul009.d.ts +0 -1
  34. package/dist/lint/post-synth/pul010.d.ts +0 -1
  35. package/dist/lint/post-synth/pul011.d.ts +0 -1
  36. package/dist/lint/post-synth/pul012.d.ts +0 -1
  37. package/dist/lint/post-synth/pul013.d.ts +0 -1
  38. package/dist/lint/post-synth/pul014.d.ts +0 -1
  39. package/dist/lint/post-synth/pul015.d.ts +0 -1
  40. package/dist/lint/rules/index.d.ts +0 -1
  41. package/dist/lint/rules/member-dir-absolute.d.ts +0 -1
  42. package/dist/lock-rows.d.ts +0 -1
  43. package/dist/lsp/completions.d.ts +0 -1
  44. package/dist/lsp/documents.d.ts +0 -1
  45. package/dist/lsp/hover.d.ts +0 -1
  46. package/dist/lsp/keys.d.ts +0 -1
  47. package/dist/lsp/object-path.d.ts +0 -1
  48. package/dist/lsp/yaml-cursor.d.ts +0 -1
  49. package/dist/manifest.json +1 -1
  50. package/dist/member-engine.d.ts +0 -1
  51. package/dist/member-outputs.d.ts +0 -1
  52. package/dist/op/activities/index.d.ts +0 -1
  53. package/dist/op/activities/pulumi-adopt.d.ts +0 -1
  54. package/dist/op/activities/pulumi.d.ts +0 -1
  55. package/dist/op/activity-contracts.d.ts +0 -1
  56. package/dist/op/builders.d.ts +0 -1
  57. package/dist/package-cli.d.ts +0 -1
  58. package/dist/plan-shape.d.ts +0 -1
  59. package/dist/planned-output-changes.d.ts +0 -1
  60. package/dist/plugin.d.ts +0 -1
  61. package/dist/plunge-timings.d.ts +0 -1
  62. package/dist/preview-tips.d.ts +0 -1
  63. package/dist/pulumi-up.d.ts +0 -1
  64. package/dist/release-copy.d.ts +0 -1
  65. package/dist/review-stack.d.ts +0 -1
  66. package/dist/run.d.ts +0 -1
  67. package/dist/serializer.d.ts +0 -1
  68. package/dist/stack-export-snapshot.d.ts +0 -1
  69. package/dist/stack-ops.d.ts +0 -1
  70. package/dist/stack-outputs.d.ts +0 -1
  71. package/dist/stack-references.d.ts +0 -1
  72. package/dist/trace-facts.d.ts +0 -1
  73. package/dist/values.d.ts +0 -1
  74. package/dist/workspace-member.d.ts +0 -1
  75. package/package.json +3 -4
  76. package/dist/adopt.d.ts.map +0 -1
  77. package/dist/capability-plugin.d.ts.map +0 -1
  78. package/dist/change-set.d.ts.map +0 -1
  79. package/dist/changed-units.d.ts.map +0 -1
  80. package/dist/check-step.d.ts.map +0 -1
  81. package/dist/ci-setup.d.ts.map +0 -1
  82. package/dist/codegen/docs-cli.d.ts.map +0 -1
  83. package/dist/codegen/docs.d.ts.map +0 -1
  84. package/dist/codegen/package.d.ts.map +0 -1
  85. package/dist/composites/pulumi-adopt-op.d.ts.map +0 -1
  86. package/dist/composites/pulumi-watch-op.d.ts.map +0 -1
  87. package/dist/config.d.ts.map +0 -1
  88. package/dist/describe-resources.d.ts.map +0 -1
  89. package/dist/drift-read.d.ts.map +0 -1
  90. package/dist/drift-record.d.ts.map +0 -1
  91. package/dist/engine-events.d.ts.map +0 -1
  92. package/dist/engine-graph.d.ts.map +0 -1
  93. package/dist/exit-codes.d.ts.map +0 -1
  94. package/dist/index.d.ts.map +0 -1
  95. package/dist/init-templates.d.ts.map +0 -1
  96. package/dist/lint/audit-catalog.d.ts.map +0 -1
  97. package/dist/lint/post-synth/index.d.ts.map +0 -1
  98. package/dist/lint/post-synth/member-read-helpers.d.ts.map +0 -1
  99. package/dist/lint/post-synth/pul001.d.ts.map +0 -1
  100. package/dist/lint/post-synth/pul002.d.ts.map +0 -1
  101. package/dist/lint/post-synth/pul003.d.ts.map +0 -1
  102. package/dist/lint/post-synth/pul004.d.ts.map +0 -1
  103. package/dist/lint/post-synth/pul005.d.ts.map +0 -1
  104. package/dist/lint/post-synth/pul006.d.ts.map +0 -1
  105. package/dist/lint/post-synth/pul007.d.ts.map +0 -1
  106. package/dist/lint/post-synth/pul008.d.ts.map +0 -1
  107. package/dist/lint/post-synth/pul009.d.ts.map +0 -1
  108. package/dist/lint/post-synth/pul010.d.ts.map +0 -1
  109. package/dist/lint/post-synth/pul011.d.ts.map +0 -1
  110. package/dist/lint/post-synth/pul012.d.ts.map +0 -1
  111. package/dist/lint/post-synth/pul013.d.ts.map +0 -1
  112. package/dist/lint/post-synth/pul014.d.ts.map +0 -1
  113. package/dist/lint/post-synth/pul015.d.ts.map +0 -1
  114. package/dist/lint/rules/index.d.ts.map +0 -1
  115. package/dist/lint/rules/member-dir-absolute.d.ts.map +0 -1
  116. package/dist/lock-rows.d.ts.map +0 -1
  117. package/dist/lsp/completions.d.ts.map +0 -1
  118. package/dist/lsp/documents.d.ts.map +0 -1
  119. package/dist/lsp/hover.d.ts.map +0 -1
  120. package/dist/lsp/keys.d.ts.map +0 -1
  121. package/dist/lsp/object-path.d.ts.map +0 -1
  122. package/dist/lsp/yaml-cursor.d.ts.map +0 -1
  123. package/dist/member-engine.d.ts.map +0 -1
  124. package/dist/member-outputs.d.ts.map +0 -1
  125. package/dist/op/activities/index.d.ts.map +0 -1
  126. package/dist/op/activities/pulumi-adopt.d.ts.map +0 -1
  127. package/dist/op/activities/pulumi.d.ts.map +0 -1
  128. package/dist/op/activity-contracts.d.ts.map +0 -1
  129. package/dist/op/builders.d.ts.map +0 -1
  130. package/dist/package-cli.d.ts.map +0 -1
  131. package/dist/plan-shape.d.ts.map +0 -1
  132. package/dist/planned-output-changes.d.ts.map +0 -1
  133. package/dist/plugin.d.ts.map +0 -1
  134. package/dist/plunge-timings.d.ts.map +0 -1
  135. package/dist/preview-tips.d.ts.map +0 -1
  136. package/dist/pulumi-up.d.ts.map +0 -1
  137. package/dist/release-copy.d.ts.map +0 -1
  138. package/dist/review-stack.d.ts.map +0 -1
  139. package/dist/run.d.ts.map +0 -1
  140. package/dist/serializer.d.ts.map +0 -1
  141. package/dist/stack-export-snapshot.d.ts.map +0 -1
  142. package/dist/stack-ops.d.ts.map +0 -1
  143. package/dist/stack-outputs.d.ts.map +0 -1
  144. package/dist/stack-references.d.ts.map +0 -1
  145. package/dist/trace-facts.d.ts.map +0 -1
  146. package/dist/values.d.ts.map +0 -1
  147. package/dist/workspace-member.d.ts.map +0 -1
  148. package/src/adopt.ts +0 -202
  149. package/src/capability-plugin.ts +0 -34
  150. package/src/change-set.test.ts +0 -245
  151. package/src/change-set.ts +0 -508
  152. package/src/changed-units.test.ts +0 -87
  153. package/src/changed-units.ts +0 -96
  154. package/src/check-step.test.ts +0 -191
  155. package/src/check-step.ts +0 -316
  156. package/src/ci-setup.test.ts +0 -234
  157. package/src/ci-setup.ts +0 -224
  158. package/src/codegen/docs-cli.ts +0 -4
  159. package/src/codegen/docs.ts +0 -58
  160. package/src/codegen/package.ts +0 -63
  161. package/src/composites/pulumi-adopt-op.test.ts +0 -258
  162. package/src/composites/pulumi-adopt-op.ts +0 -193
  163. package/src/composites/pulumi-watch-op.test.ts +0 -42
  164. package/src/composites/pulumi-watch-op.ts +0 -85
  165. package/src/config.ts +0 -43
  166. package/src/describe-resources.test.ts +0 -112
  167. package/src/describe-resources.ts +0 -118
  168. package/src/drift-read.test.ts +0 -178
  169. package/src/drift-read.ts +0 -94
  170. package/src/drift-record.test.ts +0 -197
  171. package/src/drift-record.ts +0 -326
  172. package/src/engine-events.test.ts +0 -160
  173. package/src/engine-events.ts +0 -395
  174. package/src/engine-graph.test.ts +0 -141
  175. package/src/engine-graph.ts +0 -149
  176. package/src/exit-codes.test.ts +0 -21
  177. package/src/exit-codes.ts +0 -71
  178. package/src/index.ts +0 -139
  179. package/src/init-templates.ts +0 -85
  180. package/src/lint/audit-catalog.test.ts +0 -33
  181. package/src/lint/audit-catalog.ts +0 -174
  182. package/src/lint/post-synth/index.ts +0 -35
  183. package/src/lint/post-synth/member-read-helpers.ts +0 -122
  184. package/src/lint/post-synth/post-synth.test.ts +0 -245
  185. package/src/lint/post-synth/pul001.ts +0 -38
  186. package/src/lint/post-synth/pul002.ts +0 -38
  187. package/src/lint/post-synth/pul003.ts +0 -43
  188. package/src/lint/post-synth/pul004.ts +0 -32
  189. package/src/lint/post-synth/pul005.ts +0 -31
  190. package/src/lint/post-synth/pul006.ts +0 -31
  191. package/src/lint/post-synth/pul007.ts +0 -35
  192. package/src/lint/post-synth/pul008.ts +0 -35
  193. package/src/lint/post-synth/pul009.ts +0 -32
  194. package/src/lint/post-synth/pul010.ts +0 -42
  195. package/src/lint/post-synth/pul011.ts +0 -38
  196. package/src/lint/post-synth/pul012.ts +0 -35
  197. package/src/lint/post-synth/pul013.ts +0 -35
  198. package/src/lint/post-synth/pul014.ts +0 -32
  199. package/src/lint/post-synth/pul015.ts +0 -39
  200. package/src/lint/rules/index.ts +0 -7
  201. package/src/lint/rules/member-dir-absolute.test.ts +0 -37
  202. package/src/lint/rules/member-dir-absolute.ts +0 -83
  203. package/src/lock-rows.test.ts +0 -60
  204. package/src/lock-rows.ts +0 -56
  205. package/src/lsp/completions.test.ts +0 -69
  206. package/src/lsp/completions.ts +0 -119
  207. package/src/lsp/documents.ts +0 -48
  208. package/src/lsp/hover.test.ts +0 -56
  209. package/src/lsp/hover.ts +0 -83
  210. package/src/lsp/keys.ts +0 -169
  211. package/src/lsp/object-path.ts +0 -71
  212. package/src/lsp/yaml-cursor.ts +0 -85
  213. package/src/member-engine.test.ts +0 -112
  214. package/src/member-engine.ts +0 -97
  215. package/src/member-outputs.test.ts +0 -339
  216. package/src/member-outputs.ts +0 -157
  217. package/src/op/activities/index.ts +0 -36
  218. package/src/op/activities/pulumi-adopt.ts +0 -345
  219. package/src/op/activities/pulumi.ts +0 -136
  220. package/src/op/activity-contracts.ts +0 -129
  221. package/src/op/builders.ts +0 -67
  222. package/src/package-cli.ts +0 -14
  223. package/src/plan-shape.test.ts +0 -91
  224. package/src/plan-shape.ts +0 -105
  225. package/src/planned-output-changes.test.ts +0 -85
  226. package/src/planned-output-changes.ts +0 -141
  227. package/src/plugin.test.ts +0 -96
  228. package/src/plugin.ts +0 -272
  229. package/src/plunge-timings.test.ts +0 -241
  230. package/src/plunge-timings.ts +0 -115
  231. package/src/plunge-up-failed.test.ts +0 -54
  232. package/src/pr-note.test.ts +0 -87
  233. package/src/preview-generated.test.ts +0 -124
  234. package/src/preview-tips.test.ts +0 -134
  235. package/src/preview-tips.ts +0 -128
  236. package/src/pulumi-up.test.ts +0 -581
  237. package/src/pulumi-up.ts +0 -1102
  238. package/src/pulumi-urn-node.test.ts +0 -94
  239. package/src/release-copy.test.ts +0 -162
  240. package/src/release-copy.ts +0 -223
  241. package/src/review-stack.test.ts +0 -254
  242. package/src/review-stack.ts +0 -266
  243. package/src/run-plan-flags.test.ts +0 -53
  244. package/src/run.test.ts +0 -540
  245. package/src/run.ts +0 -1129
  246. package/src/serializer.test.ts +0 -9
  247. package/src/serializer.ts +0 -15
  248. package/src/skills/chant-pulumi-plunge.md +0 -51
  249. package/src/skills/chant-pulumi-stack-export.md +0 -54
  250. package/src/skills/chant-pulumi.md +0 -83
  251. package/src/stack-export-snapshot.test.ts +0 -192
  252. package/src/stack-export-snapshot.ts +0 -312
  253. package/src/stack-ops.fake-binary.test.ts +0 -323
  254. package/src/stack-ops.test.ts +0 -511
  255. package/src/stack-ops.ts +0 -1082
  256. package/src/stack-outputs.ts +0 -66
  257. package/src/stack-references.test.ts +0 -96
  258. package/src/stack-references.ts +0 -110
  259. package/src/testdata/plunge-drift/README.md +0 -10
  260. package/src/testdata/plunge-drift/assets-drifted.ndjson +0 -3
  261. package/src/testdata/plunge-drift/component-unsupported.ndjson +0 -3
  262. package/src/testdata/plunge-drift/role-in-sync.ndjson +0 -3
  263. package/src/testdata/plunge-drift/settled-empty.ndjson +0 -2
  264. package/src/testdata/plunge-graph/Pulumi.yaml +0 -4
  265. package/src/testdata/plunge-graph/README.md +0 -12
  266. package/src/testdata/plunge-graph/engine-graph.json +0 -158
  267. package/src/testdata/plunge-graph/stack-export.json +0 -49
  268. package/src/testdata/plunge-member/Pulumi.yaml +0 -4
  269. package/src/testdata/plunge-member/README.md +0 -3
  270. package/src/testdata/plunge-member/stack-export.json +0 -480
  271. package/src/testdata/plunge-outputs/Pulumi.yaml +0 -9
  272. package/src/testdata/plunge-outputs/README.md +0 -7
  273. package/src/testdata/plunge-outputs/stack-export.json +0 -2003
  274. package/src/testdata/plunge-outputs/stack-output.json +0 -19
  275. package/src/testdata/pulumi-member/Pulumi.yaml +0 -2
  276. package/src/testdata/pulumi-member/README.md +0 -50
  277. package/src/testdata/pulumi-member/recording/Pulumi.dev.yaml +0 -19
  278. package/src/testdata/pulumi-member/recording/Pulumi.yaml +0 -7
  279. package/src/testdata/pulumi-member/recording/index.js +0 -47
  280. package/src/testdata/pulumi-member/recording/package-lock.json +0 -2707
  281. package/src/testdata/pulumi-member/recording/package.json +0 -9
  282. package/src/testdata/pulumi-member/stack-export.json +0 -746
  283. package/src/testdata/pulumi-outputs/Pulumi.yaml +0 -7
  284. package/src/testdata/pulumi-outputs/README.md +0 -9
  285. package/src/testdata/pulumi-outputs/preview-replaced.json +0 -2894
  286. package/src/testdata/pulumi-outputs/preview-settled.json +0 -2894
  287. package/src/testdata/pulumi-outputs/stack-export.json +0 -1919
  288. package/src/testdata/pulumi-outputs/stack-output.json +0 -19
  289. package/src/testdata/pulumi-preview/Pulumi.yaml +0 -7
  290. package/src/testdata/pulumi-preview/README.md +0 -9
  291. package/src/testdata/pulumi-preview/preview-create.json +0 -992
  292. package/src/testdata/pulumi-preview/preview.json +0 -2894
  293. package/src/testdata/pulumi-preview/stack-export.json +0 -1919
  294. package/src/testdata/pulumi-refresh/Pulumi.yaml +0 -7
  295. package/src/testdata/pulumi-refresh/README.md +0 -14
  296. package/src/testdata/pulumi-refresh/all.json +0 -3742
  297. package/src/testdata/pulumi-refresh/bucket-edited.json +0 -468
  298. package/src/testdata/pulumi-refresh/policy-deleted.json +0 -95
  299. package/src/testdata/pulumi-refresh/queue-edited.json +0 -250
  300. package/src/testdata/pulumi-refresh/role-same.json +0 -242
  301. package/src/testdata/pulumi-refresh/secret-edited.json +0 -247
  302. package/src/testdata/pulumi-refresh/stack-export.json +0 -1907
  303. package/src/testdata/pulumi-stream/README.md +0 -16
  304. package/src/testdata/pulumi-stream/preview-stream.ndjson +0 -42
  305. package/src/testdata/pulumi-stream/up-failed-plunge.ndjson +0 -5
  306. package/src/testdata/pulumi-unexported/Pulumi.yaml +0 -2
  307. package/src/testdata/pulumi-urn-node/Pulumi.yaml +0 -7
  308. package/src/testdata/pulumi-urn-node/README.md +0 -9
  309. package/src/testdata/pulumi-urn-node/preview.json +0 -2894
  310. package/src/testdata/pulumi-urn-node/stack-export.json +0 -1919
  311. package/src/trace-facts.test.ts +0 -38
  312. package/src/trace-facts.ts +0 -83
  313. package/src/values.ts +0 -147
  314. package/src/workspace-kinds.test.ts +0 -47
  315. package/src/workspace-member.test.ts +0 -127
  316. package/src/workspace-member.ts +0 -304
@@ -1,345 +0,0 @@
1
- /**
2
- * `PulumiAdoptOp`'s activities (#4562): check the bucket, export the stock
3
- * checkpoint, preview the adoption, adopt. The composite
4
- * (`../../composites/pulumi-adopt-op.ts`) puts its gate between the preview
5
- * and the adoption, bound to the preview's `planDigest`.
6
- *
7
- * - `pulumiAdoptCheck`: the shared bucket check (#4558, `@intentius/chant/bucket-check`)
8
- * on the bucket the stack's backend URL names. A failing setting that is
9
- * not waived (`allow_insecure` on the URL, `PLUNGE_ALLOW_INSECURE`, or the
10
- * step's `allowInsecure`) refuses the stack by name with its fix, before
11
- * anything is exported. A `file://` backend has no bucket and is skipped.
12
- * - `pulumiAdoptExport`: stock `pulumi stack export --stack <s>`, through the
13
- * read allowlist (#4546), against the stack's stock backend at the same
14
- * root (the backend URL without `plunge+`) or the step's `from.backend`
15
- * (Pulumi Cloud, for the `--file` route). The export is kept in a scratch
16
- * file under the OS temp dir, mode 600, since it holds secret ciphertext:
17
- * it is the back-out copy, and on the `--file` route the document plunge
18
- * adopts. `from.file` names an export taken by hand instead, and nothing
19
- * runs. The result gives the file, its SHA-256 and its counts.
20
- * - `pulumiAdoptPreview`: `plunge stack adopt --json --stack <s> [--file f]`,
21
- * which classifies and writes nothing. A refused adoption fails the step,
22
- * naming each refusal. Its `planDigest` (`../../adopt.ts`'s
23
- * `pulumiAdoptDigest`) is what the gate binds.
24
- * - `pulumiAdopt`: `plunge stack adopt --json --yes --stack <s> [--file f]`
25
- * through `runAdoptPlunge`, the one entry point allowed to write. It
26
- * reports whether what plunge adopted digests as the approved preview did.
27
- *
28
- * None of them calls a cloud API but the bucket check's reads: adoption
29
- * writes plunge's records only, and the next `plunge up` writes the
30
- * markers.
31
- */
32
- import { createHash } from "node:crypto";
33
- import { existsSync, mkdtempSync, readFileSync, writeFileSync } from "node:fs";
34
- import { tmpdir } from "node:os";
35
- import { isAbsolute, join, resolve } from "node:path";
36
- import type { BucketReport, BucketTarget, CheckBucketOptions } from "@intentius/chant/bucket-check";
37
- import {
38
- adoptBucketTarget,
39
- adoptFates,
40
- parsePlungeAdoptView,
41
- pulumiAdoptDigest,
42
- pulumiStackBackend,
43
- stockBackendUrl,
44
- type PlungeAdoptRefusal,
45
- type PlungeAdoptStatus,
46
- type PlungeAdoptView,
47
- } from "../../adopt";
48
- import { pulumiExportResources } from "../../change-set";
49
- import {
50
- defaultPlungeRunner,
51
- defaultPulumiRunner,
52
- plungeAdoptArgs,
53
- pulumiRunFailure,
54
- runAdoptPlunge,
55
- runAllowedPlunge,
56
- runAllowedPulumi,
57
- type PulumiRunner,
58
- } from "../../run";
59
- import { isObject } from "../../values";
60
-
61
- /** The fields every adopt activity takes. */
62
- export interface PulumiAdoptStackArgs {
63
- /** The member's name. */
64
- member: string;
65
- /** The stack's directory, where `Pulumi.yaml` is. Relative paths resolve against `cwd`. */
66
- dir: string;
67
- cwd?: string;
68
- /** The stack to adopt. */
69
- stack: string;
70
- }
71
-
72
- export interface PulumiAdoptCheckArgs extends PulumiAdoptStackArgs {
73
- /** The plunge backend URL (`plunge+s3://...`). Default: `plywood.yml`'s, `PULUMI_BACKEND_URL`, `Pulumi.yaml`'s. */
74
- backend?: string;
75
- /** The bucket to check, when the URL does not say enough (azblob), as `@intentius/chant/bucket-check` takes it. */
76
- bucket?: Record<string, unknown>;
77
- /** Key prefixes a lifecycle rule must cover. Default: the URL's path. */
78
- namespaces?: string[];
79
- /** Settings waived on top of the URL's `allow_insecure` and `PLUNGE_ALLOW_INSECURE`. An unwaivable one stays refused. */
80
- allowInsecure?: string[];
81
- }
82
-
83
- export interface PulumiAdoptCheckResult {
84
- member: string;
85
- stack: string;
86
- /** False when there was no bucket to check. */
87
- checked: boolean;
88
- /** Why the check did not run. */
89
- skipped?: string;
90
- store?: string;
91
- bucket?: string;
92
- correct: boolean;
93
- /** Settings that failed and were waived. */
94
- waived: string[];
95
- }
96
-
97
- export interface PulumiAdoptExportArgs extends PulumiAdoptStackArgs {
98
- /** The plunge backend URL; its stock form is where the export is read. */
99
- backend?: string;
100
- /** Where the checkpoint comes from instead: another backend (Pulumi Cloud, `https://api.pulumi.com`), or an export already taken. */
101
- from?: { backend?: string; file?: string };
102
- }
103
-
104
- export interface PulumiAdoptExportResult {
105
- member: string;
106
- stack: string;
107
- /** The export, a scratch file (mode 600) or `from.file`. */
108
- file: string;
109
- sha256: string;
110
- resources: number;
111
- pendingOperations: number;
112
- /** The backend it was read from, or `file`. */
113
- source: string;
114
- /** True when plunge adopts this file (`--file`), on the route from another backend or a given file. */
115
- adoptFromFile: boolean;
116
- }
117
-
118
- export interface PulumiAdoptPreviewArgs extends PulumiAdoptStackArgs {
119
- /** `--file`: the export to adopt, from the Export step when `adoptFromFile`. */
120
- file?: string;
121
- /**
122
- * The plunge backend URL plunge adopts onto, passed as `PULUMI_BACKEND_URL`. Default, as the Check
123
- * step resolves it: `plywood.yml`'s, `PULUMI_BACKEND_URL`, `Pulumi.yaml`'s.
124
- */
125
- backend?: string;
126
- }
127
-
128
- export interface PulumiAdoptPreviewResult {
129
- member: string;
130
- stack: string;
131
- status: PlungeAdoptStatus;
132
- /** What the gate binds. */
133
- planDigest: string;
134
- checkpointDigest: string | null;
135
- resources: number;
136
- /** Resources by fate: marker, record, pending, already-adopted. */
137
- fates: Record<string, number>;
138
- /** False when the stack is already adopted from this checkpoint. */
139
- changed: boolean;
140
- }
141
-
142
- export interface PulumiAdoptArgs extends PulumiAdoptPreviewArgs {
143
- /** The approved preview's digest, to report whether the adoption matched it. */
144
- planDigest?: string;
145
- }
146
-
147
- export interface PulumiAdoptResult extends PulumiAdoptPreviewResult {
148
- /** Whether what plunge adopted digests as the approved preview. Absent when no digest was handed in. */
149
- matchesApproved?: boolean;
150
- }
151
-
152
- /** Runners and seams, injectable so the tests run no binary and read no bucket. */
153
- export interface PulumiAdoptDeps {
154
- run?: PulumiRunner;
155
- plunge?: PulumiRunner;
156
- env?: Record<string, string | undefined>;
157
- tmp?: string;
158
- checkBucket?: (target: BucketTarget, options: CheckBucketOptions) => Promise<BucketReport>;
159
- }
160
-
161
- function stackDir(a: PulumiAdoptStackArgs): string {
162
- return isAbsolute(a.dir) ? a.dir : resolve(a.cwd ?? process.cwd(), a.dir);
163
- }
164
-
165
- function requireStack(a: PulumiAdoptStackArgs, what: string): void {
166
- if (typeof a?.dir !== "string" || a.dir === "") throw new Error(`${what}: the step needs "dir", the directory holding Pulumi.yaml`);
167
- if (typeof a.stack !== "string" || a.stack === "" || a.stack.startsWith("-")) throw new Error(`${what}: the step needs "stack", the stack to adopt`);
168
- }
169
-
170
- function refusalText(refusals: readonly PlungeAdoptRefusal[]): string {
171
- return refusals.map((r) => `${r.code}${r.urn ? ` (${r.urn})` : ""}: ${r.reason}`).join("; ");
172
- }
173
-
174
- /** The shared bucket check on the stack's backend bucket; throws when a setting fails unwaived. */
175
- export async function adoptCheck(a: PulumiAdoptCheckArgs, deps: PulumiAdoptDeps = {}): Promise<PulumiAdoptCheckResult> {
176
- requireStack(a, "pulumiAdoptCheck");
177
- const env = deps.env ?? process.env;
178
- const dir = stackDir(a);
179
- const base = { member: a.member, stack: a.stack };
180
- let target: BucketTarget;
181
- let namespaces: string[];
182
- let waived: string[];
183
- if (a.bucket) {
184
- target = a.bucket as unknown as BucketTarget;
185
- namespaces = a.namespaces ?? [];
186
- waived = [...(env.PLUNGE_ALLOW_INSECURE ?? "").split(",").map((s) => s.trim()).filter(Boolean)];
187
- } else {
188
- const backend = pulumiStackBackend(dir, { ...(a.backend ? { configured: a.backend } : {}), env });
189
- if (!backend) {
190
- throw new Error(`pulumiAdoptCheck: "${a.member}/${a.stack}" names no backend (the step's backend, plywood.yml, PULUMI_BACKEND_URL or Pulumi.yaml), so its bucket cannot be checked before adoption`);
191
- }
192
- const found = adoptBucketTarget(backend.url, env);
193
- if ("skip" in found) return { ...base, checked: false, skipped: found.skip, correct: true, waived: [] };
194
- if ("refuse" in found) throw new Error(`pulumiAdoptCheck: refusing to adopt "${a.member}/${a.stack}": ${found.refuse}`);
195
- target = found.target;
196
- namespaces = a.namespaces ?? found.namespaces;
197
- waived = found.waived;
198
- }
199
- waived = [...new Set([...waived, ...(a.allowInsecure ?? [])])];
200
- const check =
201
- deps.checkBucket ??
202
- (async (t: BucketTarget, o: CheckBucketOptions) => {
203
- const mod = await import("@intentius/chant/bucket-check");
204
- return mod.checkBucket(t, o);
205
- });
206
- const report = await check(target, { namespaces });
207
- const failing = report.settings.filter((f) => f.verdict !== "ok");
208
- const refused = failing.filter((f) => f.unwaivable || !waived.includes(f.setting));
209
- if (refused.length > 0) {
210
- const lines = refused.map((f) => `${f.setting} (${f.verdict}): ${f.found}${f.fix ? `; fix: ${f.fix}` : ""}${f.unwaivable ? "; no waiver reaches it" : ""}`);
211
- throw new Error(`pulumiAdoptCheck: refusing to adopt "${a.member}/${a.stack}": the ${report.store} bucket ${report.bucket} fails the shared check: ${lines.join(" | ")}`);
212
- }
213
- return { ...base, checked: true, store: report.store, bucket: report.bucket, correct: report.correct, waived: failing.map((f) => f.setting) };
214
- }
215
-
216
- /** The stock checkpoint as a scratch file, or the given one. */
217
- export async function adoptExport(a: PulumiAdoptExportArgs, deps: PulumiAdoptDeps = {}): Promise<PulumiAdoptExportResult> {
218
- requireStack(a, "pulumiAdoptExport");
219
- const env = deps.env ?? process.env;
220
- const dir = stackDir(a);
221
- const base = { member: a.member, stack: a.stack };
222
- const summarize = (text: string, file: string, source: string, adoptFromFile: boolean): PulumiAdoptExportResult => {
223
- let doc: unknown;
224
- try {
225
- doc = JSON.parse(text);
226
- } catch {
227
- throw new Error(`pulumiAdoptExport: the export of "${a.member}/${a.stack}" from ${source} is not JSON`);
228
- }
229
- const deployment = isObject(doc) && isObject(doc.deployment) ? doc.deployment : undefined;
230
- const pending = deployment && Array.isArray(deployment.pending_operations) ? deployment.pending_operations.length : 0;
231
- return {
232
- ...base,
233
- file,
234
- sha256: createHash("sha256").update(text).digest("hex"),
235
- resources: pulumiExportResources(doc).length,
236
- pendingOperations: pending,
237
- source,
238
- adoptFromFile,
239
- };
240
- };
241
-
242
- if (a.from?.file) {
243
- const file = isAbsolute(a.from.file) ? a.from.file : resolve(dir, a.from.file);
244
- if (!existsSync(file)) throw new Error(`pulumiAdoptExport: the export ${file} for "${a.member}/${a.stack}" does not exist`);
245
- return summarize(readFileSync(file, "utf-8"), file, "file", true);
246
- }
247
-
248
- let source: string | undefined;
249
- if (a.from?.backend) {
250
- source = a.from.backend;
251
- } else {
252
- const backend = pulumiStackBackend(dir, { ...(a.backend ? { configured: a.backend } : {}), env });
253
- source = backend ? stockBackendUrl(backend.url) : undefined;
254
- }
255
- const args = ["stack", "export", "--stack", a.stack];
256
- let stdout: string;
257
- try {
258
- ({ stdout } = await runAllowedPulumi(deps.run ?? defaultPulumiRunner, args, dir, source ? { PULUMI_BACKEND_URL: source } : undefined));
259
- } catch (err) {
260
- const f = pulumiRunFailure(err);
261
- const why = f.missingBinary ? "the pulumi binary was not found on PATH" : (f.stderr?.trim() || f.message).split("\n").slice(-3).join("\n");
262
- throw new Error(`pulumiAdoptExport: pulumi ${args.join(" ")} for "${a.member}/${a.stack}"${source ? ` against ${source}` : ""} failed: ${why}`);
263
- }
264
- const scratch = mkdtempSync(join(deps.tmp ?? tmpdir(), "chant-pulumi-adopt-"));
265
- const file = join(scratch, `${a.stack.replace(/[^A-Za-z0-9._-]+/g, "_")}.export.json`);
266
- writeFileSync(file, stdout, { mode: 0o600 });
267
- return summarize(stdout, file, source ?? "the selected backend", a.from?.backend !== undefined);
268
- }
269
-
270
- /** The adopt document from a run, its failure's stdout included; throws when there is none. */
271
- async function adoptView(run: () => Promise<{ stdout: string }>, what: string, command: string): Promise<PlungeAdoptView> {
272
- try {
273
- const { stdout } = await run();
274
- const view = parsePlungeAdoptView(stdout);
275
- if (!view) throw new Error(`${what}: ${command} printed no adopt document`);
276
- return view;
277
- } catch (err) {
278
- const f = pulumiRunFailure(err);
279
- const view = parsePlungeAdoptView(f.stdout);
280
- if (view) return view;
281
- if (err instanceof Error && err.message.startsWith(`${what}:`)) throw err;
282
- const why = f.missingBinary ? "the plunge binary was not found on PATH" : (f.stderr?.trim() || f.message).split("\n").slice(-3).join("\n");
283
- throw new Error(`${what}: ${command} failed: ${why}`);
284
- }
285
- }
286
-
287
- function summary(a: PulumiAdoptStackArgs, view: PlungeAdoptView): PulumiAdoptPreviewResult {
288
- return {
289
- member: a.member,
290
- stack: a.stack,
291
- status: view.status,
292
- planDigest: pulumiAdoptDigest(view),
293
- checkpointDigest: view.checkpoint.digest ?? null,
294
- resources: view.resources.length,
295
- fates: adoptFates(view),
296
- changed: view.status !== "already-adopted",
297
- };
298
- }
299
-
300
- /** The backend plunge adopts onto, resolved as the Check step resolves it, as plunge's environment. */
301
- function adoptEnv(a: PulumiAdoptPreviewArgs, dir: string, deps: PulumiAdoptDeps): Record<string, string> | undefined {
302
- const backend = pulumiStackBackend(dir, { ...(a.backend ? { configured: a.backend } : {}), env: deps.env ?? process.env });
303
- return backend ? { PULUMI_BACKEND_URL: backend.url } : undefined;
304
- }
305
-
306
- /** `plunge stack adopt --json`: the classification, written nowhere. A refusal fails the step. */
307
- export async function adoptPreview(a: PulumiAdoptPreviewArgs, deps: PulumiAdoptDeps = {}): Promise<PulumiAdoptPreviewResult> {
308
- requireStack(a, "pulumiAdoptPreview");
309
- const dir = stackDir(a);
310
- const args = plungeAdoptArgs({ stack: a.stack, ...(a.file ? { file: a.file } : {}) });
311
- const view = await adoptView(() => runAllowedPlunge(deps.plunge ?? defaultPlungeRunner, args, dir, adoptEnv(a, dir, deps)), "pulumiAdoptPreview", `plunge ${args.join(" ")}`);
312
- if (view.status === "refused") {
313
- throw new Error(`pulumiAdoptPreview: plunge refuses to adopt "${a.member}/${a.stack}": ${refusalText(view.refusals)}. Nothing was written.`);
314
- }
315
- return summary(a, view);
316
- }
317
-
318
- /** `plunge stack adopt --json --yes`: writes the records. A refusal fails the step; plunge wrote nothing then. */
319
- export async function adoptStack(a: PulumiAdoptArgs, deps: PulumiAdoptDeps = {}): Promise<PulumiAdoptResult> {
320
- requireStack(a, "pulumiAdopt");
321
- const dir = stackDir(a);
322
- const args = plungeAdoptArgs({ stack: a.stack, yes: true, ...(a.file ? { file: a.file } : {}) });
323
- const view = await adoptView(() => runAdoptPlunge(deps.plunge ?? defaultPlungeRunner, args, dir, adoptEnv(a, dir, deps)), "pulumiAdopt", `plunge ${args.join(" ")}`);
324
- if (view.status === "refused") {
325
- throw new Error(`pulumiAdopt: plunge refused to adopt "${a.member}/${a.stack}": ${refusalText(view.refusals)}. Nothing was written.`);
326
- }
327
- const out = summary(a, view);
328
- return { ...out, ...(a.planDigest ? { matchesApproved: out.planDigest === a.planDigest } : {}) };
329
- }
330
-
331
- export async function pulumiAdoptCheck(args: Record<string, unknown>): Promise<PulumiAdoptCheckResult> {
332
- return adoptCheck(args as unknown as PulumiAdoptCheckArgs);
333
- }
334
-
335
- export async function pulumiAdoptExport(args: Record<string, unknown>): Promise<PulumiAdoptExportResult> {
336
- return adoptExport(args as unknown as PulumiAdoptExportArgs);
337
- }
338
-
339
- export async function pulumiAdoptPreview(args: Record<string, unknown>): Promise<PulumiAdoptPreviewResult> {
340
- return adoptPreview(args as unknown as PulumiAdoptPreviewArgs);
341
- }
342
-
343
- export async function pulumiAdopt(args: Record<string, unknown>): Promise<PulumiAdoptResult> {
344
- return adoptStack(args as unknown as PulumiAdoptArgs);
345
- }
@@ -1,136 +0,0 @@
1
- /**
2
- * The pulumi lexicon's Op activities (#4494): the member's preview and its
3
- * drift, as steps an Op can run.
4
- *
5
- * Both call what `chant workspace plan` and `chant workspace drift` already
6
- * call (`../../run.ts`), so they run nothing the #4476 command list does not
7
- * already allow: `pulumi preview --json` (or `plunge preview --json`) and
8
- * `pulumi refresh --preview-only --json --target <urn>` (or `plunge drift
9
- * --resource <urn> --stream`). Neither changes the stack. There is no apply
10
- * activity: a stack applies as a component step through the `pulumi-up`
11
- * capability (`../../pulumi-up.ts`, #4541), the only caller of `up`.
12
- *
13
- * `dir` is the member's directory, where `Pulumi.yaml` is, resolved against
14
- * `cwd` (default: the process's working directory, the project root on a
15
- * `chant run`).
16
- */
17
- import { isAbsolute, resolve } from "node:path";
18
- import type { ChangeSetAction } from "@intentius/chant/change-set";
19
- import type { DriftStatus } from "@intentius/chant/drift-record";
20
- import { previewPulumiMemberRead, refreshPulumiMember, type PulumiMemberEngine } from "../../run";
21
-
22
- /** The fields every activity here takes. */
23
- export interface PulumiMemberArgs {
24
- /** The member's name, as the change set and the drift records name it. */
25
- member: string;
26
- /** The member's directory, where `Pulumi.yaml` is. Relative paths resolve against `cwd`. */
27
- dir: string;
28
- /** Where a relative `dir` resolves from. Default: the process's working directory. */
29
- cwd?: string;
30
- /** The stack to read. Default: the stack the member's directory has selected. */
31
- stack?: string;
32
- /** `pulumi` or `plunge`. Default: what `Pulumi.yaml`'s backend URL says (`pulumiMemberEngine`). */
33
- engine?: PulumiMemberEngine;
34
- }
35
-
36
- export type PulumiPreviewArgs = PulumiMemberArgs;
37
-
38
- export interface PulumiPreviewResult {
39
- member: string;
40
- /** The binary that ran. */
41
- engine: PulumiMemberEngine;
42
- status: "planned" | "failed";
43
- error?: string;
44
- /** What a gate on this member's preview binds. `null` when the preview failed. */
45
- planDigest: string | null;
46
- /** True when the preview plans any create, update, replace, delete or forget. */
47
- changed: boolean;
48
- creates: number;
49
- updates: number;
50
- replaces: number;
51
- deletes: number;
52
- /** Entries for resources the preview could not list (registered inside an `apply()`), which may appear on apply. */
53
- mayAppear: number;
54
- }
55
-
56
- export interface PulumiDriftArgs extends PulumiMemberArgs {
57
- /** The URNs to read. Default: the checked-in `stack-export.json`'s resources. */
58
- urns?: string[];
59
- }
60
-
61
- export interface PulumiDriftResult {
62
- member: string;
63
- /** One count per status the records hold. */
64
- counts: Partial<Record<DriftStatus, number>>;
65
- /** Records that are `drifted` or `missing`: what changed outside the program. */
66
- drifted: number;
67
- /** Records the read could not answer for (`not-observed`). */
68
- notObserved: number;
69
- records: number;
70
- }
71
-
72
- const CHANGING: ReadonlySet<ChangeSetAction> = new Set(["create", "update", "replace", "delete", "forget"]);
73
-
74
- function memberDir(args: PulumiMemberArgs): string {
75
- return isAbsolute(args.dir) ? args.dir : resolve(args.cwd ?? process.cwd(), args.dir);
76
- }
77
-
78
- /**
79
- * `pulumi preview --json` in the member's directory, as counts an Op can
80
- * publish. A preview that fails is `status: "failed"` with the error, and the
81
- * step fails with it, so a run never reports "no changes" off a preview that
82
- * did not run.
83
- */
84
- export async function pulumiPreview(args: Record<string, unknown>): Promise<PulumiPreviewResult> {
85
- const a = args as unknown as PulumiPreviewArgs;
86
- const read = await previewPulumiMemberRead({
87
- member: a.member,
88
- dir: memberDir(a),
89
- ...(a.stack ? { stack: a.stack } : {}),
90
- ...(a.engine ? { engine: a.engine } : {}),
91
- });
92
- const { member, entries } = read.part;
93
- if (member.status === "failed") {
94
- throw new Error(`${read.engine} preview for member ${a.member} failed: ${member.error ?? "no error printed"}`);
95
- }
96
- const count = (action: ChangeSetAction) => entries.filter((e) => e.action === action && !e.mayAppear).length;
97
- return {
98
- member: a.member,
99
- engine: read.engine,
100
- status: member.status,
101
- planDigest: member.planDigest,
102
- changed: entries.some((e) => CHANGING.has(e.action) || e.mayAppear === true),
103
- creates: count("create"),
104
- updates: count("update"),
105
- replaces: count("replace"),
106
- deletes: count("delete"),
107
- mayAppear: entries.filter((e) => e.mayAppear === true).length,
108
- };
109
- }
110
-
111
- /**
112
- * The member's drift records, one targeted `pulumi refresh --preview-only`
113
- * per resource (or `plunge drift --resource <urn> --stream` on plunge),
114
- * summarised as counts. A resource the read could not reach is counted as
115
- * not-observed and the others still read.
116
- */
117
- export async function pulumiDrift(args: Record<string, unknown>): Promise<PulumiDriftResult> {
118
- const a = args as unknown as PulumiDriftArgs;
119
- const records = await refreshPulumiMember({
120
- member: a.member,
121
- dir: memberDir(a),
122
- observedAt: new Date().toISOString(),
123
- ...(a.stack ? { stack: a.stack } : {}),
124
- ...(a.engine ? { engine: a.engine } : {}),
125
- ...(a.urns ? { urns: a.urns } : {}),
126
- });
127
- const counts: Partial<Record<DriftStatus, number>> = {};
128
- for (const r of records) counts[r.status] = (counts[r.status] ?? 0) + 1;
129
- return {
130
- member: a.member,
131
- counts,
132
- drifted: (counts.drifted ?? 0) + (counts.missing ?? 0),
133
- notObserved: counts["not-observed"] ?? 0,
134
- records: records.length,
135
- };
136
- }
@@ -1,129 +0,0 @@
1
- /**
2
- * Activity contracts for this lexicon's `op/activities` (#4494), resolved at
3
- * `@intentius/chant-lexicon-pulumi/op/activity-contracts` by
4
- * `loadActivityContracts` (`packages/core/src/op/activity-contract-registry.ts`)
5
- * for OPS012 and OPS013, the same convention the terraform lexicon follows.
6
- * Each `args` schema mirrors the `*Args` interface in `./activities/pulumi.ts`
7
- * and is strict, so a misspelled field fails the build; each `returns` schema
8
- * spells the fields an outcome or a later step may reference.
9
- */
10
- import { z } from "zod";
11
- import { activityContract } from "@intentius/chant/op";
12
-
13
- const memberArgs = {
14
- member: z.string(),
15
- dir: z.string(),
16
- cwd: z.string().optional(),
17
- stack: z.string().optional(),
18
- engine: z.enum(["pulumi", "plunge"]).optional(),
19
- };
20
-
21
- /** The `member` arg names the workspace member the step reads, so op.json's IR can join the step to it. */
22
- const memberEntity = { entities: ["member"] };
23
-
24
- export const pulumiPreviewContract = activityContract(
25
- "pulumiPreview",
26
- z.strictObject(memberArgs),
27
- z.object({
28
- member: z.string(),
29
- engine: z.enum(["pulumi", "plunge"]),
30
- status: z.enum(["planned", "failed"]),
31
- error: z.string().optional(),
32
- planDigest: z.string().nullable(),
33
- changed: z.boolean(),
34
- creates: z.number(),
35
- updates: z.number(),
36
- replaces: z.number(),
37
- deletes: z.number(),
38
- mayAppear: z.number(),
39
- }),
40
- memberEntity,
41
- );
42
-
43
- export const pulumiDriftContract = activityContract(
44
- "pulumiDrift",
45
- z.strictObject({ ...memberArgs, urns: z.array(z.string()).optional() }),
46
- z.object({
47
- member: z.string(),
48
- counts: z.record(z.string(), z.number()),
49
- drifted: z.number(),
50
- notObserved: z.number(),
51
- records: z.number(),
52
- }),
53
- memberEntity,
54
- );
55
-
56
- // PulumiAdoptOp's steps (#4562).
57
- const adoptStackArgs = {
58
- member: z.string(),
59
- dir: z.string(),
60
- cwd: z.string().optional(),
61
- stack: z.string(),
62
- };
63
-
64
- const adoptPreviewReturns = {
65
- member: z.string(),
66
- stack: z.string(),
67
- status: z.enum(["would-adopt", "adopted", "already-adopted", "refused"]),
68
- planDigest: z.string(),
69
- checkpointDigest: z.string().nullable(),
70
- resources: z.number(),
71
- fates: z.record(z.string(), z.number()),
72
- changed: z.boolean(),
73
- };
74
-
75
- export const pulumiAdoptCheckContract = activityContract(
76
- "pulumiAdoptCheck",
77
- z.strictObject({
78
- ...adoptStackArgs,
79
- backend: z.string().optional(),
80
- bucket: z.record(z.string(), z.unknown()).optional(),
81
- namespaces: z.array(z.string()).optional(),
82
- allowInsecure: z.array(z.string()).optional(),
83
- }),
84
- z.object({
85
- member: z.string(),
86
- stack: z.string(),
87
- checked: z.boolean(),
88
- skipped: z.string().optional(),
89
- store: z.string().optional(),
90
- bucket: z.string().optional(),
91
- correct: z.boolean(),
92
- waived: z.array(z.string()),
93
- }),
94
- memberEntity,
95
- );
96
-
97
- export const pulumiAdoptExportContract = activityContract(
98
- "pulumiAdoptExport",
99
- z.strictObject({
100
- ...adoptStackArgs,
101
- backend: z.string().optional(),
102
- from: z.strictObject({ backend: z.string().optional(), file: z.string().optional() }).optional(),
103
- }),
104
- z.object({
105
- member: z.string(),
106
- stack: z.string(),
107
- file: z.string(),
108
- sha256: z.string(),
109
- resources: z.number(),
110
- pendingOperations: z.number(),
111
- source: z.string(),
112
- adoptFromFile: z.boolean(),
113
- }),
114
- memberEntity,
115
- );
116
-
117
- export const pulumiAdoptPreviewContract = activityContract(
118
- "pulumiAdoptPreview",
119
- z.strictObject({ ...adoptStackArgs, file: z.string().optional(), backend: z.string().optional() }),
120
- z.object(adoptPreviewReturns),
121
- memberEntity,
122
- );
123
-
124
- export const pulumiAdoptContract = activityContract(
125
- "pulumiAdopt",
126
- z.strictObject({ ...adoptStackArgs, file: z.string().optional(), backend: z.string().optional(), planDigest: z.string().optional() }),
127
- z.object({ ...adoptPreviewReturns, matchesApproved: z.boolean().optional() }),
128
- memberEntity,
129
- );
@@ -1,67 +0,0 @@
1
- /**
2
- * Typed step builders for this lexicon's activities (#4494), in the shape of
3
- * `lexicons/terraform/src/op/builders.ts`: `opts` is the activity's own
4
- * `*Args` interface minus the positional `member`, so renaming a field on the
5
- * activity stops its callers compiling. `id` routes to the step's `id`, and
6
- * both default to the `longInfra` profile, since a preview and a refresh call
7
- * every provider the stack uses.
8
- */
9
- import { activity, takeProfileAndId, type ActivityStep, type NamedActivityStep, type WithStepRefs } from "@intentius/chant/op";
10
- import type { PulumiDriftArgs, PulumiPreviewArgs } from "./activities/pulumi";
11
- import type { PulumiAdoptArgs, PulumiAdoptCheckArgs, PulumiAdoptExportArgs, PulumiAdoptPreviewArgs } from "./activities/pulumi-adopt";
12
-
13
- type StepOpts = { profile?: ActivityStep["profile"]; id?: string };
14
-
15
- /** `pulumi preview --json` for the named member: the typed twin of the `pulumiPreview` activity. */
16
- export const pulumiPreview = (
17
- member: string,
18
- opts: WithStepRefs<Omit<PulumiPreviewArgs, "member">> & StepOpts,
19
- ): NamedActivityStep => {
20
- const { args, profile, id } = takeProfileAndId(opts as Record<string, unknown>);
21
- return activity("pulumiPreview", { member, ...args }, { profile: profile ?? "longInfra", ...(id ? { id } : {}) });
22
- };
23
-
24
- /** The member's drift read: the typed twin of the `pulumiDrift` activity. */
25
- export const pulumiDrift = (
26
- member: string,
27
- opts: WithStepRefs<Omit<PulumiDriftArgs, "member">> & StepOpts,
28
- ): NamedActivityStep => {
29
- const { args, profile, id } = takeProfileAndId(opts as Record<string, unknown>);
30
- return activity("pulumiDrift", { member, ...args }, { profile: profile ?? "longInfra", ...(id ? { id } : {}) });
31
- };
32
-
33
- /** The shared bucket check before adoption (#4562): the typed twin of `pulumiAdoptCheck`. */
34
- export const pulumiAdoptCheck = (
35
- member: string,
36
- opts: WithStepRefs<Omit<PulumiAdoptCheckArgs, "member">> & StepOpts,
37
- ): NamedActivityStep => {
38
- const { args, profile, id } = takeProfileAndId(opts as Record<string, unknown>);
39
- return activity("pulumiAdoptCheck", { member, ...args }, { ...(profile ? { profile } : {}), ...(id ? { id } : {}) });
40
- };
41
-
42
- /** The stock checkpoint's export (#4562): the typed twin of `pulumiAdoptExport`. */
43
- export const pulumiAdoptExport = (
44
- member: string,
45
- opts: WithStepRefs<Omit<PulumiAdoptExportArgs, "member">> & StepOpts,
46
- ): NamedActivityStep => {
47
- const { args, profile, id } = takeProfileAndId(opts as Record<string, unknown>);
48
- return activity("pulumiAdoptExport", { member, ...args }, { ...(profile ? { profile } : {}), ...(id ? { id } : {}) });
49
- };
50
-
51
- /** `plunge stack adopt --json` (#4562): the typed twin of `pulumiAdoptPreview`. */
52
- export const pulumiAdoptPreview = (
53
- member: string,
54
- opts: WithStepRefs<Omit<PulumiAdoptPreviewArgs, "member">> & StepOpts,
55
- ): NamedActivityStep => {
56
- const { args, profile, id } = takeProfileAndId(opts as Record<string, unknown>);
57
- return activity("pulumiAdoptPreview", { member, ...args }, { ...(profile ? { profile } : {}), ...(id ? { id } : {}) });
58
- };
59
-
60
- /** `plunge stack adopt --json --yes` (#4562): the typed twin of `pulumiAdopt`. */
61
- export const pulumiAdopt = (
62
- member: string,
63
- opts: WithStepRefs<Omit<PulumiAdoptArgs, "member">> & StepOpts,
64
- ): NamedActivityStep => {
65
- const { args, profile, id } = takeProfileAndId(opts as Record<string, unknown>);
66
- return activity("pulumiAdopt", { member, ...args }, { ...(profile ? { profile } : {}), ...(id ? { id } : {}) });
67
- };