Skip to content

Commit 15430ed

Browse files
committed
Fix review comments / lints
1 parent b26bdcd commit 15430ed

File tree

15 files changed

+16
-23
lines changed

15 files changed

+16
-23
lines changed

packages/common/src/interfaces.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { temporal } from '@temporalio/proto';
2-
import { WorkflowFunctionWithOptions } from './workflow-definition-options';
32

43
export type Payload = temporal.api.common.v1.IPayload;
54

packages/common/src/workflow-options.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ export function extractWorkflowType<T extends Workflow>(
251251
);
252252
}
253253

254+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
254255
export function isWorkflowFunctionWithOptions(obj: any): obj is WorkflowFunctionWithOptions<any[], any> {
255-
if (obj === undefined || obj === null) return false;
256+
if (obj == null) return false;
256257
return obj.__temporal_is_workflow_function_with_options === true;
257258
}

packages/test/src/deployment-versioning-v1/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CancelledFailure, setHandler, condition, defineWorkflowWithOptions } from '@temporalio/workflow';
1+
import { setHandler, condition, defineWorkflowWithOptions } from '@temporalio/workflow';
22
import { unblockSignal, versionQuery } from '../workflows';
33

44
defineWorkflowWithOptions({ versioningBehavior: 'auto-upgrade' }, deploymentVersioning);

packages/test/src/deployment-versioning-v2/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CancelledFailure, setHandler, condition, defineWorkflowWithOptions } from '@temporalio/workflow';
1+
import { setHandler, condition, defineWorkflowWithOptions } from '@temporalio/workflow';
22
import { unblockSignal, versionQuery } from '../workflows';
33

44
defineWorkflowWithOptions({ versioningBehavior: 'pinned' }, deploymentVersioning);

packages/test/src/deployment-versioning-v3/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CancelledFailure, setHandler, condition, defineWorkflowWithOptions } from '@temporalio/workflow';
1+
import { setHandler, condition, defineWorkflowWithOptions } from '@temporalio/workflow';
22
import { unblockSignal, versionQuery } from '../workflows';
33

44
defineWorkflowWithOptions({ versioningBehavior: 'auto-upgrade' }, deploymentVersioning);

packages/test/src/test-integration-split-one.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ test('Workflow can read WorkflowInfo', configMacro, async (t, config) => {
733733
historySize: res.historySize,
734734
startTime: res.startTime,
735735
runStartTime: res.runStartTime,
736-
currentBuildId: res.currentBuildId,
736+
currentBuildId: res.currentBuildId, // eslint-disable-line deprecation/deprecation
737737
// unsafe.now is a function, so doesn't make it through serialization, but .now is required, so we need to cast
738738
unsafe: { isReplaying: false } as UnsafeWorkflowInfo,
739739
});

packages/test/src/test-integration-workflows.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ export async function buildIdTester(): Promise<void> {
494494
});
495495

496496
workflow.setHandler(getBuildIdQuery, () => {
497-
return workflow.workflowInfo().currentBuildId ?? '';
497+
return workflow.workflowInfo().currentBuildId ?? ''; // eslint-disable-line deprecation/deprecation
498498
});
499499

500500
// The unblock signal will only be sent once we are in Worker 1.1.

packages/test/src/test-sinks.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ if (RUN_INTEGRATION_TESTS) {
9494
});
9595

9696
// Capture volatile values that are hard to predict
97-
const { historySize, startTime, runStartTime, currentBuildId } = recordedCalls[0].info;
97+
const { historySize, startTime, runStartTime, currentBuildId } = recordedCalls[0].info; // eslint-disable-line deprecation/deprecation
9898
t.true(historySize > 300);
9999

