@highstate/backend 0.9.15 → 0.9.18

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 (187) hide show
  1. package/dist/chunk-NAAIDR4U.js +8499 -0
  2. package/dist/chunk-NAAIDR4U.js.map +1 -0
  3. package/dist/chunk-OU5OQBLB.js +74 -0
  4. package/dist/chunk-OU5OQBLB.js.map +1 -0
  5. package/dist/chunk-Y7DXREVO.js +1745 -0
  6. package/dist/chunk-Y7DXREVO.js.map +1 -0
  7. package/dist/highstate.manifest.json +4 -4
  8. package/dist/index.js +7227 -2501
  9. package/dist/index.js.map +1 -1
  10. package/dist/library/package-resolution-worker.js +7 -5
  11. package/dist/library/package-resolution-worker.js.map +1 -1
  12. package/dist/library/worker/main.js +76 -185
  13. package/dist/library/worker/main.js.map +1 -1
  14. package/dist/magic-string.es-5ABAC4JN.js +1292 -0
  15. package/dist/magic-string.es-5ABAC4JN.js.map +1 -0
  16. package/dist/shared/index.js +3 -98
  17. package/dist/shared/index.js.map +1 -1
  18. package/package.json +31 -10
  19. package/src/artifact/abstractions.ts +46 -0
  20. package/src/artifact/encryption.ts +109 -0
  21. package/src/artifact/factory.ts +36 -0
  22. package/src/artifact/index.ts +3 -0
  23. package/src/artifact/local.ts +138 -0
  24. package/src/business/__traces__/secret/update-instance-secrets/create-and-delete-secrets-simultaneously.md +356 -0
  25. package/src/business/__traces__/secret/update-instance-secrets/create-new-secrets-for-instance.md +274 -0
  26. package/src/business/__traces__/secret/update-instance-secrets/delete-existing-secrets.md +223 -0
  27. package/src/business/__traces__/secret/update-instance-secrets/no-op-when-no-changes.md +147 -0
  28. package/src/business/__traces__/secret/update-instance-secrets/update-existing-secrets.md +280 -0
  29. package/src/business/__traces__/worker/update-unit-registrations/add-new-unit-registration-when-other-exists.md +360 -0
  30. package/src/business/__traces__/worker/update-unit-registrations/add-new-unit-registration.md +215 -0
  31. package/src/business/__traces__/worker/update-unit-registrations/create-multiple-workers-with-different-identities.md +427 -0
  32. package/src/business/__traces__/worker/update-unit-registrations/handle-nonexistent-registration-id-gracefully.md +217 -0
  33. package/src/business/__traces__/worker/update-unit-registrations/no-op-when-no-changes.md +132 -0
  34. package/src/business/__traces__/worker/update-unit-registrations/recreate-worker-when-image-changes.md +454 -0
  35. package/src/business/__traces__/worker/update-unit-registrations/recreate-worker-when-image-version-changes.md +426 -0
  36. package/src/business/__traces__/worker/update-unit-registrations/recreate-worker-with-same-identity-reuses-service-account.md +372 -0
  37. package/src/business/__traces__/worker/update-unit-registrations/remove-one-of-multiple-unit-registrations.md +383 -0
  38. package/src/business/__traces__/worker/update-unit-registrations/remove-unit-registration.md +245 -0
  39. package/src/business/__traces__/worker/update-unit-registrations/update-existing-unit-registration-when-params-change.md +174 -0
  40. package/src/business/__traces__/worker/update-unit-registrations/update-params-and-image-simultaneously.md +432 -0
  41. package/src/business/__traces__/worker/update-unit-registrations/worker-with-multiple-registrations-not-deleted-when-one-removed.md +220 -0
  42. package/src/business/api-key.ts +65 -0
  43. package/src/business/artifact.ts +289 -0
  44. package/src/business/backend-unlock.ts +10 -0
  45. package/src/business/index.ts +10 -0
  46. package/src/business/instance-lock.ts +125 -0
  47. package/src/business/instance-state.ts +434 -0
  48. package/src/business/operation.ts +251 -0
  49. package/src/business/project-unlock.ts +260 -0
  50. package/src/business/project.ts +299 -0
  51. package/src/business/secret.test.ts +178 -0
  52. package/src/business/secret.ts +281 -0
  53. package/src/business/worker.test.ts +614 -0
  54. package/src/business/worker.ts +398 -0
  55. package/src/common/clock.ts +18 -0
  56. package/src/common/index.ts +5 -1
  57. package/src/common/performance.ts +44 -0
  58. package/src/common/random.ts +68 -0
  59. package/src/common/test/index.ts +2 -0
  60. package/src/common/test/render.ts +98 -0
  61. package/src/common/test/tracer.ts +359 -0
  62. package/src/common/tree.ts +33 -0
  63. package/src/common/utils.ts +40 -1
  64. package/src/config.ts +19 -11
  65. package/src/hotstate/abstractions.ts +48 -0
  66. package/src/hotstate/factory.ts +17 -0
  67. package/src/{secret → hotstate}/index.ts +1 -0
  68. package/src/hotstate/manager.ts +192 -0
  69. package/src/hotstate/memory.ts +100 -0
  70. package/src/hotstate/validation.ts +100 -0
  71. package/src/index.ts +2 -1
  72. package/src/library/abstractions.ts +24 -28
  73. package/src/library/factory.ts +2 -2
  74. package/src/library/local.ts +91 -111
  75. package/src/library/worker/evaluator.ts +36 -73
  76. package/src/library/worker/loader.lite.ts +54 -0
  77. package/src/library/worker/main.ts +15 -66
  78. package/src/library/worker/protocol.ts +6 -33
  79. package/src/lock/abstractions.ts +6 -0
  80. package/src/lock/factory.ts +15 -0
  81. package/src/lock/index.ts +4 -0
  82. package/src/lock/manager.ts +97 -0
  83. package/src/lock/memory.ts +19 -0
  84. package/src/lock/test.ts +108 -0
  85. package/src/orchestrator/manager.ts +118 -90
  86. package/src/orchestrator/operation-workset.ts +181 -93
  87. package/src/orchestrator/operation.ts +1021 -283
  88. package/src/project/abstractions.ts +27 -38
  89. package/src/project/evaluation.ts +248 -0
  90. package/src/project/factory.ts +1 -1
  91. package/src/project/index.ts +1 -2
  92. package/src/project/local.ts +107 -103
  93. package/src/pubsub/abstractions.ts +13 -0
  94. package/src/pubsub/factory.ts +19 -0
  95. package/src/{workspace → pubsub}/index.ts +1 -0
  96. package/src/pubsub/local.ts +36 -0
  97. package/src/pubsub/manager.ts +108 -0
  98. package/src/pubsub/validation.ts +33 -0
  99. package/src/runner/abstractions.ts +155 -68
  100. package/src/runner/artifact-env.ts +160 -0
  101. package/src/runner/factory.ts +20 -5
  102. package/src/runner/force-abort.ts +117 -0
  103. package/src/runner/local.ts +292 -372
  104. package/src/{common → runner}/pulumi.ts +89 -37
  105. package/src/services.ts +251 -40
  106. package/src/shared/index.ts +3 -11
  107. package/src/shared/models/backend/index.ts +3 -0
  108. package/src/shared/{library.ts → models/backend/library.ts} +4 -4
  109. package/src/shared/models/backend/project.ts +82 -0
  110. package/src/shared/models/backend/unlock-method.ts +20 -0
  111. package/src/shared/models/base.ts +68 -0
  112. package/src/shared/models/errors.ts +5 -0
  113. package/src/shared/models/index.ts +4 -0
  114. package/src/shared/models/project/api-key.ts +65 -0
  115. package/src/shared/models/project/artifact.ts +83 -0
  116. package/src/shared/models/project/index.ts +13 -0
  117. package/src/shared/models/project/lock.ts +91 -0
  118. package/src/shared/models/project/model.ts +14 -0
  119. package/src/shared/{operation.ts → models/project/operation.ts} +29 -8
  120. package/src/shared/models/project/page.ts +57 -0
  121. package/src/shared/models/project/secret.ts +98 -0
  122. package/src/shared/models/project/service-account.ts +22 -0
  123. package/src/shared/models/project/state.ts +449 -0
  124. package/src/shared/models/project/terminal.ts +98 -0
  125. package/src/shared/models/project/trigger.ts +56 -0
  126. package/src/shared/models/project/unlock-method.ts +38 -0
  127. package/src/shared/models/project/worker.ts +107 -0
  128. package/src/shared/resolvers/graph-resolver.ts +61 -18
  129. package/src/shared/resolvers/index.ts +5 -0
  130. package/src/shared/resolvers/input-hash.ts +53 -15
  131. package/src/shared/resolvers/input.ts +47 -13
  132. package/src/shared/resolvers/registry.ts +3 -2
  133. package/src/shared/resolvers/state.ts +2 -2
  134. package/src/shared/resolvers/validation.ts +82 -25
  135. package/src/shared/utils/args.ts +25 -0
  136. package/src/shared/{async-batcher.ts → utils/async-batcher.ts} +13 -1
  137. package/src/shared/utils/hash.ts +6 -0
  138. package/src/shared/utils/index.ts +4 -0
  139. package/src/shared/utils/promise-tracker.ts +23 -0
  140. package/src/state/abstractions.ts +199 -131
  141. package/src/state/encryption.ts +98 -0
  142. package/src/state/factory.ts +3 -5
  143. package/src/state/index.ts +4 -0
  144. package/src/state/keyring.ts +22 -0
  145. package/src/state/local/backend.ts +106 -0
  146. package/src/state/local/collection.ts +361 -0
  147. package/src/state/local/index.ts +2 -0
  148. package/src/state/manager.ts +875 -18
  149. package/src/state/memory/backend.ts +70 -0
  150. package/src/state/memory/collection.ts +270 -0
  151. package/src/state/memory/index.ts +2 -0
  152. package/src/state/repository/index.ts +2 -0
  153. package/src/state/repository/repository.index.ts +193 -0
  154. package/src/state/repository/repository.ts +507 -0
  155. package/src/state/test.ts +457 -0
  156. package/src/terminal/{shared.ts → abstractions.ts} +3 -3
  157. package/src/terminal/docker.ts +18 -14
  158. package/src/terminal/factory.ts +3 -3
  159. package/src/terminal/index.ts +1 -1
  160. package/src/terminal/manager.ts +131 -79
  161. package/src/terminal/run.sh.ts +21 -11
  162. package/src/unlock/abstractions.ts +49 -0
  163. package/src/unlock/index.ts +2 -0
  164. package/src/unlock/memory.ts +32 -0
  165. package/src/worker/abstractions.ts +42 -0
  166. package/src/worker/docker.ts +83 -0
  167. package/src/worker/factory.ts +20 -0
  168. package/src/worker/index.ts +3 -0
  169. package/src/worker/manager.ts +167 -0
  170. package/dist/chunk-KTGKNSKM.js +0 -979
  171. package/dist/chunk-KTGKNSKM.js.map +0 -1
  172. package/dist/chunk-WXDYCRTT.js +0 -234
  173. package/dist/chunk-WXDYCRTT.js.map +0 -1
  174. package/src/library/worker/loader.ts +0 -114
  175. package/src/preferences/shared.ts +0 -1
  176. package/src/project/lock.ts +0 -39
  177. package/src/project/manager.ts +0 -433
  178. package/src/secret/abstractions.ts +0 -59
  179. package/src/secret/factory.ts +0 -22
  180. package/src/secret/local.ts +0 -152
  181. package/src/shared/project.ts +0 -62
  182. package/src/shared/state.ts +0 -247
  183. package/src/shared/terminal.ts +0 -14
  184. package/src/state/local.ts +0 -612
  185. package/src/workspace/abstractions.ts +0 -41
  186. package/src/workspace/factory.ts +0 -14
  187. package/src/workspace/local.ts +0 -54
