@diia-inhouse/workflow 2.6.3 → 2.7.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TemporalClient } from "../services/client.js";
|
|
2
|
-
import { isNewStepsAdded } from "./determinism/errorClassifier.js";
|
|
2
|
+
import { isNewStepsAdded, isWorkflowNotFoundError } from "./determinism/errorClassifier.js";
|
|
3
3
|
import { loadHistoryEntries } from "./determinism/historyFiles.js";
|
|
4
4
|
import { DeterminismReportBuilder } from "./determinism/report.js";
|
|
5
5
|
import { buildReplayOptions, resolveWorkflowsPath } from "./determinism/replayOptions.js";
|
|
@@ -160,9 +160,13 @@ var CheckWorkflowDeterminismCommand = class {
|
|
|
160
160
|
}
|
|
161
161
|
async checkSingleWorkflow(client, options, workflowId, reportBuilder) {
|
|
162
162
|
this.logger.info(`Checking workflow ${workflowId}`);
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
const fetched = await this.fetchWorkflowHistory(client, workflowId);
|
|
164
|
+
if (!fetched) {
|
|
165
|
+
reportBuilder.addSkipped();
|
|
166
|
+
this.logger.warn(`⚠️ Workflow ${workflowId} no longer exists on the server (likely deleted after retention) — skipping`);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const { history, workflowName } = fetched;
|
|
166
170
|
const outcome = await replaySingle(options, history, workflowId, workflowName, {
|
|
167
171
|
maxRetries: this.maxRetries,
|
|
168
172
|
retryDelayMs: this.retryDelayMs,
|
|
@@ -211,6 +215,18 @@ var CheckWorkflowDeterminismCommand = class {
|
|
|
211
215
|
break;
|
|
212
216
|
}
|
|
213
217
|
}
|
|
218
|
+
async fetchWorkflowHistory(client, workflowId) {
|
|
219
|
+
const handle = client.workflow.getHandle(workflowId);
|
|
220
|
+
try {
|
|
221
|
+
return {
|
|
222
|
+
history: await handle.fetchHistory(),
|
|
223
|
+
workflowName: (await handle.describe()).type
|
|
224
|
+
};
|
|
225
|
+
} catch (err) {
|
|
226
|
+
if (isWorkflowNotFoundError(err)) return;
|
|
227
|
+
throw err;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
214
230
|
async loadWorkflows(workflowsPath) {
|
|
215
231
|
const fullWorkflowsPath = resolveWorkflowsPath(workflowsPath);
|
|
216
232
|
if (!existsSync(fullWorkflowsPath)) throw new Error(`Workflow files not found under provided path: ${fullWorkflowsPath}`);
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { WorkflowNotFoundError, isGrpcServiceError } from "@temporalio/client";
|
|
1
2
|
import { DeterminismViolationError } from "@temporalio/workflow";
|
|
2
3
|
//#region src/cli/determinism/errorClassifier.ts
|
|
4
|
+
const GRPC_STATUS_NOT_FOUND = 5;
|
|
5
|
+
function isWorkflowNotFoundError(error) {
|
|
6
|
+
if (error instanceof WorkflowNotFoundError) return true;
|
|
7
|
+
return isGrpcServiceError(error) && error.code === GRPC_STATUS_NOT_FOUND;
|
|
8
|
+
}
|
|
3
9
|
const activityMismatchRegex = /Activity type of scheduled event '(.+?)' does not match activity type of activity command '(.+?)'/;
|
|
4
10
|
function isNewStepsAdded(error) {
|
|
5
11
|
return error.errorType === "DeterminismViolation" && error.errorMessage.includes("WorkflowExecutionCompleted");
|
|
@@ -58,4 +64,4 @@ function classifyReplayError(workflowId, error) {
|
|
|
58
64
|
};
|
|
59
65
|
}
|
|
60
66
|
//#endregion
|
|
61
|
-
export { classifyReplayError, isNewStepsAdded };
|
|
67
|
+
export { classifyReplayError, isNewStepsAdded, isWorkflowNotFoundError };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diia-inhouse/workflow",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "Workflow",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -100,15 +100,15 @@
|
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
102
|
"@diia-inhouse/configs": "7.0.1",
|
|
103
|
-
"@diia-inhouse/diia-logger": "4.3.
|
|
104
|
-
"@diia-inhouse/diia-metrics": "7.1.
|
|
105
|
-
"@diia-inhouse/diia-queue": "14.0.
|
|
106
|
-
"@diia-inhouse/env": "3.3.
|
|
107
|
-
"@diia-inhouse/healthcheck": "2.1.
|
|
108
|
-
"@diia-inhouse/oxc-config": "1.
|
|
109
|
-
"@diia-inhouse/test": "8.2.
|
|
110
|
-
"@diia-inhouse/types": "13.2.
|
|
111
|
-
"@diia-inhouse/utils": "6.0.
|
|
103
|
+
"@diia-inhouse/diia-logger": "4.3.13",
|
|
104
|
+
"@diia-inhouse/diia-metrics": "7.1.23",
|
|
105
|
+
"@diia-inhouse/diia-queue": "14.0.21",
|
|
106
|
+
"@diia-inhouse/env": "3.3.12",
|
|
107
|
+
"@diia-inhouse/healthcheck": "2.1.25",
|
|
108
|
+
"@diia-inhouse/oxc-config": "1.11.0",
|
|
109
|
+
"@diia-inhouse/test": "8.2.9",
|
|
110
|
+
"@diia-inhouse/types": "13.2.2",
|
|
111
|
+
"@diia-inhouse/utils": "6.0.21",
|
|
112
112
|
"@types/lodash": "4.17.24",
|
|
113
113
|
"@types/node": "25.6.2",
|
|
114
114
|
"@types/yargs": "17.0.35",
|