100100
const info: WorkflowInfo = {

packages/test/src/test-worker-deployment-versioning.ts

-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { Client } from '@temporalio/client';
1010
import { toCanonicalString, WorkerDeploymentVersion } from '@temporalio/common';
1111
import { temporal } from '@temporalio/proto';
1212
import { Worker } from './helpers';
13-
import * as activities from './activities';
1413
import { makeTestFunction } from './helpers-integration';
1514
import { unblockSignal, versionQuery } from './workflows';
1615

@@ -36,7 +35,6 @@ test('Worker deployment based versioning', async (t) => {
3635

3736
const worker1 = await Worker.create({
3837
workflowsPath: require.resolve('./deployment-versioning-v1'),
39-
activities,
4038
taskQueue,
4139
workerDeploymentOptions: {
4240
useWorkerVersioning: true,
@@ -51,7 +49,6 @@ test('Worker deployment based versioning', async (t) => {
5149

5250
const worker2 = await Worker.create({
5351
workflowsPath: require.resolve('./deployment-versioning-v2'),
54-
activities,
5552
taskQueue,
5653
workerDeploymentOptions: {
5754
useWorkerVersioning: true,
@@ -66,7 +63,6 @@ test('Worker deployment based versioning', async (t) => {
6663

6764
const worker3 = await Worker.create({
6865
workflowsPath: require.resolve('./deployment-versioning-v3'),
69-
activities,
7066
taskQueue,
7167
workerDeploymentOptions: {
7268
useWorkerVersioning: true,
@@ -153,7 +149,6 @@ test('Worker deployment based versioning with ramping', async (t) => {
153149

154150
const worker1 = await Worker.create({
155151
workflowsPath: require.resolve('./deployment-versioning-v1'),
156-
activities,
157152
taskQueue,
158153
workerDeploymentOptions: {
159154
useWorkerVersioning: true,
@@ -168,7 +163,6 @@ test('Worker deployment based versioning with ramping', async (t) => {
168163

169164
const worker2 = await Worker.create({
170165
workflowsPath: require.resolve('./deployment-versioning-v2'),
171-
activities,
172166
taskQueue,
173167
workerDeploymentOptions: {
174168
useWorkerVersioning: true,
@@ -260,7 +254,6 @@ test('Worker deployment with dynamic workflow on run', async (t) => {
260254

261255
const worker = await Worker.create({
262256
workflowsPath: require.resolve('./deployment-versioning-v1'),
263-
activities,
264257
taskQueue,
265258
workerDeploymentOptions: {
266259
useWorkerVersioning: true,
@@ -313,7 +306,6 @@ test('Workflows can use default versioning behavior', async (t) => {
313306

314307
const worker = await Worker.create({
315308
workflowsPath: require.resolve('./deployment-versioning-no-annotations'),
316-
activities,
317309
taskQueue,
318310
workerDeploymentOptions: {
319311
useWorkerVersioning: true,

packages/worker/src/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function convertToParentWorkflowType(
3333
export function convertDeploymentVersion(
3434
v: coresdk.common.IWorkerDeploymentVersion | null | undefined
3535
): WorkerDeploymentVersion | undefined {
36-
if (!v) {
36+
if (v == null) {
3737
return undefined;
3838
}
3939

packages/worker/src/worker-options.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -730,8 +730,8 @@ function compileWorkerInterceptors({
730730

731731
function addDefaultWorkerOptions(options: WorkerOptions, logger: Logger): WorkerOptionsWithDefaults {
732732
const {
733-
buildId,
734-
useVersioning,
733+
buildId, // eslint-disable-line deprecation/deprecation
734+
useVersioning, // eslint-disable-line deprecation/deprecation
735735
maxCachedWorkflows,
736736
showStackTraceSources,
737737
namespace,

packages/worker/src/worker.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ interface WorkflowWithLogAttributes {
164164
}
165165

166166
function addBuildIdIfMissing(options: CompiledWorkerOptions, bundleCode?: string): CompiledWorkerOptionsWithBuildId {
167-
if (options.buildId != null) {
167+
const bid = options.buildId; // eslint-disable-line deprecation/deprecation
168+
if (bid != null) {
168169
return options as CompiledWorkerOptionsWithBuildId;
169170
}
170171
const suffix = bundleCode ? `+${crypto.createHash('sha256').update(bundleCode).digest('hex')}` : '';

packages/workflow/src/flags.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@ type AltConditionFn = (ctx: { info: WorkflowInfo }) => boolean;
7272

7373
function buildIdSdkVersionMatches(version: RegExp): AltConditionFn {
7474
const regex = new RegExp(`^@temporalio/worker@(${version.source})[+]`);
75-
return ({ info }) => info.currentBuildId != null && regex.test(info.currentBuildId);
75+
return ({ info }) => info.currentBuildId != null && regex.test(info.currentBuildId); // eslint-disable-line deprecation/deprecation
7676
}

packages/workflow/src/interfaces.ts

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
TypedSearchAttributes,
1414
SearchAttributePair,
1515
WorkerDeploymentVersion,
16-
VersioningBehavior,
1716
} from '@temporalio/common';
1817
import { SymbolBasedInstanceOfError } from '@temporalio/common/lib/type-helpers';
1918
import { makeProtoEnumConverters } from '@temporalio/common/lib/internal-workflow/enums-helpers';

packages/workflow/src/workflow.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import {
2222
WorkflowReturnType,
2323
WorkflowUpdateValidatorType,
2424
SearchAttributeUpdatePair,
25+
WorkflowDefinitionOptions,
26+
WorkflowFunctionWithOptions,
2527
} from '@temporalio/common';
2628
import {
2729
encodeUnifiedSearchAttributes,
@@ -31,7 +33,6 @@ import { versioningIntentToProto } from '@temporalio/common/lib/versioning-inten
3133
import { Duration, msOptionalToTs, msToNumber, msToTs, requiredTsToMs } from '@temporalio/common/lib/time';
3234
import { composeInterceptors } from '@temporalio/common/lib/interceptors';
3335
import { temporal } from '@temporalio/proto';
34-
import { WorkflowDefinitionOptions, WorkflowFunctionWithOptions } from '@temporalio/common';
3536
import { CancellationScope, registerSleepImplementation } from './cancellation-scope';
3637
import { UpdateScope } from './update-scope';
3738
import {

0 commit comments

Comments
 (0)