@@ -0,0 +1,383 @@
1
+ ## arrange
2
+
3
+ ### <a id="trace-1"></a> 1. 💾 putItem
4
+
5
+ **Collection:** `workers:test`
6
+
7
+ **Key:** `"00000000-0011-7000-8000-413b6b443f41"`
8
+
9
+ **Value:**
10
+
11
+ ```js
12
+ {
13
+ "id": "00000000-0011-7000-8000-413b6b443f41",
14
+ "meta": {},
15
+ "image": "ghcr.io/org/worker:v1",
16
+ "apiKeyId": "00000000-0023-7000-8000-8b4d7d565153",
17
+ "failedStartAttempts": 5,
18
+ "status": "starting",
19
+ "identity": "ghcr.io/org/worker",
20
+ "serviceAccountId": "00000000-0035-7000-8000-d15f8f686365"
21
+ }
22
+ ```
23
+
24
+ ### <a id="trace-2"></a> 2. 💾 putItem
25
+
26
+ **Collection:** `workers:test`
27
+
28
+ **Key:** `"00000000-0047-7000-8001-1b71a17a7577"`
29
+
30
+ **Value:**
31
+
32
+ ```js
33
+ {
34
+ "id": "00000000-0047-7000-8001-1b71a17a7577",
35
+ "meta": {},
36
+ "image": "ghcr.io/org/otherworker:v1",
37
+ "apiKeyId": "00000000-0059-7000-8001-6183b38c8789",
38
+ "failedStartAttempts": 5,
39
+ "status": "starting",
40
+ "identity": "ghcr.io/org/otherworker",
41
+ "serviceAccountId": "00000000-006b-7000-8001-ab95c59e999b"
42
+ }
43
+ ```
44
+
45
+ ### <a id="trace-3"></a> 3. 💾 putItem
46
+
47
+ **Collection:** `worker-registrations:test`
48
+
49
+ **Key:** `"00000000-007d-7000-8001-f1a7d7b0abad"`
50
+
51
+ **Value:**
52
+
53
+ ```js
54
+ {
55
+ "id": "00000000-007d-7000-8001-f1a7d7b0abad",
56
+ "meta": {},
57
+ "workerId": "00000000-0011-7000-8000-413b6b443f41",
58
+ "image": "ghcr.io/org/worker:v1",
59
+ "instanceId": "test",
60
+ "params": {}
61
+ }
62
+ ```
63
+
64
+ ### <a id="trace-4"></a> 4. 💾 putItem
65
+
66
+ **Collection:** `worker-registrations:test`
67
+
68
+ **Key:** `"00000000-008f-7000-8002-3bb9e9c2bdbf"`
69
+
70
+ **Value:**
71
+
72
+ ```js
73
+ {
74
+ "id": "00000000-008f-7000-8002-3bb9e9c2bdbf",
75
+ "meta": {},
76
+ "workerId": "00000000-0047-7000-8001-1b71a17a7577",
77
+ "image": "ghcr.io/org/otherworker:v1",
78
+ "instanceId": "test",
79
+ "params": {}
80
+ }
81
+ ```
82
+
83
+ ## act
84
+
85
+ ### <a id="trace-5"></a> 5. 🔒 locked, released at [28](#trace-28)
86
+
87
+ **Keys:**
88
+
89
+ `"worker-image:test:ghcr.io/org/worker:v1"`
90
+
91
+ ### <a id="trace-6"></a> 6. 📖 getManyRecord
92
+
93
+ **Collection:** `worker-registrations:test`
94
+
95
+ **Keys:**
96
+
97
+ `"00000000-007d-7000-8001-f1a7d7b0abad"`
98
+
99
+ `"00000000-008f-7000-8002-3bb9e9c2bdbf"`
100
+
101
+ **Result:**
102
+
103
+ ```js
104
+ {
105
+ "00000000-007d-7000-8001-f1a7d7b0abad": {
106
+ "id": "00000000-007d-7000-8001-f1a7d7b0abad",
107
+ "meta": {
108
+ "createdAt": 0,
109
+ "updatedAt": 0
110
+ },
111
+ "workerId": "00000000-0011-7000-8000-413b6b443f41",
112
+ "instanceId": "test",
113
+ "image": "ghcr.io/org/worker:v1",
114
+ "params": {}
115
+ },
116
+ "00000000-008f-7000-8002-3bb9e9c2bdbf": {
117
+ "id": "00000000-008f-7000-8002-3bb9e9c2bdbf",
118
+ "meta": {
119
+ "createdAt": 0,
120
+ "updatedAt": 0
121
+ },
122
+ "workerId": "00000000-0047-7000-8001-1b71a17a7577",
123
+ "instanceId": "test",
124
+ "image": "ghcr.io/org/otherworker:v1",
125
+ "params": {}
126
+ }
127
+ }
128
+ ```
129
+
130
+ ### <a id="trace-7"></a> 7. 🔒 locked, released at [10](#trace-10)
131
+
132
+ **Keys:**
133
+
134
+ `"worker-image:test:ghcr.io/org/worker"`
135
+
136
+ ### <a id="trace-8"></a> 8. 📖 getAllItems
137
+
138
+ **Collection:** `workers:test`
139
+
140
+ **Result:**
141
+
142
+ ```js
143
+ {
144
+ "id": "00000000-0011-7000-8000-413b6b443f41",
145
+ "meta": {
146
+ "createdAt": 0,
147
+ "updatedAt": 0
148
+ },
149
+ "status": "starting",
150
+ "failedStartAttempts": 5,
151
+ "identity": "ghcr.io/org/worker",
152
+ "image": "ghcr.io/org/worker:v1",
153
+ "serviceAccountId": "00000000-0035-7000-8000-d15f8f686365",
154
+ "apiKeyId": "00000000-0023-7000-8000-8b4d7d565153"
155
+ }
156
+ ```
157
+
158
+ ```js
159
+ {
160
+ "id": "00000000-0047-7000-8001-1b71a17a7577",
161
+ "meta": {
162
+ "createdAt": 0,
163
+ "updatedAt": 0
164
+ },
165
+ "status": "starting",
166
+ "failedStartAttempts": 5,
167
+ "identity": "ghcr.io/org/otherworker",
168
+ "image": "ghcr.io/org/otherworker:v1",
169
+ "serviceAccountId": "00000000-006b-7000-8001-ab95c59e999b",
170
+ "apiKeyId": "00000000-0059-7000-8001-6183b38c8789"
171
+ }
172
+ ```
173
+
174
+ ### <a id="trace-9"></a> 9. 🔍 debug
175
+
176
+ `worker with image "ghcr.io/org/worker:v1" already exists, reusing it`
177
+
178
+ **Data:**
179
+
180
+ ```js
181
+ {
182
+ "service": "WorkerService",
183
+ "projectId": "test",
184
+ "workerId": "00000000-0011-7000-8000-413b6b443f41",
185
+ "image": "ghcr.io/org/worker:v1"
186
+ }
187
+ ```
188
+
189
+ ### <a id="trace-10"></a> 10. 🔓 released, locked at [7](#trace-7)
190
+
191
+ **Keys:**
192
+
193
+ `"worker-image:test:ghcr.io/org/worker"`
194
+
195
+ ### <a id="trace-11"></a> 11. â„šī¸ info
196
+
197
+ `deleting worker registration "00000000-008f-7000-8002-3bb9e9c2bdbf" for unit worker "worker2" in project "test" (unit worker no longer present)`
198
+
199
+ **Data:**
200
+
201
+ ```js
202
+ {
203
+ "service": "WorkerService",
204
+ "projectId": "test",
205
+ "registrationId": "00000000-008f-7000-8002-3bb9e9c2bdbf",
206
+ "unitWorkerName": "worker2",
207
+ "workerId": "00000000-0047-7000-8001-1b71a17a7577"
208
+ }
209
+ ```
210
+
211
+ ### <a id="trace-12"></a> 12. đŸ—‘ī¸ delete
212
+
213
+ **Collection:** `worker-registrations:test`
214
+
215
+ **Batch ID:** `1`, written at [27](#trace-27)
216
+
217
+ **Key:** `"00000000-008f-7000-8002-3bb9e9c2bdbf"`
218
+
219
+ ### <a id="trace-13"></a> 13. đŸ—‘ī¸ delete
220
+
221
+ **Collection:** `worker-registration-index:test:00000000-0047-7000-8001-1b71a17a7577`
222
+
223
+ **Key:** `"00000000-008f-7000-8002-3bb9e9c2bdbf"`
224
+
225
+ ### <a id="trace-14"></a> 14. 🔒 locked, released at [26](#trace-26)
226
+
227
+ **Keys:**
228
+
229
+ `"worker:00000000-0047-7000-8001-1b71a17a7577"`
230
+
231
+ ### <a id="trace-15"></a> 15. 📸 snapshot, used by [16](#trace-16)
232
+
233
+ ### <a id="trace-16"></a> 16. 📖 getAll
234
+
235
+ **Collection:** `worker-registration-index:test:00000000-0047-7000-8001-1b71a17a7577`
236
+
237
+ **Result:** `[]`
238
+
239
+ **Snapshot ID:** `1`, captured at [15](#trace-15)
240
+
241
+ ### <a id="trace-17"></a> 17. 📖 get
242
+
243
+ **Collection:** `workers:test`
244
+
245
+ **Keys:**
246
+
247
+ `"00000000-0047-7000-8001-1b71a17a7577"`
248
+
249
+ **Result:**
250
+
251
+ ```js
252
+ {
253
+ "id": "00000000-0047-7000-8001-1b71a17a7577",
254
+ "meta": {
255
+ "createdAt": 0,
256
+ "updatedAt": 0
257
+ },
258
+ "status": "starting",
259
+ "failedStartAttempts": 5,
260
+ "identity": "ghcr.io/org/otherworker",
261
+ "image": "ghcr.io/org/otherworker:v1",
262
+ "serviceAccountId": "00000000-006b-7000-8001-ab95c59e999b",
263
+ "apiKeyId": "00000000-0059-7000-8001-6183b38c8789"
264
+ }
265
+ ```
266
+
267
+ ### <a id="trace-18"></a> 18. â„šī¸ info
268
+
269
+ `deleting worker "00000000-0047-7000-8001-1b71a17a7577" with image "ghcr.io/org/otherworker:v1" in project "test" (no registrations remaining)`
270
+
271
+ **Data:**
272
+
273
+ ```js
274
+ {
275
+ "service": "WorkerService",
276
+ "projectId": "test",
277
+ "workerId": "00000000-0047-7000-8001-1b71a17a7577",
278
+ "image": "ghcr.io/org/otherworker:v1",
279
+ "identity": "ghcr.io/org/otherworker"
280
+ }
281
+ ```
282
+
283
+ ### <a id="trace-19"></a> 19. đŸ—‘ī¸ delete
284
+
285
+ **Collection:** `workers:test`
286
+
287
+ **Batch ID:** `2`, written at [24](#trace-24)
288
+
289
+ **Key:** `"00000000-0047-7000-8001-1b71a17a7577"`
290
+
291
+ ### <a id="trace-20"></a> 20. đŸ—‘ī¸ delete
292
+
293
+ **Collection:** `api-keys:test`
294
+
295
+ **Batch ID:** `2`, written at [24](#trace-24)
296
+
297
+ **Key:** `"00000000-0059-7000-8001-6183b38c8789"`
298
+
299
+ ### <a id="trace-21"></a> 21. 📖 getAllItems
300
+
301
+ **Collection:** `workers:test`
302
+
303
+ **Result:**
304
+
305
+ ```js
306
+ {
307
+ "id": "00000000-0011-7000-8000-413b6b443f41",
308
+ "meta": {
309
+ "createdAt": 0,
310
+ "updatedAt": 0
311
+ },
312
+ "status": "starting",
313
+ "failedStartAttempts": 5,
314
+ "identity": "ghcr.io/org/worker",
315
+ "image": "ghcr.io/org/worker:v1",
316
+ "serviceAccountId": "00000000-0035-7000-8000-d15f8f686365",
317
+ "apiKeyId": "00000000-0023-7000-8000-8b4d7d565153"
318
+ }
319
+ ```
320
+
321
+ ```js
322
+ {
323
+ "id": "00000000-0047-7000-8001-1b71a17a7577",
324
+ "meta": {
325
+ "createdAt": 0,
326
+ "updatedAt": 0
327
+ },
328
+ "status": "starting",
329
+ "failedStartAttempts": 5,
330
+ "identity": "ghcr.io/org/otherworker",
331
+ "image": "ghcr.io/org/otherworker:v1",
332
+ "serviceAccountId": "00000000-006b-7000-8001-ab95c59e999b",
333
+ "apiKeyId": "00000000-0059-7000-8001-6183b38c8789"
334
+ }
335
+ ```
336
+
337
+ ### <a id="trace-22"></a> 22. â„šī¸ info
338
+
339
+ `deleting service account "00000000-006b-7000-8001-ab95c59e999b" for worker "00000000-0047-7000-8001-1b71a17a7577" in project "test" (no sibling workers remaining)`
340
+
341
+ **Data:**
342
+
343
+ ```js
344
+ {
345
+ "service": "WorkerService",
346
+ "projectId": "test",
347
+ "workerId": "00000000-0047-7000-8001-1b71a17a7577",
348
+ "serviceAccountId": "00000000-006b-7000-8001-ab95c59e999b",
349
+ "identity": "ghcr.io/org/otherworker"
350
+ }
351
+ ```
352
+
353
+ ### <a id="trace-23"></a> 23. đŸ—‘ī¸ delete
354
+
355
+ **Collection:** `service-accounts:test`
356
+
357
+ **Batch ID:** `2`, written at [24](#trace-24)
358
+
359
+ **Key:** `"00000000-006b-7000-8001-ab95c59e999b"`
360
+
361
+ ### <a id="trace-24"></a> 24. 💾 write [19](#trace-19), [20](#trace-20), [23](#trace-23)
362
+
363
+ ### <a id="trace-25"></a> 25. ✅ workerManager.stopWorker
364
+
365
+ **Args:**
366
+
367
+ `"test"`
368
+
369
+ `"00000000-0047-7000-8001-1b71a17a7577"`
370
+
371
+ ### <a id="trace-26"></a> 26. 🔓 released, locked at [14](#trace-14)
372
+
373
+ **Keys:**
374
+
375
+ `"worker:00000000-0047-7000-8001-1b71a17a7577"`
376
+
377
+ ### <a id="trace-27"></a> 27. 💾 write [12](#trace-12)
378
+
379
+ ### <a id="trace-28"></a> 28. 🔓 released, locked at [5](#trace-5)
380
+
381
+ **Keys:**
382
+
383
+ `"worker-image:test:ghcr.io/org/worker:v1"`
@@ -0,0 +1,245 @@
1
+ ## arrange
2
+
3
+ ### <a id="trace-1"></a> 1. 💾 putItem
4
+
5
+ **Collection:** `workers:test`
6
+
7
+ **Key:** `"00000000-0011-7000-8000-413b6b433f41"`
8
+
9
+ **Value:**
10
+
11
+ ```js
12
+ {
13
+ "id": "00000000-0011-7000-8000-413b6b433f41",
14
+ "meta": {},
15
+ "image": "ghcr.io/org/worker:v1",
16
+ "apiKeyId": "00000000-0023-7000-8000-8b4d7d555153",
17
+ "failedStartAttempts": 5,
18
+ "status": "starting",
19
+ "identity": "ghcr.io/org/worker",
20
+ "serviceAccountId": "00000000-0035-7000-8000-d15f8f676365"
21
+ }
22
+ ```
23
+
24
+ ### <a id="trace-2"></a> 2. 💾 putItem
25
+
26
+ **Collection:** `worker-registrations:test`
27
+
28
+ **Key:** `"00000000-0047-7000-8001-1b71a1797577"`
29
+
30
+ **Value:**
31
+
32
+ ```js
33
+ {
34
+ "id": "00000000-0047-7000-8001-1b71a1797577",
35
+ "meta": {},
36
+ "workerId": "00000000-0011-7000-8000-413b6b433f41",
37
+ "image": "ghcr.io/org/worker:v1",
38
+ "instanceId": "test",
39
+ "params": {}
40
+ }
41
+ ```
42
+
43
+ ## act
44
+
45
+ ### <a id="trace-3"></a> 3. 🔒 locked, released at [22](#trace-22)
46
+
47
+ **Keys:** `[]`
48
+
49
+ ### <a id="trace-4"></a> 4. 📖 getManyRecord
50
+
51
+ **Collection:** `worker-registrations:test`
52
+
53
+ **Keys:**
54
+
55
+ `"00000000-0047-7000-8001-1b71a1797577"`
56
+
57
+ **Result:**
58
+
59
+ ```js
60
+ {
61
+ "00000000-0047-7000-8001-1b71a1797577": {
62
+ "id": "00000000-0047-7000-8001-1b71a1797577",
63
+ "meta": {
64
+ "createdAt": 0,
65
+ "updatedAt": 0
66
+ },
67
+ "workerId": "00000000-0011-7000-8000-413b6b433f41",
68
+ "instanceId": "test",
69
+ "image": "ghcr.io/org/worker:v1",
70
+ "params": {}
71
+ }
72
+ }
73
+ ```
74
+
75
+ ### <a id="trace-5"></a> 5. â„šī¸ info
76
+
77
+ `deleting worker registration "00000000-0047-7000-8001-1b71a1797577" for unit worker "worker" in project "test" (unit worker no longer present)`
78
+
79
+ **Data:**
80
+
81
+ ```js
82
+ {
83
+ "service": "WorkerService",
84
+ "projectId": "test",
85
+ "registrationId": "00000000-0047-7000-8001-1b71a1797577",
86
+ "unitWorkerName": "worker",
87
+ "workerId": "00000000-0011-7000-8000-413b6b433f41"
88
+ }
89
+ ```
90
+
91
+ ### <a id="trace-6"></a> 6. đŸ—‘ī¸ delete
92
+
93
+ **Collection:** `worker-registrations:test`
94
+
95
+ **Batch ID:** `1`, written at [21](#trace-21)
96
+
97
+ **Key:** `"00000000-0047-7000-8001-1b71a1797577"`
98
+
99
+ ### <a id="trace-7"></a> 7. đŸ—‘ī¸ delete
100
+
101
+ **Collection:** `worker-registration-index:test:00000000-0011-7000-8000-413b6b433f41`
102
+
103
+ **Key:** `"00000000-0047-7000-8001-1b71a1797577"`
104
+
105
+ ### <a id="trace-8"></a> 8. 🔒 locked, released at [20](#trace-20)
106
+
107
+ **Keys:**
108
+
109
+ `"worker:00000000-0011-7000-8000-413b6b433f41"`
110
+
111
+ ### <a id="trace-9"></a> 9. 📸 snapshot, used by [10](#trace-10)
112
+
113
+ ### <a id="trace-10"></a> 10. 📖 getAll
114
+
115
+ **Collection:** `worker-registration-index:test:00000000-0011-7000-8000-413b6b433f41`
116
+
117
+ **Result:** `[]`
118
+
119
+ **Snapshot ID:** `1`, captured at [9](#trace-9)
120
+
121
+ ### <a id="trace-11"></a> 11. 📖 get
122
+
123
+ **Collection:** `workers:test`
124
+
125
+ **Keys:**
126
+
127
+ `"00000000-0011-7000-8000-413b6b433f41"`
128
+
129
+ **Result:**
130
+
131
+ ```js
132
+ {
133
+ "id": "00000000-0011-7000-8000-413b6b433f41",
134
+ "meta": {
135
+ "createdAt": 0,
136
+ "updatedAt": 0
137
+ },
138
+ "status": "starting",
139
+ "failedStartAttempts": 5,
140
+ "identity": "ghcr.io/org/worker",
141
+ "image": "ghcr.io/org/worker:v1",
142
+ "serviceAccountId": "00000000-0035-7000-8000-d15f8f676365",
143
+ "apiKeyId": "00000000-0023-7000-8000-8b4d7d555153"
144
+ }
145
+ ```
146
+
147
+ ### <a id="trace-12"></a> 12. â„šī¸ info
148
+
149
+ `deleting worker "00000000-0011-7000-8000-413b6b433f41" with image "ghcr.io/org/worker:v1" in project "test" (no registrations remaining)`
150
+
151
+ **Data:**
152
+
153
+ ```js
154
+ {
155
+ "service": "WorkerService",
156
+ "projectId": "test",
157
+ "workerId": "00000000-0011-7000-8000-413b6b433f41",
158
+ "image": "ghcr.io/org/worker:v1",
159
+ "identity": "ghcr.io/org/worker"
160
+ }
161
+ ```
162
+
163
+ ### <a id="trace-13"></a> 13. đŸ—‘ī¸ delete
164
+
165
+ **Collection:** `workers:test`
166
+
167
+ **Batch ID:** `2`, written at [18](#trace-18)
168
+
169
+ **Key:** `"00000000-0011-7000-8000-413b6b433f41"`
170
+
171
+ ### <a id="trace-14"></a> 14. đŸ—‘ī¸ delete
172
+
173
+ **Collection:** `api-keys:test`
174
+
175
+ **Batch ID:** `2`, written at [18](#trace-18)
176
+
177
+ **Key:** `"00000000-0023-7000-8000-8b4d7d555153"`
178
+
179
+ ### <a id="trace-15"></a> 15. 📖 getAllItems
180
+
181
+ **Collection:** `workers:test`
182
+
183
+ **Result:**
184
+
185
+ ```js
186
+ {
187
+ "id": "00000000-0011-7000-8000-413b6b433f41",
188
+ "meta": {
189
+ "createdAt": 0,
190
+ "updatedAt": 0
191
+ },
192
+ "status": "starting",
193
+ "failedStartAttempts": 5,
194
+ "identity": "ghcr.io/org/worker",
195
+ "image": "ghcr.io/org/worker:v1",
196
+ "serviceAccountId": "00000000-0035-7000-8000-d15f8f676365",
197
+ "apiKeyId": "00000000-0023-7000-8000-8b4d7d555153"
198
+ }
199
+ ```
200
+
201
+ ### <a id="trace-16"></a> 16. â„šī¸ info
202
+
203
+ `deleting service account "00000000-0035-7000-8000-d15f8f676365" for worker "00000000-0011-7000-8000-413b6b433f41" in project "test" (no sibling workers remaining)`
204
+
205
+ **Data:**
206
+
207
+ ```js
208
+ {
209
+ "service": "WorkerService",
210
+ "projectId": "test",
211
+ "workerId": "00000000-0011-7000-8000-413b6b433f41",
212
+ "serviceAccountId": "00000000-0035-7000-8000-d15f8f676365",
213
+ "identity": "ghcr.io/org/worker"
214
+ }
215
+ ```
216
+
217
+ ### <a id="trace-17"></a> 17. đŸ—‘ī¸ delete
218
+
219
+ **Collection:** `service-accounts:test`
220
+
221
+ **Batch ID:** `2`, written at [18](#trace-18)
222
+
223
+ **Key:** `"00000000-0035-7000-8000-d15f8f676365"`
224
+
225
+ ### <a id="trace-18"></a> 18. 💾 write [13](#trace-13), [14](#trace-14), [17](#trace-17)
226
+
227
+ ### <a id="trace-19"></a> 19. ✅ workerManager.stopWorker
228
+
229
+ **Args:**
230
+
231
+ `"test"`
232
+
233
+ `"00000000-0011-7000-8000-413b6b433f41"`
234
+
235
+ ### <a id="trace-20"></a> 20. 🔓 released, locked at [8](#trace-8)
236
+
237
+ **Keys:**
238
+
239
+ `"worker:00000000-0011-7000-8000-413b6b433f41"`
240
+
241
+ ### <a id="trace-21"></a> 21. 💾 write [6](#trace-6)
242
+
243
+ ### <a id="trace-22"></a> 22. 🔓 released, locked at [3](#trace-3)
244
+
245
+ **Keys:** `[]`