(
workspaceId: string,
stepId: string,
update: Partial<DevToolsStep>
)
| 243 | } |
| 244 | |
| 245 | async updateStep( |
| 246 | workspaceId: string, |
| 247 | stepId: string, |
| 248 | update: Partial<DevToolsStep> |
| 249 | ): Promise<void> { |
| 250 | assert(workspaceId.trim().length > 0, "DevToolsService.updateStep requires a workspaceId"); |
| 251 | assert(stepId.trim().length > 0, "DevToolsService.updateStep requires stepId"); |
| 252 | |
| 253 | await this.ensureLoaded(workspaceId); |
| 254 | const data = this.getOrCreateWorkspaceData(workspaceId); |
| 255 | |
| 256 | const existing = data.steps.get(stepId); |
| 257 | if (!existing) { |
| 258 | log.warn( |
| 259 | `DevToolsService.updateStep skipped missing step ${stepId} in workspace ${workspaceId}` |
| 260 | ); |
| 261 | return; |
| 262 | } |
| 263 | |
| 264 | const mergedStep: DevToolsStep = { |
| 265 | ...existing, |
| 266 | ...update, |
| 267 | }; |
| 268 | data.steps.set(stepId, mergedStep); |
| 269 | |
| 270 | await this.appendToFile(workspaceId, { |
| 271 | type: "step-update", |
| 272 | stepId, |
| 273 | update, |
| 274 | }); |
| 275 | |
| 276 | this.emitWorkspaceEvent(workspaceId, { |
| 277 | type: "step-updated", |
| 278 | step: mergedStep, |
| 279 | }); |
| 280 | |
| 281 | if (data.runs.has(mergedStep.runId)) { |
| 282 | const summary = this.buildRunSummary(data, mergedStep.runId); |
| 283 | this.emitWorkspaceEvent(workspaceId, { type: "run-updated", run: summary }); |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | async finalizeStaleSteps(workspaceId: string): Promise<void> { |
| 288 | // Stale cleanup runs regardless of the current enabled state: steps that were |
no test coverage detected