@backstage/plugin-scaffolder-node 0.13.6-next.2 → 0.13.7-next.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @backstage/plugin-scaffolder-node
2
2
 
3
+ ## 0.13.7-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - e95b649: Added task recovery feature with new `scaffolder.taskRecovery` config section. When enabled, tasks that crash or timeout are automatically recovered and resume from the last completed step, task secrets are retained until the task reaches a terminal state so recovery can continue, and completed step outputs are persisted. Enabling recovery applies to all scaffolder tasks, so actions used by those tasks should be idempotent or use checkpoints. When recovery is disabled (the default), the previous behavior is unchanged: secrets are cleared as soon as a task is claimed and retries re-run every step. The new config consolidates previous experimental flags (`EXPERIMENTAL_recoverTasks`, `EXPERIMENTAL_workspaceSerialization`, `EXPERIMENTAL_recoverTasksTimeout`) which remain supported as fallbacks. The legacy workspace provider setting continues to select a provider only when `EXPERIMENTAL_workspaceSerialization` is `true`.
8
+
9
+ Workspace serialization for task recovery now requires installing a separate workspace provider module, including when you use the legacy configuration. For development, use `@backstage/plugin-scaffolder-backend-module-workspace-database` (50 MB limit, not recommended for production). On first startup, that module migrates existing database workspace snapshots from the legacy task storage. For production, use `@backstage/plugin-scaffolder-backend-module-gcp` or a similar external storage provider. The scaffolder rejects a configured provider that has not been installed and registered.
10
+
11
+ Enabling crash recovery does not keep completed task event streams open; normal task completion remains terminal for event-stream clients.
12
+
13
+ - Updated dependencies
14
+ - @backstage/plugin-scaffolder-common@2.3.0-next.0
15
+
16
+ ## 0.13.6
17
+
18
+ ### Patch Changes
19
+
20
+ - 78bf918: chore(deps): bump `tar` from 7.5.15 to 7.5.21
21
+ - 4e8d763: Migrated tests from MSW v1 to MSW v2.
22
+ - Updated dependencies
23
+ - @backstage/catalog-model@1.10.0
24
+ - @backstage/backend-plugin-api@1.10.0
25
+ - @backstage/integration@2.1.0
26
+ - @backstage/plugin-permission-common@0.9.10
27
+ - @backstage/plugin-permission-node@0.11.3
28
+ - @backstage/plugin-scaffolder-common@2.2.2
29
+
3
30
  ## 0.13.6-next.2
4
31
 
5
32
  ### Patch Changes
package/dist/alpha.d.ts CHANGED
@@ -140,6 +140,8 @@ type CheckpointState = {
140
140
  /**
141
141
  * Context for checkpoint function invocation.
142
142
  *
143
+ * The value returned by `fn` will be serialized to JSON for storage.
144
+ *
143
145
  * @alpha
144
146
  */
145
147
  type CheckpointContext<T extends JsonValue | void = JsonValue> = {
@@ -148,7 +150,8 @@ type CheckpointContext<T extends JsonValue | void = JsonValue> = {
148
150
  */
149
151
  key: string;
150
152
  /**
151
- * Function to execute for the checkpoint
153
+ * Function to execute for the checkpoint.
154
+ * The return value will be JSON-serialized for storage.
152
155
  */
153
156
  fn: () => Promise<T> | T;
154
157
  };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { JsonObject, Observable, JsonValue, Expand } from '@backstage/types';
1
+ import { JsonObject, JsonValue, Observable, Expand } from '@backstage/types';
2
2
  import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
3
3
  import { BackstageCredentials, LoggerService, UrlReaderService } from '@backstage/backend-plugin-api';
4
4
  import { PermissionCriteria } from '@backstage/plugin-permission-common';
@@ -157,6 +157,13 @@ interface TaskContext {
157
157
  taskId: string;
158
158
  targetPath: string;
159
159
  }): Promise<void>;
160
+ updateStepState?(options: {
161
+ stepId: string;
162
+ status: 'completed';
163
+ output: {
164
+ [name: string]: JsonValue;
165
+ };
166
+ }): Promise<void>;
160
167
  getWorkspaceName(): Promise<string>;
161
168
  getInitiatorCredentials(): Promise<BackstageCredentials>;
162
169
  }
@@ -215,6 +222,10 @@ type ActionContext<TActionInput extends JsonObject, TActionOutput extends JsonOb
215
222
  secrets?: TaskSecrets;
216
223
  workspacePath: string;
217
224
  input: TActionInput;
225
+ /**
226
+ * Execute a function with checkpoint support for recovery.
227
+ * The return value is serialized to JSON for storage.
228
+ */
218
229
  checkpoint<T extends JsonValue | void>(opts: CheckpointContext<T>): Promise<T>;
219
230
  output(name: keyof TActionOutput, value: TActionOutput[keyof TActionOutput]): void;
220
231
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-node",
3
- "version": "0.13.6-next.2",
3
+ "version": "0.13.7-next.0",
4
4
  "description": "The plugin-scaffolder-node module for @backstage/plugin-scaffolder-backend",
5
5
  "backstage": {
6
6
  "role": "node-library",
@@ -70,13 +70,13 @@
70
70
  "test": "backstage-cli package test"
71
71
  },
72
72
  "dependencies": {
73
- "@backstage/backend-plugin-api": "1.10.0-next.1",
74
- "@backstage/catalog-model": "1.9.0",
73
+ "@backstage/backend-plugin-api": "1.10.0",
74
+ "@backstage/catalog-model": "1.10.0",
75
75
  "@backstage/errors": "1.3.1",
76
- "@backstage/integration": "2.1.0-next.0",
77
- "@backstage/plugin-permission-common": "0.9.9",
78
- "@backstage/plugin-permission-node": "0.11.3-next.0",
79
- "@backstage/plugin-scaffolder-common": "2.2.2-next.0",
76
+ "@backstage/integration": "2.1.0",
77
+ "@backstage/plugin-permission-common": "0.9.10",
78
+ "@backstage/plugin-permission-node": "0.11.3",
79
+ "@backstage/plugin-scaffolder-common": "2.3.0-next.0",
80
80
  "@backstage/types": "1.2.2",
81
81
  "@isomorphic-git/pgp-plugin": "^0.0.7",
82
82
  "concat-stream": "^2.0.0",
@@ -93,14 +93,14 @@
93
93
  "zod-to-json-schema": "^3.25.1"
94
94
  },
95
95
  "devDependencies": {
96
- "@backstage/backend-test-utils": "1.11.6-next.1",
97
- "@backstage/cli": "0.36.5-next.1",
96
+ "@backstage/backend-test-utils": "1.11.6",
97
+ "@backstage/cli": "0.36.6-next.0",
98
98
  "@backstage/config": "1.3.8",
99
99
  "@types/lodash": "^4.14.151",
100
- "msw": "^1.0.0"
100
+ "msw": "^2.0.0"
101
101
  },
102
102
  "peerDependencies": {
103
- "@backstage/backend-test-utils": "1.11.6-next.1"
103
+ "@backstage/backend-test-utils": "1.11.6"
104
104
  },
105
105
  "peerDependenciesMeta": {
106
106
  "@backstage/backend-test-utils": {