@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,174 +0,0 @@
1
- /**
2
- * The pulumi lexicon's chant audit catalog: metadata for its post-synth
3
- * checks, contributed through `pulumiPlugin.auditCatalog()` (#4494), the way
4
- * the terraform lexicon contributes `terraformAuditCatalog`. A post-synth
5
- * check with no entry contributes nothing to `chant audit` and fails
6
- * `packages/core/src/audit/catalog.e2e.test.ts`.
7
- *
8
- * Every check reads the member the plugin's `buildRoots` left behind
9
- * (`lastMemberReport`, `lastMemberRead`), never emitted output, so
10
- * `yamlBased` is false. PUL001, PUL002 and PUL004 to PUL015 (#4510) are
11
- * correctness or best-practice findings about the graph chant reads, and
12
- * `report-only`: the build and the change set still run, and the fix is the
13
- * stack owner's, outside chant. PUL003, secrets committed in plaintext, is
14
- * the one security finding and the one `merge-worthy` entry; it cites no
15
- * authority, so the catalog's authority rules do not apply to it. None
16
- * carries `authority`. No other tool checks a checked-in stack export, so
17
- * there is no lineage to credit.
18
- */
19
- import type { RuleMeta } from "@intentius/chant/audit/catalog";
20
-
21
- export const pulumiAuditCatalog: Record<string, RuleMeta> = {
22
- PUL001: {
23
- id: "PUL001",
24
- tier: "report-only",
25
- fixKind: "guidance",
26
- category: "correctness",
27
- title: "Pulumi member has no readable stack-export.json, so it has no nodes in the graph",
28
- remediation:
29
- "Run `pulumi stack export --file stack-export.json` in the member's directory (beside Pulumi.yaml) " +
30
- "and check the file in, so the graph can link to the member's resources and drift records land on nodes.",
31
- yamlBased: false,
32
- },
33
- PUL002: {
34
- id: "PUL002",
35
- tier: "report-only",
36
- fixKind: "guidance",
37
- category: "correctness",
38
- title: "Pulumi member's stack export records pending operations from an interrupted update",
39
- remediation:
40
- "Resolve the pending operations with `pulumi refresh` (or `pulumi stack export`, edit, " +
41
- "`pulumi stack import`), then export the stack again and check in the new stack-export.json.",
42
- yamlBased: false,
43
- },
44
- PUL003: {
45
- id: "PUL003",
46
- tier: "merge-worthy",
47
- fixKind: "guidance",
48
- category: "security",
49
- title: "Pulumi member's stack export holds secret values in plaintext",
50
- remediation:
51
- "Export the stack again without --show-secrets (`pulumi stack export --file stack-export.json`), commit that file, and rotate every secret the plaintext export exposed in the repository's history.",
52
- yamlBased: false,
53
- },
54
- PUL004: {
55
- id: "PUL004",
56
- tier: "report-only",
57
- fixKind: "guidance",
58
- category: "correctness",
59
- title: "Pulumi member's stack export holds replaced resources whose delete failed",
60
- remediation:
61
- "Run `pulumi up` so Pulumi retries the pending delete, then export the stack again and check in the new stack-export.json.",
62
- yamlBased: false,
63
- },
64
- PUL005: {
65
- id: "PUL005",
66
- tier: "report-only",
67
- fixKind: "guidance",
68
- category: "correctness",
69
- title: "Pulumi member's stack export holds resources deleted for a replacement that was never created",
70
- remediation:
71
- "Run `pulumi up` to finish the replacement, then export the stack again and check in the new stack-export.json.",
72
- yamlBased: false,
73
- },
74
- PUL006: {
75
- id: "PUL006",
76
- tier: "report-only",
77
- fixKind: "guidance",
78
- category: "best-practice",
79
- title: "Pulumi member's stack export holds tainted resources the next update replaces",
80
- remediation:
81
- "Expect the replacement in the member's preview, or clear the mark with `pulumi state untaint <urn>` and export again.",
82
- yamlBased: false,
83
- },
84
- PUL007: {
85
- id: "PUL007",
86
- tier: "report-only",
87
- fixKind: "guidance",
88
- category: "correctness",
89
- title: "pulumi.member.stack names a stack other than the one the stack export was taken from",
90
- remediation:
91
- "Export the configured stack (`pulumi stack export --stack <name> --file stack-export.json`), or set pulumi.member.stack to the stack the export names.",
92
- yamlBased: false,
93
- },
94
- PUL008: {
95
- id: "PUL008",
96
- tier: "report-only",
97
- fixKind: "guidance",
98
- category: "correctness",
99
- title: "Pulumi member's stack export names more than one stack or project",
100
- remediation:
101
- "Replace stack-export.json with one `pulumi stack export` of the member's stack.",
102
- yamlBased: false,
103
- },
104
- PUL009: {
105
- id: "PUL009",
106
- tier: "report-only",
107
- fixKind: "guidance",
108
- category: "correctness",
109
- title: "Pulumi member's stack export belongs to a project other than the one Pulumi.yaml names",
110
- remediation:
111
- "Export this member's own stack again from the directory that holds its Pulumi.yaml, and check in that file.",
112
- yamlBased: false,
113
- },
114
- PUL010: {
115
- id: "PUL010",
116
- tier: "report-only",
117
- fixKind: "guidance",
118
- category: "correctness",
119
- title: "A resource in the Pulumi member's stack export names a parent or dependency the export does not hold",
120
- remediation:
121
- "Replace stack-export.json with a fresh `pulumi stack export`; an export Pulumi wrote holds every parent and dependency it names.",
122
- yamlBased: false,
123
- },
124
- PUL011: {
125
- id: "PUL011",
126
- tier: "report-only",
127
- fixKind: "guidance",
128
- category: "correctness",
129
- title: "Two live resources in the Pulumi member's stack export share a URN",
130
- remediation:
131
- "Replace stack-export.json with a fresh `pulumi stack export` instead of a merged or edited one.",
132
- yamlBased: false,
133
- },
134
- PUL012: {
135
- id: "PUL012",
136
- tier: "report-only",
137
- fixKind: "guidance",
138
- category: "best-practice",
139
- title: "Pulumi member's stack export holds resources the stack reads and does not manage",
140
- remediation:
141
- "Nothing to fix in the member: read drift on these nodes as another owner's changes, and look for their owner's member in the workspace.",
142
- yamlBased: false,
143
- },
144
- PUL013: {
145
- id: "PUL013",
146
- tier: "report-only",
147
- fixKind: "guidance",
148
- category: "correctness",
149
- title: "Pulumi member's stack export has a deployment version other than 3",
150
- remediation:
151
- "Export the stack with the Pulumi CLI (`pulumi stack export --file stack-export.json`), which writes version 3.",
152
- yamlBased: false,
153
- },
154
- PUL014: {
155
- id: "PUL014",
156
- tier: "report-only",
157
- fixKind: "guidance",
158
- category: "best-practice",
159
- title: "Pulumi member's stack export holds no resources",
160
- remediation:
161
- "If the stack has been deployed, export it again after `pulumi up`; if it is empty on purpose, nothing to do.",
162
- yamlBased: false,
163
- },
164
- PUL015: {
165
- id: "PUL015",
166
- tier: "report-only",
167
- fixKind: "guidance",
168
- category: "correctness",
169
- title: "pulumi.member.engine says pulumi, but Pulumi.yaml names a plunge backend",
170
- remediation:
171
- "Remove `engine` from pulumi.member so the backend URL decides, or set it to \"plunge\".",
172
- yamlBased: false,
173
- },
174
- };
@@ -1,35 +0,0 @@
1
- // Code generated by chant generate. DO NOT EDIT.
2
- import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
3
- import { pul001 } from "./pul001";
4
- import { pul002 } from "./pul002";
5
- import { pul003 } from "./pul003";
6
- import { pul004 } from "./pul004";
7
- import { pul005 } from "./pul005";
8
- import { pul006 } from "./pul006";
9
- import { pul007 } from "./pul007";
10
- import { pul008 } from "./pul008";
11
- import { pul009 } from "./pul009";
12
- import { pul010 } from "./pul010";
13
- import { pul011 } from "./pul011";
14
- import { pul012 } from "./pul012";
15
- import { pul013 } from "./pul013";
16
- import { pul014 } from "./pul014";
17
- import { pul015 } from "./pul015";
18
-
19
- export const postSynthChecks: PostSynthCheck[] = [
20
- pul001,
21
- pul002,
22
- pul003,
23
- pul004,
24
- pul005,
25
- pul006,
26
- pul007,
27
- pul008,
28
- pul009,
29
- pul010,
30
- pul011,
31
- pul012,
32
- pul013,
33
- pul014,
34
- pul015,
35
- ];
@@ -1,122 +0,0 @@
1
- /**
2
- * What PUL003 to PUL015 share: the member read the plugin's `buildRoots`
3
- * left behind (`lastMemberRead`, `../../workspace-member.ts`) and the
4
- * resources of its checked-in `pulumi stack export`.
5
- *
6
- * The checks read the export, not the build's output: this lexicon's
7
- * serializer writes `{}`, and the export is the only thing a pulumi member
8
- * contributes to a build. Each check is silent in a build that read no
9
- * member, and in one whose export did not read (PUL001 reports that).
10
- *
11
- * The export fields read here are `apitype.ResourceV3`'s: `urn`, `type`,
12
- * `parent`, `dependencies`, `inputs`, `outputs`, `external`, `delete`,
13
- * `pendingReplacement` and `taint`. Nothing here exports no check, so the
14
- * barrel generator skips the file and `chant dev check-lexicon` does not count
15
- * it (`-helpers.ts`).
16
- */
17
- import { existsSync, readFileSync } from "node:fs";
18
- import { join } from "node:path";
19
- import type { PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
20
- import type { Severity } from "@intentius/chant/lint/rule";
21
- import { parsePulumiUrn, pulumiNodeKey } from "@intentius/chant/pulumi-urn";
22
- import { parseYAML } from "@intentius/chant/yaml";
23
- import { isObject, PULUMI_SECRET_SIG, PULUMI_SIG_KEY } from "../../values";
24
- import { lastMemberRead, type PulumiMemberRead } from "../../workspace-member";
25
-
26
- /** One resource of the export, with the fields the checks read. */
27
- export interface ExportResource {
28
- urn: string;
29
- type: string;
30
- parent?: unknown;
31
- dependencies?: unknown;
32
- inputs?: unknown;
33
- outputs?: unknown;
34
- external?: unknown;
35
- delete?: unknown;
36
- pendingReplacement?: unknown;
37
- taint?: unknown;
38
- }
39
-
40
- /** The member read and its export's resources, or undefined when no member was read or its export did not read. */
41
- export function memberExport(): { read: PulumiMemberRead; doc: Record<string, unknown>; resources: ExportResource[] } | undefined {
42
- const read = lastMemberRead();
43
- if (!read || !isObject(read.doc)) return undefined;
44
- const deployment = isObject(read.doc.deployment) ? read.doc.deployment : undefined;
45
- const list = deployment && Array.isArray(deployment.resources) ? deployment.resources : [];
46
- const resources = list.filter(
47
- (r): r is ExportResource => isObject(r) && typeof r.urn === "string" && typeof r.type === "string",
48
- );
49
- return { read, doc: read.doc, resources };
50
- }
51
-
52
- /** The node a resource lands on (`<label>/<urn tail>`), or its URN when it has none. */
53
- export function entityOf(read: PulumiMemberRead, urn: string): string {
54
- const tail = pulumiNodeKey(urn);
55
- return tail === null ? urn : `${read.label}/${tail}`;
56
- }
57
-
58
- /** A pulumi diagnostic about one member. */
59
- export function finding(checkId: string, severity: Severity, message: string, entity?: string): PostSynthDiagnostic {
60
- return { checkId, severity, message, lexicon: "pulumi", ...(entity ? { entity } : {}) };
61
- }
62
-
63
- /** The resources whose export entry sets `field` to true. */
64
- export function flagged(resources: readonly ExportResource[], field: "external" | "delete" | "pendingReplacement" | "taint"): ExportResource[] {
65
- return resources.filter((r) => r[field] === true);
66
- }
67
-
68
- /**
69
- * The paths under `inputs` and `outputs` that hold a secret in plaintext: a
70
- * secret envelope (`{ [PULUMI_SIG_KEY]: PULUMI_SECRET_SIG, ... }`) with a
71
- * `plaintext` field. `pulumi stack export` writes `ciphertext` there;
72
- * `pulumi stack export --show-secrets` writes `plaintext`.
73
- */
74
- export function plaintextSecretPaths(resource: ExportResource): string[] {
75
- const out: string[] = [];
76
- const walk = (v: unknown, path: string) => {
77
- if (Array.isArray(v)) {
78
- v.forEach((x, i) => walk(x, `${path}[${i}]`));
79
- return;
80
- }
81
- if (!isObject(v)) return;
82
- if (v[PULUMI_SIG_KEY] === PULUMI_SECRET_SIG) {
83
- if ("plaintext" in v) out.push(path);
84
- return;
85
- }
86
- for (const [k, x] of Object.entries(v)) walk(x, `${path}.${k}`);
87
- };
88
- walk(resource.inputs, "inputs");
89
- walk(resource.outputs, "outputs");
90
- return out;
91
- }
92
-
93
- /** The distinct stacks and projects the export's URNs name. */
94
- export function urnScopes(resources: readonly ExportResource[]): { stacks: string[]; projects: string[] } {
95
- const stacks = new Set<string>();
96
- const projects = new Set<string>();
97
- for (const r of resources) {
98
- const parsed = parsePulumiUrn(r.urn);
99
- if (!parsed) continue;
100
- stacks.add(parsed.stack);
101
- projects.add(parsed.project);
102
- }
103
- return { stacks: [...stacks].sort(), projects: [...projects].sort() };
104
- }
105
-
106
- /** `name` from the member's `Pulumi.yaml`, or undefined when it has none or does not parse. */
107
- export function pulumiYamlName(dir: string): string | undefined {
108
- const file = join(dir, "Pulumi.yaml");
109
- if (!existsSync(file)) return undefined;
110
- try {
111
- const doc = parseYAML(readFileSync(file, "utf-8")) as { name?: unknown };
112
- return typeof doc?.name === "string" && doc.name.length > 0 ? doc.name : undefined;
113
- } catch {
114
- return undefined;
115
- }
116
- }
117
-
118
- /** A list for a message: the first few, then how many more. */
119
- export function listed(items: readonly string[], max = 3): string {
120
- const shown = items.slice(0, max).join(", ");
121
- return items.length > max ? `${shown} and ${items.length - max} more` : shown;
122
- }
@@ -1,245 +0,0 @@
1
- import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
2
- import { tmpdir } from "node:os";
3
- import { join } from "node:path";
4
- import { afterEach, describe, expect, test, vi } from "vitest";
5
- import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
6
- import { PULUMI_SECRET_SIG, PULUMI_SIG_KEY } from "../../values";
7
- import { setLastMemberRead, setLastMemberReport } from "../../workspace-member";
8
- import { postSynthChecks } from "./index";
9
- import { pul001 } from "./pul001";
10
- import { pul002 } from "./pul002";
11
- import { pul003 } from "./pul003";
12
- import { pul004 } from "./pul004";
13
- import { pul005 } from "./pul005";
14
- import { pul006 } from "./pul006";
15
- import { pul007 } from "./pul007";
16
- import { pul008 } from "./pul008";
17
- import { pul009 } from "./pul009";
18
- import { pul010 } from "./pul010";
19
- import { pul011 } from "./pul011";
20
- import { pul012 } from "./pul012";
21
- import { pul013 } from "./pul013";
22
- import { pul014 } from "./pul014";
23
- import { pul015 } from "./pul015";
24
-
25
- const ctx = { outputs: new Map(), entities: new Map() } as unknown as PostSynthContext;
26
-
27
- afterEach(() => {
28
- vi.unstubAllEnvs();
29
- setLastMemberReport(undefined);
30
- setLastMemberRead(undefined);
31
- });
32
-
33
- const testdata = join(import.meta.dirname, "..", "..", "testdata");
34
- /** testdata/pulumi-member: Pulumi.yaml names project `app`, no backend. */
35
- const stockDir = join(testdata, "pulumi-member");
36
- /** testdata/plunge-member: Pulumi.yaml names project `site` on `plunge+file://`. */
37
- const plungeDir = join(testdata, "plunge-member");
38
-
39
- const STACK = "urn:pulumi:dev::app::pulumi:pulumi:Stack::app-dev";
40
- const PROVIDER = "urn:pulumi:dev::app::pulumi:providers:aws::default";
41
- const BUCKET = "urn:pulumi:dev::app::aws:s3/bucketV2:BucketV2::assets";
42
- const ROLE = "urn:pulumi:dev::app::aws:iam/role:Role::web";
43
-
44
- const stackRes = { urn: STACK, type: "pulumi:pulumi:Stack" };
45
- const providerRes = { urn: PROVIDER, type: "pulumi:providers:aws" };
46
- const bucket = (extra: Record<string, unknown> = {}) => ({ urn: BUCKET, type: "aws:s3/bucketV2:BucketV2", parent: STACK, ...extra });
47
- const role = (extra: Record<string, unknown> = {}) => ({ urn: ROLE, type: "aws:iam/role:Role", parent: STACK, ...extra });
48
-
49
- /** Leave a member read whose export holds `resources`, as `buildRoots` would. */
50
- function readWith(resources: unknown[], opts: { dir?: string; stack?: string; engine?: "pulumi" | "plunge"; version?: unknown } = {}) {
51
- const doc: Record<string, unknown> = { deployment: { resources } };
52
- if (!("version" in opts)) doc.version = 3;
53
- else if (opts.version !== undefined) doc.version = opts.version;
54
- setLastMemberRead({
55
- dir: opts.dir ?? stockDir,
56
- label: "infra",
57
- ...(opts.stack ? { stack: opts.stack } : {}),
58
- ...(opts.engine ? { engine: opts.engine } : {}),
59
- doc,
60
- });
61
- }
62
-
63
- const clean = () => readWith([stackRes, providerRes, bucket(), role({ dependencies: [BUCKET] })]);
64
- const memberChecks = [pul003, pul004, pul005, pul006, pul007, pul008, pul009, pul010, pul011, pul012, pul013, pul014, pul015];
65
-
66
- describe("pulumi post-synth checks", () => {
67
- test("the barrel lists both", () => {
68
- expect(postSynthChecks.map((c) => c.id)).toEqual(Array.from({ length: 15 }, (_, i) => `PUL${String(i + 1).padStart(3, "0")}`));
69
- });
70
-
71
- test("every check stays silent in a build that read no member", () => {
72
- setLastMemberReport(undefined);
73
- for (const check of postSynthChecks) expect(check.check(ctx), check.id).toEqual([]);
74
- });
75
-
76
- test("PUL001 reports a member read with no export, with the reason", () => {
77
- setLastMemberReport({ objects: 0, exported: false, reason: "no stack-export.json in the member" });
78
- const diags = pul001.check(ctx);
79
- expect(diags).toHaveLength(1);
80
- expect(diags[0].checkId).toBe("PUL001");
81
- expect(diags[0].severity).toBe("warning");
82
- expect(diags[0].message).toContain("no stack-export.json in the member");
83
- expect(diags[0].missing).toEqual({ kind: "stack-export.json", scope: "pulumi member" });
84
- });
85
-
86
- test("PUL001 is silent for a member that was read", () => {
87
- setLastMemberReport({ export: "stack-export.json", objects: 3, exported: true });
88
- expect(pul001.check(ctx)).toEqual([]);
89
- });
90
-
91
- test("PUL002 reports pending operations and is silent without them", () => {
92
- setLastMemberReport({ export: "stack-export.json", objects: 3, exported: true, pendingOperations: 2 });
93
- const diags = pul002.check(ctx);
94
- expect(diags).toHaveLength(1);
95
- expect(diags[0].checkId).toBe("PUL002");
96
- expect(diags[0].message).toContain("2 pending operation(s)");
97
-
98
- setLastMemberReport({ export: "stack-export.json", objects: 3, exported: true });
99
- expect(pul002.check(ctx)).toEqual([]);
100
- });
101
-
102
- test("PUL003 to PUL015 are silent on a clean export", () => {
103
- clean();
104
- for (const check of memberChecks) expect(check.check(ctx), check.id).toEqual([]);
105
- });
106
-
107
- test("PUL003 reports a plaintext secret and not a ciphertext one", () => {
108
- const envelope = (field: string) => ({ [PULUMI_SIG_KEY]: PULUMI_SECRET_SIG, [field]: "\"hunter2\"" });
109
- readWith([stackRes, bucket({ inputs: { tags: { token: envelope("ciphertext") } } })]);
110
- expect(pul003.check(ctx)).toEqual([]);
111
- readWith([stackRes, bucket({ outputs: { policy: [envelope("plaintext")] } })]);
112
- const diags = pul003.check(ctx);
113
- expect(diags).toHaveLength(1);
114
- expect(diags[0]).toMatchObject({ checkId: "PUL003", severity: "error", entity: "infra/aws:s3/bucketV2:BucketV2::assets" });
115
- expect(diags[0].message).toContain("outputs.policy[0]");
116
- expect(diags[0].message).not.toContain("hunter2");
117
- });
118
-
119
- test("PUL004, PUL005 and PUL006 report delete, pendingReplacement and taint", () => {
120
- readWith([stackRes, bucket({ delete: true }), bucket(), role({ pendingReplacement: true, taint: true })]);
121
- expect(pul004.check(ctx).map((d) => d.entity)).toEqual(["infra/aws:s3/bucketV2:BucketV2::assets"]);
122
- expect(pul005.check(ctx).map((d) => d.entity)).toEqual(["infra/aws:iam/role:Role::web"]);
123
- const taint = pul006.check(ctx);
124
- expect(taint.map((d) => d.entity)).toEqual(["infra/aws:iam/role:Role::web"]);
125
- expect(taint[0].severity).toBe("info");
126
- // The pending-delete entry is the old object of a replacement, not a duplicate.
127
- expect(pul011.check(ctx)).toEqual([]);
128
- });
129
-
130
- test("PUL007 reports a configured stack the export was not taken from", () => {
131
- readWith([stackRes, bucket()], { stack: "dev" });
132
- expect(pul007.check(ctx)).toEqual([]);
133
- readWith([stackRes, bucket()], { stack: "prod" });
134
- const diags = pul007.check(ctx);
135
- expect(diags).toHaveLength(1);
136
- expect(diags[0].message).toContain('"prod"');
137
- expect(diags[0].message).toContain('"dev"');
138
- });
139
-
140
- test("PUL008 reports URNs from two stacks", () => {
141
- readWith([stackRes, bucket(), { urn: "urn:pulumi:prod::app::aws:iam/role:Role::web", type: "aws:iam/role:Role" }]);
142
- const diags = pul008.check(ctx);
143
- expect(diags).toHaveLength(1);
144
- expect(diags[0].message).toContain("stacks dev, prod");
145
- });
146
-
147
- test("PUL009 reports an export from a project Pulumi.yaml does not name", () => {
148
- readWith([{ urn: "urn:pulumi:dev::shop::aws:iam/role:Role::web", type: "aws:iam/role:Role" }]);
149
- const diags = pul009.check(ctx);
150
- expect(diags).toHaveLength(1);
151
- expect(diags[0].message).toContain('"shop"');
152
- expect(diags[0].message).toContain('"app"');
153
- });
154
-
155
- test("PUL010 reports a dependency the export does not hold", () => {
156
- readWith([stackRes, role({ dependencies: [BUCKET] })]);
157
- const diags = pul010.check(ctx);
158
- expect(diags).toHaveLength(1);
159
- expect(diags[0].entity).toBe("infra/aws:iam/role:Role::web");
160
- expect(diags[0].message).toContain(BUCKET);
161
- });
162
-
163
- test("PUL011 reports two live entries for one URN", () => {
164
- readWith([stackRes, bucket(), bucket()]);
165
- expect(pul011.check(ctx)).toHaveLength(1);
166
- });
167
-
168
- test("PUL012 reports external resources as information", () => {
169
- readWith([stackRes, providerRes, bucket({ external: true })]);
170
- const diags = pul012.check(ctx);
171
- expect(diags).toHaveLength(1);
172
- expect(diags[0].severity).toBe("info");
173
- expect(diags[0].message).toContain(BUCKET);
174
- });
175
-
176
- test("PUL013 reports an export version other than 3, or none", () => {
177
- readWith([stackRes, bucket()], { version: 2 });
178
- expect(pul013.check(ctx)[0].message).toContain("version 2");
179
- readWith([stackRes, bucket()], { version: undefined });
180
- expect(pul013.check(ctx)[0].message).toContain("no version");
181
- });
182
-
183
- test("PUL014 reports an export with only the stack and its providers", () => {
184
- readWith([stackRes, providerRes]);
185
- expect(pul014.check(ctx)).toHaveLength(1);
186
- readWith([]);
187
- expect(pul014.check(ctx)).toHaveLength(1);
188
- });
189
-
190
- test("PUL015 reports engine: pulumi on a plunge backend, and nothing else", () => {
191
- readWith([], { dir: plungeDir, engine: "pulumi" });
192
- const diags = pul015.check(ctx);
193
- expect(diags).toHaveLength(1);
194
- expect(diags[0].message).toContain("plunge+file://");
195
- readWith([], { dir: plungeDir, engine: "plunge" });
196
- expect(pul015.check(ctx)).toEqual([]);
197
- readWith([], { dir: plungeDir });
198
- expect(pul015.check(ctx)).toEqual([]);
199
- readWith([], { dir: stockDir, engine: "plunge" });
200
- expect(pul015.check(ctx)).toEqual([]);
201
- });
202
-
203
- test("PUL015 names the source of the resolved plunge engine", () => {
204
- // Pulumi.yaml
205
- readWith([], { dir: plungeDir, engine: "pulumi" });
206
- expect(pul015.check(ctx)[0].message).toContain("Pulumi.yaml names the plunge backend");
207
-
208
- // PULUMI_BACKEND_URL, on a program whose Pulumi.yaml names no backend
209
- vi.stubEnv("PULUMI_BACKEND_URL", "plunge+s3://bucket/state");
210
- readWith([], { dir: stockDir, engine: "pulumi" });
211
- const fromEnv = pul015.check(ctx);
212
- expect(fromEnv).toHaveLength(1);
213
- expect(fromEnv[0].message).toContain("PULUMI_BACKEND_URL names the plunge backend plunge+s3://bucket/state");
214
- readWith([], { dir: stockDir, engine: "plunge" });
215
- expect(pul015.check(ctx)).toEqual([]);
216
- vi.stubEnv("PULUMI_BACKEND_URL", "s3://bucket/state");
217
- readWith([], { dir: stockDir, engine: "pulumi" });
218
- expect(pul015.check(ctx)).toEqual([]);
219
- vi.unstubAllEnvs();
220
-
221
- // plywood.yml, engine and backend
222
- const root = mkdtempSync(join(tmpdir(), "pul015-"));
223
- mkdirSync(join(root, ".git"));
224
- const member = join(root, "infra");
225
- mkdirSync(member);
226
- writeFileSync(join(member, "Pulumi.yaml"), "name: app\nruntime: nodejs\n");
227
- writeFileSync(join(root, "plywood.yml"), "engine: plunge\n");
228
- readWith([], { dir: member, engine: "pulumi" });
229
- const fromEngine = pul015.check(ctx);
230
- expect(fromEngine).toHaveLength(1);
231
- expect(fromEngine[0].message).toContain("plywood.yml says engine: plunge");
232
- writeFileSync(join(root, "plywood.yml"), "backend: plunge+file:///state\n");
233
- const fromBackend = pul015.check(ctx);
234
- expect(fromBackend).toHaveLength(1);
235
- expect(fromBackend[0].message).toContain("plywood.yml names the plunge backend plunge+file:///state");
236
- writeFileSync(join(root, "plywood.yml"), "engine: pulumi\n");
237
- expect(pul015.check(ctx)).toEqual([]);
238
- });
239
-
240
- test("PUL015 does not report the other direction: engine plunge on a stock backend", () => {
241
- vi.stubEnv("PULUMI_BACKEND_URL", "s3://bucket/state");
242
- readWith([], { dir: stockDir, engine: "plunge" });
243
- expect(pul015.check(ctx)).toEqual([]);
244
- });
245
- });
@@ -1,38 +0,0 @@
1
- /**
2
- * PUL001: a pulumi member was read with no graph.
3
- *
4
- * The member's graph is the `pulumi stack export` checked in beside
5
- * `Pulumi.yaml` as `stack-export.json` (`../../workspace-member.ts`). The
6
- * graph read never runs the program or `pulumi`, so a member with no export,
7
- * or one that is not JSON, has no nodes at all. The build still succeeds, the
8
- * change set and drift still run, and the graph silently shows an empty
9
- * member: nothing links to its resources and no drift record lands on a node.
10
- * This check says so at build time, with the reason the read recorded.
11
- *
12
- * It reads the report the plugin's `buildRoots` left for `graphMeta`
13
- * (`lastMemberReport`), so it fires only in a build that read a member: a
14
- * project that names the lexicon without a `pulumi.member` gets nothing.
15
- */
16
- import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
17
- import { lastMemberReport, PULUMI_EXPORT_FILE } from "../../workspace-member";
18
-
19
- export const pul001: PostSynthCheck = {
20
- id: "PUL001",
21
- description: "A pulumi member with no readable stack-export.json has no nodes in the graph",
22
-
23
- check(_ctx: PostSynthContext): PostSynthDiagnostic[] {
24
- const report = lastMemberReport();
25
- if (!report || report.exported) return [];
26
- return [
27
- {
28
- checkId: "PUL001",
29
- severity: "warning",
30
- message:
31
- `the pulumi member was read with no nodes: ${report.reason ?? `no readable ${PULUMI_EXPORT_FILE}`}. ` +
32
- `Its change set and drift still run, but nothing in the graph can link to its resources.`,
33
- lexicon: "pulumi",
34
- missing: { kind: PULUMI_EXPORT_FILE, scope: "pulumi member" },
35
- },
36
- ];
37
- },
38
- };
@@ -1,38 +0,0 @@
1
- /**
2
- * PUL002: the member's stack export records pending operations.
3
- *
4
- * Pulumi writes a `deployment.pending_operations` entry for each step an
5
- * update started and did not finish (a killed `pulumi up`, a lost runner).
6
- * Until someone resolves them (`pulumi refresh`, or `pulumi stack export`,
7
- * edit, `pulumi stack import`), the stack may hold a resource its state does
8
- * not list, and `pulumi preview` and `pulumi refresh` warn about them on
9
- * every run. chant reads the checked-in export for the graph, so an export
10
- * taken in that state puts the same gap in the graph: the half-created
11
- * resources have no node.
12
- *
13
- * A warning, not an error: the export is still read, and the fix is the
14
- * stack owner's, outside chant.
15
- */
16
- import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
17
- import { lastMemberReport, PULUMI_EXPORT_FILE } from "../../workspace-member";
18
-
19
- export const pul002: PostSynthCheck = {
20
- id: "PUL002",
21
- description: "The pulumi member's stack export records operations an interrupted update left pending",
22
-
23
- check(_ctx: PostSynthContext): PostSynthDiagnostic[] {
24
- const pending = lastMemberReport()?.pendingOperations ?? 0;
25
- if (pending === 0) return [];
26
- return [
27
- {
28
- checkId: "PUL002",
29
- severity: "warning",
30
- message:
31
- `${PULUMI_EXPORT_FILE} records ${pending} pending operation(s): an update was interrupted and the stack may hold ` +
32
- `resources its state does not list, so the graph is missing them too. Resolve them with \`pulumi refresh\` ` +
33
- `(or export, edit and \`pulumi stack import\`), then export the stack again.`,
34
- lexicon: "pulumi",
35
- },
36
- ];
37
- },
38
- };