@temporalio/core-bridge 1.11.8 → 1.12.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/Cargo.lock +219 -193
- package/Cargo.toml +27 -8
- package/README.md +5 -0
- package/index.js +72 -12
- package/lib/errors.d.ts +25 -0
- package/lib/errors.js +76 -1
- package/lib/errors.js.map +1 -1
- package/lib/index.d.ts +11 -478
- package/lib/index.js +28 -5
- package/lib/index.js.map +1 -1
- package/lib/native.d.ts +330 -0
- package/lib/{worker-tuner.js → native.js} +1 -1
- package/lib/native.js.map +1 -0
- package/package.json +7 -3
- package/releases/aarch64-apple-darwin/index.node +0 -0
- package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
- package/releases/x86_64-apple-darwin/index.node +0 -0
- package/releases/x86_64-pc-windows-msvc/index.node +0 -0
- package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
- package/sdk-core/.cargo/config.toml +8 -2
- package/sdk-core/.cargo/multi-worker-manual-test +15 -0
- package/sdk-core/.github/workflows/per-pr.yml +40 -11
- package/sdk-core/AGENTS.md +73 -0
- package/sdk-core/ARCHITECTURE.md +71 -23
- package/sdk-core/Cargo.toml +1 -1
- package/sdk-core/README.md +4 -4
- package/sdk-core/arch_docs/workflow_task_chunking.md +51 -0
- package/sdk-core/client/Cargo.toml +1 -1
- package/sdk-core/client/src/lib.rs +49 -13
- package/sdk-core/client/src/metrics.rs +15 -16
- package/sdk-core/client/src/proxy.rs +2 -2
- package/sdk-core/client/src/raw.rs +54 -8
- package/sdk-core/client/src/retry.rs +109 -13
- package/sdk-core/client/src/worker_registry/mod.rs +4 -4
- package/sdk-core/client/src/workflow_handle/mod.rs +1 -1
- package/sdk-core/core/Cargo.toml +28 -8
- package/sdk-core/core/src/abstractions.rs +62 -10
- package/sdk-core/core/src/core_tests/activity_tasks.rs +180 -8
- package/sdk-core/core/src/core_tests/mod.rs +4 -4
- package/sdk-core/core/src/core_tests/queries.rs +18 -4
- package/sdk-core/core/src/core_tests/workers.rs +3 -3
- package/sdk-core/core/src/core_tests/workflow_tasks.rs +191 -25
- package/sdk-core/core/src/ephemeral_server/mod.rs +10 -3
- package/sdk-core/core/src/internal_flags.rs +14 -14
- package/sdk-core/core/src/lib.rs +5 -2
- package/sdk-core/core/src/pollers/mod.rs +1 -1
- package/sdk-core/core/src/pollers/poll_buffer.rs +495 -164
- package/sdk-core/core/src/protosext/mod.rs +3 -3
- package/sdk-core/core/src/replay/mod.rs +3 -3
- package/sdk-core/core/src/telemetry/metrics.rs +13 -4
- package/sdk-core/core/src/telemetry/mod.rs +72 -70
- package/sdk-core/core/src/telemetry/otel.rs +51 -54
- package/sdk-core/core/src/test_help/mod.rs +9 -3
- package/sdk-core/core/src/worker/activities/activity_heartbeat_manager.rs +31 -11
- package/sdk-core/core/src/worker/activities/local_activities.rs +35 -28
- package/sdk-core/core/src/worker/activities.rs +58 -30
- package/sdk-core/core/src/worker/client/mocks.rs +3 -3
- package/sdk-core/core/src/worker/client.rs +155 -53
- package/sdk-core/core/src/worker/mod.rs +103 -95
- package/sdk-core/core/src/worker/nexus.rs +100 -73
- package/sdk-core/core/src/worker/tuner/resource_based.rs +14 -6
- package/sdk-core/core/src/worker/tuner.rs +4 -13
- package/sdk-core/core/src/worker/workflow/history_update.rs +47 -51
- package/sdk-core/core/src/worker/workflow/machines/child_workflow_state_machine.rs +1 -4
- package/sdk-core/core/src/worker/workflow/machines/nexus_operation_state_machine.rs +127 -32
- package/sdk-core/core/src/worker/workflow/machines/transition_coverage.rs +1 -2
- package/sdk-core/core/src/worker/workflow/machines/update_state_machine.rs +1 -1
- package/sdk-core/core/src/worker/workflow/machines/workflow_machines.rs +55 -42
- package/sdk-core/core/src/worker/workflow/managed_run.rs +45 -35
- package/sdk-core/core/src/worker/workflow/mod.rs +200 -97
- package/sdk-core/core/src/worker/workflow/wft_poller.rs +175 -4
- package/sdk-core/core/src/worker/workflow/workflow_stream.rs +38 -36
- package/sdk-core/core-api/Cargo.toml +8 -0
- package/sdk-core/core-api/src/envconfig.rs +1544 -0
- package/sdk-core/core-api/src/lib.rs +2 -0
- package/sdk-core/core-api/src/telemetry/metrics.rs +8 -0
- package/sdk-core/core-api/src/telemetry.rs +36 -3
- package/sdk-core/core-api/src/worker.rs +301 -75
- package/sdk-core/docker/docker-compose-telem.yaml +1 -0
- package/sdk-core/etc/prometheus.yaml +6 -2
- package/sdk-core/histories/long_local_activity_with_update-0_history.bin +0 -0
- package/sdk-core/histories/long_local_activity_with_update-1_history.bin +0 -0
- package/sdk-core/histories/long_local_activity_with_update-2_history.bin +0 -0
- package/sdk-core/histories/long_local_activity_with_update-3_history.bin +0 -0
- package/sdk-core/sdk/src/activity_context.rs +5 -0
- package/sdk-core/sdk/src/interceptors.rs +73 -3
- package/sdk-core/sdk/src/lib.rs +15 -16
- package/sdk-core/sdk/src/workflow_context/options.rs +10 -0
- package/sdk-core/sdk/src/workflow_context.rs +48 -29
- package/sdk-core/sdk/src/workflow_future.rs +5 -6
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/.github/workflows/push-to-buf.yml +20 -0
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/CODEOWNERS +6 -0
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/README.md +17 -6
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/VERSION +1 -1
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/buf.lock +7 -2
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/buf.yaml +2 -0
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/request_response.proto +78 -0
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/service.proto +29 -0
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/identity/v1/message.proto +74 -32
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/namespace/v1/message.proto +45 -15
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/nexus/v1/message.proto +7 -1
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/operation/v1/message.proto +3 -3
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/region/v1/message.proto +3 -3
- package/sdk-core/sdk-core-protos/protos/api_upstream/LICENSE +1 -1
- package/sdk-core/sdk-core-protos/protos/api_upstream/buf.yaml +2 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv2.json +1103 -88
- package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv3.yaml +1233 -151
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/activity/v1/message.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/batch/v1/message.proto +19 -24
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/command/v1/message.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto +12 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/deployment/v1/message.proto +45 -45
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/batch_operation.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/command_type.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/common.proto +15 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/deployment.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/event_type.proto +4 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/namespace.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/nexus.proto +0 -20
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/query.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/reset.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/schedule.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/task_queue.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/update.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/workflow.proto +4 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/errordetails/v1/message.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/export/v1/message.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/failure/v1/message.proto +2 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/filter/v1/message.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/history/v1/message.proto +75 -49
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/namespace/v1/message.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/nexus/v1/message.proto +0 -20
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/operatorservice/v1/request_response.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/operatorservice/v1/service.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/protocol/v1/message.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/query/v1/message.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/replication/v1/message.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/rules/v1/message.proto +90 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/schedule/v1/message.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/enhanced_stack_trace.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/task_complete_metadata.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/user_metadata.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/workflow_metadata.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +17 -38
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/update/v1/message.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/version/v1/message.proto +0 -22
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflow/v1/message.proto +151 -44
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +172 -65
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +69 -28
- package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/activity_task/activity_task.proto +18 -0
- package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/common/common.proto +5 -0
- package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/nexus/nexus.proto +16 -1
- package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +21 -15
- package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +3 -0
- package/sdk-core/sdk-core-protos/protos/local/temporal/sdk/core/workflow_completion/workflow_completion.proto +3 -0
- package/sdk-core/sdk-core-protos/src/lib.rs +60 -16
- package/sdk-core/test-utils/src/lib.rs +157 -39
- package/sdk-core/tests/cloud_tests.rs +86 -0
- package/sdk-core/tests/fuzzy_workflow.rs +23 -26
- package/sdk-core/tests/global_metric_tests.rs +116 -0
- package/sdk-core/tests/heavy_tests.rs +127 -7
- package/sdk-core/tests/integ_tests/client_tests.rs +2 -8
- package/sdk-core/tests/integ_tests/metrics_tests.rs +100 -106
- package/sdk-core/tests/integ_tests/polling_tests.rs +94 -8
- package/sdk-core/tests/integ_tests/update_tests.rs +75 -6
- package/sdk-core/tests/integ_tests/worker_tests.rs +54 -5
- package/sdk-core/tests/integ_tests/worker_versioning_tests.rs +240 -0
- package/sdk-core/tests/integ_tests/workflow_tests/determinism.rs +41 -3
- package/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +168 -8
- package/sdk-core/tests/integ_tests/workflow_tests/nexus.rs +285 -15
- package/sdk-core/tests/integ_tests/workflow_tests/priority.rs +12 -4
- package/sdk-core/tests/integ_tests/workflow_tests/stickyness.rs +3 -2
- package/sdk-core/tests/integ_tests/workflow_tests.rs +124 -74
- package/sdk-core/tests/main.rs +3 -51
- package/sdk-core/tests/manual_tests.rs +430 -0
- package/sdk-core/tests/runner.rs +28 -2
- package/src/client.rs +565 -0
- package/src/helpers/abort_controller.rs +204 -0
- package/src/helpers/callbacks.rs +299 -0
- package/src/helpers/errors.rs +302 -0
- package/src/helpers/future.rs +44 -0
- package/src/helpers/handles.rs +191 -0
- package/src/helpers/inspect.rs +18 -0
- package/src/helpers/json_string.rs +58 -0
- package/src/helpers/mod.rs +20 -0
- package/src/helpers/properties.rs +71 -0
- package/src/helpers/try_from_js.rs +213 -0
- package/src/helpers/try_into_js.rs +129 -0
- package/src/lib.rs +28 -40
- package/src/logs.rs +111 -0
- package/src/metrics.rs +325 -0
- package/src/runtime.rs +409 -498
- package/src/testing.rs +315 -57
- package/src/worker.rs +907 -378
- package/ts/errors.ts +57 -0
- package/ts/index.ts +10 -596
- package/ts/native.ts +496 -0
- package/lib/worker-tuner.d.ts +0 -167
- package/lib/worker-tuner.js.map +0 -1
- package/src/conversions/slot_supplier_bridge.rs +0 -291
- package/src/conversions.rs +0 -618
- package/src/errors.rs +0 -38
- package/src/helpers.rs +0 -297
- package/ts/worker-tuner.ts +0 -193
package/lib/native.d.ts
ADDED
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Indicates a property that is allowed to be unspecified when calling in or out of
|
|
3
|
+
* native code (the equivalent of the `Option<T>` type in Rust).
|
|
4
|
+
*
|
|
5
|
+
* Always use either this type or the `T | null` idiom to indicate a property that may
|
|
6
|
+
* legitimately be left unspecified when calling into or out of native code. Never use
|
|
7
|
+
* `T | undefined` or `prop?: T` on TS/Rust interfaces.
|
|
8
|
+
*
|
|
9
|
+
* ### Rationale
|
|
10
|
+
*
|
|
11
|
+
* Differentiating between "a property that is set to an unspecified optional value"
|
|
12
|
+
* and "a non-existant property" allows eager detection of some of the most common
|
|
13
|
+
* bug patterns resulting from incoherencies between the JS and Rust type definitions
|
|
14
|
+
* (e.g. optional properties whose names differ between the two languages, or that
|
|
15
|
+
* are missing in the JS interface, etc.).
|
|
16
|
+
*
|
|
17
|
+
* Unfortunately, it is not possible at present in Neon to differentiate between
|
|
18
|
+
* a property that is set to `undefined` and a property that is missing;
|
|
19
|
+
* i.e. `obj.get_value(cx, "prop")` will return `undefined` in both cases.
|
|
20
|
+
*
|
|
21
|
+
* We therefore follow the following principles for our TypeScript/Rust interfaces:
|
|
22
|
+
*
|
|
23
|
+
* - Always use `null` to indicate an intentionally unspecified optional value
|
|
24
|
+
* in TypeScript interfaces. This will be converted to `None` on the Rust side.
|
|
25
|
+
* - Explicitly set _every_ properties on objects sent to the native code,
|
|
26
|
+
* including optional properties (e.g. `{ prop: input.prop ?? null }`).
|
|
27
|
+
* - Never use the "optional property" syntax in TypeScript (i.e. `prop?: T`).
|
|
28
|
+
*
|
|
29
|
+
* Thanks to those conventions, a property that reads as `undefined` is known to to always
|
|
30
|
+
* indicate an _unintentionally missing_ property, which will results in a runtime error.
|
|
31
|
+
*/
|
|
32
|
+
type Option<T> = T | null;
|
|
33
|
+
/**
|
|
34
|
+
* Marker for values that are transferred as JSON strings.
|
|
35
|
+
*/
|
|
36
|
+
export type JsonString<_T> = string;
|
|
37
|
+
export declare function newRuntime(telemOptions: RuntimeOptions): Runtime;
|
|
38
|
+
export declare function runtimeShutdown(runtime: Runtime): void;
|
|
39
|
+
export interface Runtime {
|
|
40
|
+
type: 'runtime';
|
|
41
|
+
}
|
|
42
|
+
export type RuntimeOptions = {
|
|
43
|
+
logExporter: LogExporterOptions;
|
|
44
|
+
telemetry: TelemetryOptions;
|
|
45
|
+
metricsExporter: MetricExporterOptions;
|
|
46
|
+
};
|
|
47
|
+
export type TelemetryOptions = {
|
|
48
|
+
attachServiceName: boolean;
|
|
49
|
+
metricPrefix: string;
|
|
50
|
+
};
|
|
51
|
+
export type LogExporterOptions = {
|
|
52
|
+
type: 'console';
|
|
53
|
+
filter: string;
|
|
54
|
+
} | {
|
|
55
|
+
type: 'forward';
|
|
56
|
+
filter: string;
|
|
57
|
+
receiver: (entries: JsonString<LogEntry>[]) => void;
|
|
58
|
+
};
|
|
59
|
+
export type MetricExporterOptions = PrometheusMetricsExporterOptions | OtelMetricsExporterOptions | null;
|
|
60
|
+
export interface PrometheusMetricsExporterOptions {
|
|
61
|
+
type: 'prometheus';
|
|
62
|
+
socketAddr: string;
|
|
63
|
+
globalTags: Record<string, string>;
|
|
64
|
+
countersTotalSuffix: boolean;
|
|
65
|
+
unitSuffix: boolean;
|
|
66
|
+
useSecondsForDurations: boolean;
|
|
67
|
+
histogramBucketOverrides: Record<string, number[]>;
|
|
68
|
+
}
|
|
69
|
+
export interface OtelMetricsExporterOptions {
|
|
70
|
+
type: 'otel';
|
|
71
|
+
url: string;
|
|
72
|
+
headers: Record<string, string>;
|
|
73
|
+
metricPeriodicity: number;
|
|
74
|
+
metricTemporality: 'cumulative' | 'delta';
|
|
75
|
+
globalTags: Record<string, string>;
|
|
76
|
+
useSecondsForDurations: boolean;
|
|
77
|
+
histogramBucketOverrides: Record<string, number[]>;
|
|
78
|
+
protocol: 'http' | 'grpc';
|
|
79
|
+
}
|
|
80
|
+
export declare function newClient(runtime: Runtime, clientOptions: ClientOptions): Promise<Client>;
|
|
81
|
+
export declare function clientUpdateHeaders(client: Client, headers: Record<string, string>): void;
|
|
82
|
+
export declare function clientUpdateApiKey(client: Client, apiKey: string): void;
|
|
83
|
+
export declare function clientSendRequest(client: Client, call: RpcCall): Promise<Buffer>;
|
|
84
|
+
export declare function clientClose(client: Client): void;
|
|
85
|
+
export interface Client {
|
|
86
|
+
type: 'client';
|
|
87
|
+
}
|
|
88
|
+
export interface ClientOptions {
|
|
89
|
+
targetUrl: string;
|
|
90
|
+
clientName: string;
|
|
91
|
+
clientVersion: string;
|
|
92
|
+
tls: Option<TLSConfig>;
|
|
93
|
+
httpConnectProxy: Option<HttpConnectProxy>;
|
|
94
|
+
headers: Option<Record<string, string>>;
|
|
95
|
+
apiKey: Option<string>;
|
|
96
|
+
disableErrorCodeMetricTags: boolean;
|
|
97
|
+
}
|
|
98
|
+
export interface TLSConfig {
|
|
99
|
+
domain: Option<string>;
|
|
100
|
+
serverRootCaCert: Option<Buffer>;
|
|
101
|
+
clientTlsConfig: Option<TlsConfigClientCertPair>;
|
|
102
|
+
}
|
|
103
|
+
export interface TlsConfigClientCertPair {
|
|
104
|
+
clientCert: Buffer;
|
|
105
|
+
clientPrivateKey: Buffer;
|
|
106
|
+
}
|
|
107
|
+
export interface HttpConnectProxy {
|
|
108
|
+
targetHost: string;
|
|
109
|
+
basicAuth: Option<{
|
|
110
|
+
username: string;
|
|
111
|
+
password: string;
|
|
112
|
+
}>;
|
|
113
|
+
}
|
|
114
|
+
export interface HttpConnectProxyBasicAuth {
|
|
115
|
+
username: string;
|
|
116
|
+
password: string;
|
|
117
|
+
}
|
|
118
|
+
export interface RpcCall {
|
|
119
|
+
rpc: string;
|
|
120
|
+
req: Buffer;
|
|
121
|
+
retry: boolean;
|
|
122
|
+
metadata: Record<string, string>;
|
|
123
|
+
timeout: Option<number>;
|
|
124
|
+
}
|
|
125
|
+
export declare function newWorker(client: Client, workerOptions: WorkerOptions): Worker;
|
|
126
|
+
export declare function workerValidate(worker: Worker): Promise<void>;
|
|
127
|
+
export declare function workerPollWorkflowActivation(worker: Worker): Promise<Buffer>;
|
|
128
|
+
export declare function workerCompleteWorkflowActivation(worker: Worker, result: Buffer): Promise<void>;
|
|
129
|
+
export declare function workerPollActivityTask(worker: Worker): Promise<Buffer>;
|
|
130
|
+
export declare function workerCompleteActivityTask(worker: Worker, result: Buffer): Promise<void>;
|
|
131
|
+
export declare function workerRecordActivityHeartbeat(worker: Worker, heartbeat: Buffer): void;
|
|
132
|
+
export declare function workerInitiateShutdown(worker: Worker): void;
|
|
133
|
+
export declare function workerFinalizeShutdown(worker: Worker): Promise<void>;
|
|
134
|
+
export interface Worker {
|
|
135
|
+
type: 'worker';
|
|
136
|
+
}
|
|
137
|
+
export interface WorkerOptions {
|
|
138
|
+
identity: string;
|
|
139
|
+
buildId: string;
|
|
140
|
+
useVersioning: boolean;
|
|
141
|
+
workerDeploymentOptions: Option<WorkerDeploymentOptions>;
|
|
142
|
+
taskQueue: string;
|
|
143
|
+
namespace: string;
|
|
144
|
+
tuner: WorkerTunerOptions;
|
|
145
|
+
nonStickyToStickyPollRatio: number;
|
|
146
|
+
workflowTaskPollerBehavior: PollerBehavior;
|
|
147
|
+
activityTaskPollerBehavior: PollerBehavior;
|
|
148
|
+
enableNonLocalActivities: boolean;
|
|
149
|
+
stickyQueueScheduleToStartTimeout: number;
|
|
150
|
+
maxCachedWorkflows: number;
|
|
151
|
+
maxHeartbeatThrottleInterval: number;
|
|
152
|
+
defaultHeartbeatThrottleInterval: number;
|
|
153
|
+
maxTaskQueueActivitiesPerSecond: Option<number>;
|
|
154
|
+
maxActivitiesPerSecond: Option<number>;
|
|
155
|
+
shutdownGraceTime: number;
|
|
156
|
+
}
|
|
157
|
+
export type PollerBehavior = {
|
|
158
|
+
type: 'simple-maximum';
|
|
159
|
+
maximum: number;
|
|
160
|
+
} | {
|
|
161
|
+
type: 'autoscaling';
|
|
162
|
+
minimum: number;
|
|
163
|
+
maximum: number;
|
|
164
|
+
initial: number;
|
|
165
|
+
};
|
|
166
|
+
export type WorkerDeploymentOptions = {
|
|
167
|
+
version: WorkerDeploymentVersion;
|
|
168
|
+
useWorkerVersioning: boolean;
|
|
169
|
+
defaultVersioningBehavior: VersioningBehavior;
|
|
170
|
+
};
|
|
171
|
+
export type WorkerDeploymentVersion = {
|
|
172
|
+
buildId: string;
|
|
173
|
+
deploymentName: string;
|
|
174
|
+
};
|
|
175
|
+
export type VersioningBehavior = {
|
|
176
|
+
type: 'pinned';
|
|
177
|
+
} | {
|
|
178
|
+
type: 'auto-upgrade';
|
|
179
|
+
};
|
|
180
|
+
export interface WorkerTunerOptions {
|
|
181
|
+
workflowTaskSlotSupplier: SlotSupplierOptions;
|
|
182
|
+
activityTaskSlotSupplier: SlotSupplierOptions;
|
|
183
|
+
localActivityTaskSlotSupplier: SlotSupplierOptions;
|
|
184
|
+
}
|
|
185
|
+
export type SlotSupplierOptions = FixedSizeSlotSupplierOptions | ResourceBasedSlotSupplierOptions | CustomSlotSupplierOptions<any>;
|
|
186
|
+
interface FixedSizeSlotSupplierOptions {
|
|
187
|
+
type: 'fixed-size';
|
|
188
|
+
numSlots: number;
|
|
189
|
+
}
|
|
190
|
+
interface ResourceBasedSlotSupplierOptions {
|
|
191
|
+
type: 'resource-based';
|
|
192
|
+
minimumSlots: number;
|
|
193
|
+
maximumSlots: number;
|
|
194
|
+
rampThrottle: number;
|
|
195
|
+
tunerOptions: ResourceBasedTunerOptions;
|
|
196
|
+
}
|
|
197
|
+
interface ResourceBasedTunerOptions {
|
|
198
|
+
targetMemoryUsage: number;
|
|
199
|
+
targetCpuUsage: number;
|
|
200
|
+
}
|
|
201
|
+
export interface CustomSlotSupplierOptions<SI extends SlotInfo> {
|
|
202
|
+
type: 'custom';
|
|
203
|
+
reserveSlot(ctx: SlotReserveContext, abortSignal: AbortSignal): Promise<SlotPermit>;
|
|
204
|
+
tryReserveSlot(ctx: SlotReserveContext): Option<SlotPermit>;
|
|
205
|
+
markSlotUsed(ctx: SlotMarkUsedContext<SI>): void;
|
|
206
|
+
releaseSlot(ctx: SlotReleaseContext<SI>): void;
|
|
207
|
+
}
|
|
208
|
+
export type SlotInfo = {
|
|
209
|
+
type: 'workflow';
|
|
210
|
+
workflowType: string;
|
|
211
|
+
isSticky: boolean;
|
|
212
|
+
} | {
|
|
213
|
+
type: 'activity';
|
|
214
|
+
activityType: string;
|
|
215
|
+
} | {
|
|
216
|
+
type: 'local-activity';
|
|
217
|
+
activityType: string;
|
|
218
|
+
} | {
|
|
219
|
+
type: 'nexus';
|
|
220
|
+
service: string;
|
|
221
|
+
operation: string;
|
|
222
|
+
};
|
|
223
|
+
export interface SlotReserveContext {
|
|
224
|
+
slotType: SlotInfo['type'];
|
|
225
|
+
taskQueue: string;
|
|
226
|
+
workerIdentity: string;
|
|
227
|
+
workerDeploymentVersion: Option<WorkerDeploymentVersion>;
|
|
228
|
+
isSticky: boolean;
|
|
229
|
+
}
|
|
230
|
+
export interface SlotMarkUsedContext<SI extends SlotInfo> {
|
|
231
|
+
slotInfo: SI;
|
|
232
|
+
permit: SlotPermit;
|
|
233
|
+
}
|
|
234
|
+
export interface SlotReleaseContext<SI extends SlotInfo> {
|
|
235
|
+
slotInfo: Option<SI>;
|
|
236
|
+
permit: SlotPermit;
|
|
237
|
+
}
|
|
238
|
+
export interface SlotPermit {
|
|
239
|
+
}
|
|
240
|
+
export declare function newReplayWorker(runtime: Runtime, workerOptions: WorkerOptions): [Worker, HistoryPusher];
|
|
241
|
+
export declare function pushHistory(pusher: HistoryPusher, workflowId: string, history: Buffer): Promise<void>;
|
|
242
|
+
export declare function closeHistoryStream(pusher: HistoryPusher): void;
|
|
243
|
+
export interface HistoryPusher {
|
|
244
|
+
type: 'history-pusher';
|
|
245
|
+
}
|
|
246
|
+
export declare function newEphemeralServer(runtime: Runtime, config: EphemeralServerConfig): Promise<EphemeralServer>;
|
|
247
|
+
export declare function ephemeralServerGetTarget(server: EphemeralServer): string;
|
|
248
|
+
export declare function ephemeralServerShutdown(server: EphemeralServer): Promise<void>;
|
|
249
|
+
export interface EphemeralServer {
|
|
250
|
+
type: 'ephemeral-server';
|
|
251
|
+
}
|
|
252
|
+
export type EphemeralServerConfig = TimeSkippingServerConfig | DevServerConfig;
|
|
253
|
+
export interface TimeSkippingServerConfig {
|
|
254
|
+
type: 'time-skipping';
|
|
255
|
+
exe: EphemeralServerExecutableConfig;
|
|
256
|
+
port: Option<number>;
|
|
257
|
+
extraArgs: string[];
|
|
258
|
+
}
|
|
259
|
+
export interface DevServerConfig {
|
|
260
|
+
type: 'dev-server';
|
|
261
|
+
exe: EphemeralServerExecutableConfig;
|
|
262
|
+
namespace: string;
|
|
263
|
+
ip: string;
|
|
264
|
+
port: Option<number>;
|
|
265
|
+
uiPort: Option<number>;
|
|
266
|
+
dbFilename: Option<string>;
|
|
267
|
+
ui: boolean;
|
|
268
|
+
log: DevServerLogConfig;
|
|
269
|
+
extraArgs: string[];
|
|
270
|
+
}
|
|
271
|
+
export interface DevServerLogConfig {
|
|
272
|
+
format: string;
|
|
273
|
+
level: string;
|
|
274
|
+
}
|
|
275
|
+
export type EphemeralServerExecutableConfig = CachedDownloadConfig | ExistingPathConfig;
|
|
276
|
+
export interface CachedDownloadConfig {
|
|
277
|
+
type: 'cached-download';
|
|
278
|
+
downloadDir: Option<string>;
|
|
279
|
+
version: string;
|
|
280
|
+
ttl: number;
|
|
281
|
+
sdkName: string;
|
|
282
|
+
sdkVersion: string;
|
|
283
|
+
}
|
|
284
|
+
export interface ExistingPathConfig {
|
|
285
|
+
type: 'existing-path';
|
|
286
|
+
path: string;
|
|
287
|
+
}
|
|
288
|
+
export declare function getTimeOfDay(): bigint;
|
|
289
|
+
export interface LogEntry {
|
|
290
|
+
target: string;
|
|
291
|
+
message: string;
|
|
292
|
+
timestamp: string;
|
|
293
|
+
level: LogLevel;
|
|
294
|
+
fields: LogEntryMetadata;
|
|
295
|
+
spanContexts: string[];
|
|
296
|
+
}
|
|
297
|
+
type LogLevel = 'TRACE' | 'DEBUG' | 'INFO' | 'WARN' | 'ERROR';
|
|
298
|
+
type LogEntryMetadata = {
|
|
299
|
+
[key: string]: string | number | boolean | LogEntryMetadata;
|
|
300
|
+
};
|
|
301
|
+
export interface MetricMeter {
|
|
302
|
+
type: 'metric-meter';
|
|
303
|
+
}
|
|
304
|
+
export interface MetricCounter {
|
|
305
|
+
type: 'metric-counter';
|
|
306
|
+
}
|
|
307
|
+
export interface MetricHistogram {
|
|
308
|
+
type: 'metric-histogram';
|
|
309
|
+
}
|
|
310
|
+
export interface MetricHistogramF64 {
|
|
311
|
+
type: 'metric-histogram-f64';
|
|
312
|
+
}
|
|
313
|
+
export interface MetricGauge {
|
|
314
|
+
type: 'metric-gauge';
|
|
315
|
+
}
|
|
316
|
+
export interface MetricGaugeF64 {
|
|
317
|
+
type: 'metric-gauge-f64';
|
|
318
|
+
}
|
|
319
|
+
export type MetricAttributes = Record<string, string | number | boolean>;
|
|
320
|
+
export declare function newMetricCounter(runtime: Runtime, name: string, unit: string, description: string): MetricCounter;
|
|
321
|
+
export declare function newMetricHistogram(runtime: Runtime, name: string, unit: string, description: string): MetricHistogram;
|
|
322
|
+
export declare function newMetricHistogramF64(runtime: Runtime, name: string, unit: string, description: string): MetricHistogramF64;
|
|
323
|
+
export declare function newMetricGauge(runtime: Runtime, name: string, unit: string, description: string): MetricGauge;
|
|
324
|
+
export declare function newMetricGaugeF64(runtime: Runtime, name: string, unit: string, description: string): MetricGaugeF64;
|
|
325
|
+
export declare function addMetricCounterValue(counter: MetricCounter, value: number, attrs: JsonString<MetricAttributes>): void;
|
|
326
|
+
export declare function recordMetricHistogramValue(histogram: MetricHistogram, value: number, attrs: JsonString<MetricAttributes>): void;
|
|
327
|
+
export declare function recordMetricHistogramF64Value(histogram: MetricHistogramF64, value: number, attrs: JsonString<MetricAttributes>): void;
|
|
328
|
+
export declare function setMetricGaugeValue(gauge: MetricGauge, value: number, attrs: JsonString<MetricAttributes>): void;
|
|
329
|
+
export declare function setMetricGaugeF64Value(gauge: MetricGaugeF64, value: number, attrs: JsonString<MetricAttributes>): void;
|
|
330
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.js","sourceRoot":"","sources":["../ts/native.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temporalio/core-bridge",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "Temporal.io SDK Core<>Node bridge",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"author": "Temporal Technologies Inc. <sdk@temporal.io>",
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@
|
|
25
|
+
"@grpc/grpc-js": "^1.12.4",
|
|
26
|
+
"@temporalio/common": "1.12.0",
|
|
26
27
|
"arg": "^5.0.2",
|
|
27
28
|
"cargo-cp-artifact": "^0.1.8",
|
|
28
29
|
"which": "^4.0.0"
|
|
@@ -36,6 +37,9 @@
|
|
|
36
37
|
"directory": "packages/core-bridge"
|
|
37
38
|
},
|
|
38
39
|
"homepage": "https://github.com/temporalio/sdk-typescript/tree/main/packages/core-bridge",
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">= 18.0.0"
|
|
42
|
+
},
|
|
39
43
|
"files": [
|
|
40
44
|
"scripts",
|
|
41
45
|
"src",
|
|
@@ -52,5 +56,5 @@
|
|
|
52
56
|
"publishConfig": {
|
|
53
57
|
"access": "public"
|
|
54
58
|
},
|
|
55
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "8757698f4d722f392e4d606a215e84c32420aa25"
|
|
56
60
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -4,8 +4,14 @@
|
|
|
4
4
|
CLI_VERSION_OVERRIDE = "v1.3.1-priority.0"
|
|
5
5
|
|
|
6
6
|
[alias]
|
|
7
|
-
integ-test = ["
|
|
7
|
+
integ-test = ["test", "--features", "temporal-sdk-core-protos/serde_serialize", "--package", "temporal-sdk-core", "--test", "integ_runner", "--"]
|
|
8
8
|
lint = ["clippy", "--workspace", "--examples", "--all-features",
|
|
9
|
-
"--test", "integ_tests", "--test", "heavy_tests", "--", "
|
|
9
|
+
"--test", "integ_tests", "--test", "heavy_tests", "--test", "manual_tests",
|
|
10
|
+
"--", "--D", "warnings"]
|
|
11
|
+
lint-fix = ["clippy", "--workspace", "--examples", "--all-features",
|
|
12
|
+
"--test", "integ_tests", "--test", "heavy_tests", "--test", "manual_tests",
|
|
13
|
+
"--fix", "--allow-dirty"]
|
|
10
14
|
test-lint = ["clippy", "--all", "--all-features", "--examples", "--workspace",
|
|
11
15
|
"--tests", "--", "--D", "warnings"]
|
|
16
|
+
test-lint-fix = ["clippy", "--all", "--all-features", "--examples", "--workspace",
|
|
17
|
+
"--tests", "--fix", "--allow-dirty"]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
# Use this script during manual testing against a server to run multiple instances
|
|
4
|
+
# of a test, thus acting like multiple workers are running concurrently
|
|
5
|
+
|
|
6
|
+
# Usage: multi-worker-heavy-test <number of workers> <integ test name>
|
|
7
|
+
|
|
8
|
+
# You may want to set env vars for targeting cloud first, ex (fish syntax):
|
|
9
|
+
# set -gx TEMPORAL_SERVICE_ADDRESS "https://sj-poller-test.e2e.tmprl-test.cloud:7233"
|
|
10
|
+
# set -gx TEMPORAL_USE_TLS 1
|
|
11
|
+
# set -gx TEMPORAL_NAMESPACE sj-poller-test.e2e
|
|
12
|
+
|
|
13
|
+
cargo integ-test -c "--release" -t manual_tests --just-build
|
|
14
|
+
|
|
15
|
+
parallel --line-buffer --process-slot-var=PAR_JOBNUM -j $1 cargo integ-test -c "--release" -s external -t manual_tests -- --nocapture $2 ::: $(seq 1 $1)
|
|
@@ -11,7 +11,7 @@ concurrency:
|
|
|
11
11
|
cancel-in-progress: true
|
|
12
12
|
|
|
13
13
|
jobs:
|
|
14
|
-
build-and-
|
|
14
|
+
build-and-lint:
|
|
15
15
|
name: "Format, docs, and lint"
|
|
16
16
|
timeout-minutes: 10
|
|
17
17
|
runs-on: ubuntu-latest
|
|
@@ -21,7 +21,7 @@ jobs:
|
|
|
21
21
|
submodules: recursive
|
|
22
22
|
- uses: dtolnay/rust-toolchain@stable
|
|
23
23
|
with:
|
|
24
|
-
toolchain: 1.
|
|
24
|
+
toolchain: 1.88.0
|
|
25
25
|
- name: Install protoc
|
|
26
26
|
uses: arduino/setup-protoc@v3
|
|
27
27
|
with:
|
|
@@ -56,13 +56,22 @@ jobs:
|
|
|
56
56
|
- uses: actions/checkout@v4
|
|
57
57
|
- uses: dtolnay/rust-toolchain@stable
|
|
58
58
|
with:
|
|
59
|
-
toolchain: 1.
|
|
59
|
+
toolchain: 1.88.0
|
|
60
60
|
- name: Install protoc
|
|
61
61
|
uses: arduino/setup-protoc@v3
|
|
62
62
|
with:
|
|
63
63
|
# TODO: Upgrade proto once https://github.com/arduino/setup-protoc/issues/99 is fixed
|
|
64
64
|
version: '23.x'
|
|
65
65
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
66
|
+
# Workaround for https://github.com/actions/runner-images/issues/12432
|
|
67
|
+
# from https://github.com/rust-lang/rust/issues/141626#issuecomment-2919419236
|
|
68
|
+
# Visual Studio bug tracker https://developercommunity.visualstudio.com/t/Regression-from-1943:-linkexe-crashes/10912960
|
|
69
|
+
- name: Setup RUSTFLAGS (Windows)
|
|
70
|
+
if: runner.os == 'Windows'
|
|
71
|
+
uses: actions/github-script@v7
|
|
72
|
+
with:
|
|
73
|
+
script: |
|
|
74
|
+
core.exportVariable('RUSTFLAGS', '-Csymbol-mangling-version=v0');
|
|
66
75
|
- uses: Swatinem/rust-cache@v2
|
|
67
76
|
- run: cargo test -- --include-ignored --nocapture
|
|
68
77
|
- uses: actions/upload-artifact@v4
|
|
@@ -76,11 +85,6 @@ jobs:
|
|
|
76
85
|
|
|
77
86
|
integ-tests:
|
|
78
87
|
name: Integ tests
|
|
79
|
-
env:
|
|
80
|
-
TEMPORAL_CLOUD_ADDRESS: https://${{ vars.TEMPORAL_CLIENT_NAMESPACE }}.tmprl.cloud:7233
|
|
81
|
-
TEMPORAL_CLOUD_NAMESPACE: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}
|
|
82
|
-
TEMPORAL_CLIENT_CERT: ${{ secrets.TEMPORAL_CLIENT_CERT }}
|
|
83
|
-
TEMPORAL_CLIENT_KEY: ${{ secrets.TEMPORAL_CLIENT_KEY }}
|
|
84
88
|
timeout-minutes: 20
|
|
85
89
|
strategy:
|
|
86
90
|
fail-fast: false
|
|
@@ -100,7 +104,7 @@ jobs:
|
|
|
100
104
|
- uses: actions/checkout@v4
|
|
101
105
|
- uses: dtolnay/rust-toolchain@stable
|
|
102
106
|
with:
|
|
103
|
-
toolchain: 1.
|
|
107
|
+
toolchain: 1.88.0
|
|
104
108
|
- name: Install protoc
|
|
105
109
|
uses: arduino/setup-protoc@v3
|
|
106
110
|
with:
|
|
@@ -111,6 +115,31 @@ jobs:
|
|
|
111
115
|
- uses: Swatinem/rust-cache@v2
|
|
112
116
|
- run: cargo integ-test
|
|
113
117
|
|
|
118
|
+
cloud-tests:
|
|
119
|
+
if: github.event.pull_request.head.repo.full_name == '' || github.event.pull_request.head.repo.full_name == 'temporalio/sdk-core'
|
|
120
|
+
name: Cloud tests
|
|
121
|
+
env:
|
|
122
|
+
TEMPORAL_CLOUD_ADDRESS: https://${{ vars.TEMPORAL_CLIENT_NAMESPACE }}.tmprl.cloud:7233
|
|
123
|
+
TEMPORAL_NAMESPACE: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}
|
|
124
|
+
TEMPORAL_CLIENT_CERT: ${{ secrets.TEMPORAL_CLIENT_CERT }}
|
|
125
|
+
TEMPORAL_CLIENT_KEY: ${{ secrets.TEMPORAL_CLIENT_KEY }}
|
|
126
|
+
timeout-minutes: 20
|
|
127
|
+
runs-on: ubuntu-latest
|
|
128
|
+
steps:
|
|
129
|
+
- uses: actions/checkout@v4
|
|
130
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
131
|
+
with:
|
|
132
|
+
toolchain: 1.88.0
|
|
133
|
+
- name: Install protoc
|
|
134
|
+
uses: arduino/setup-protoc@v3
|
|
135
|
+
with:
|
|
136
|
+
# TODO: Upgrade proto once https://github.com/arduino/setup-protoc/issues/99 is fixed
|
|
137
|
+
version: '23.x'
|
|
138
|
+
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
139
|
+
|
|
140
|
+
- uses: Swatinem/rust-cache@v2
|
|
141
|
+
- run: cargo test --test cloud_tests
|
|
142
|
+
|
|
114
143
|
docker-integ-tests:
|
|
115
144
|
name: Docker integ tests
|
|
116
145
|
env:
|
|
@@ -125,7 +154,7 @@ jobs:
|
|
|
125
154
|
- uses: actions/checkout@v4
|
|
126
155
|
- uses: dtolnay/rust-toolchain@stable
|
|
127
156
|
with:
|
|
128
|
-
toolchain: 1.
|
|
157
|
+
toolchain: 1.88.0
|
|
129
158
|
- name: Install protoc
|
|
130
159
|
uses: arduino/setup-protoc@v3
|
|
131
160
|
with:
|
|
@@ -137,4 +166,4 @@ jobs:
|
|
|
137
166
|
with:
|
|
138
167
|
compose-file: ./docker/docker-compose-ci.yaml
|
|
139
168
|
- uses: Swatinem/rust-cache@v2
|
|
140
|
-
- run: cargo integ-test
|
|
169
|
+
- run: cargo integ-test docker_
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Contributor Guidance for `sdk-core`
|
|
2
|
+
|
|
3
|
+
This repository provides a Rust workspace for the Temporal Core SDK and related crates. Use this
|
|
4
|
+
document as your quick reference when submitting pull requests.
|
|
5
|
+
|
|
6
|
+
## Where Things Are
|
|
7
|
+
|
|
8
|
+
- `core/` – implementation of the core SDK
|
|
9
|
+
- `client/` – clients for communicating with Temporal clusters
|
|
10
|
+
- `core-api/` – API definitions exposed by core
|
|
11
|
+
- `sdk/` – pre-alpha Rust SDK built on top of core (used mainly for tests)
|
|
12
|
+
- `sdk-core-protos/` – protobuf definitions shared across crates
|
|
13
|
+
- `fsm/` – state machine implementation and macros
|
|
14
|
+
- `test-utils/` – helpers and binaries for tests
|
|
15
|
+
- `tests/` – integration, heavy, and manual tests
|
|
16
|
+
- `arch_docs/` – architectural design documents
|
|
17
|
+
- Contributor guide: `README.md`
|
|
18
|
+
|
|
19
|
+
## Repo Specific Utilities
|
|
20
|
+
|
|
21
|
+
- `.cargo/config.toml` defines useful cargo aliases:
|
|
22
|
+
- `cargo lint` – run clippy on workspace crates
|
|
23
|
+
- `cargo test-lint` – run clippy on tests
|
|
24
|
+
- `cargo integ-test` – run the integration test runner
|
|
25
|
+
- `cargo-tokio-console.sh` – run any cargo command with the `tokio-console` feature
|
|
26
|
+
- `integ-with-otel.sh` – run integration tests with OpenTelemetry enabled
|
|
27
|
+
- `.cargo/multi-worker-manual-test` – helper script for spawning multiple workers during manual
|
|
28
|
+
testing
|
|
29
|
+
|
|
30
|
+
## Building and Testing
|
|
31
|
+
|
|
32
|
+
The following commands are enforced for each pull request (see `README.md`):
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
cargo build # build all crates
|
|
36
|
+
cargo test # run unit tests
|
|
37
|
+
cargo integ-test # integration tests (starts ephemeral server by default)
|
|
38
|
+
cargo test --test heavy_tests # load tests -- agents do not need to run this and should not
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Additional checks:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
cargo fmt --all # format code
|
|
45
|
+
cargo clippy --all -- -D warnings # lint
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Documentation can be generated with `cargo doc`.
|
|
49
|
+
|
|
50
|
+
## Expectations for Pull Requests
|
|
51
|
+
|
|
52
|
+
- Format and lint your code before submitting.
|
|
53
|
+
- Ensure all tests pass locally. Integration tests may require a running Temporal server or the
|
|
54
|
+
ephemeral server started by `cargo integ-test`.
|
|
55
|
+
- Keep commit messages short and in the imperative mood.
|
|
56
|
+
- Provide a clear PR description outlining what changed and why.
|
|
57
|
+
- Reviewers expect new features or fixes to include corresponding tests when applicable.
|
|
58
|
+
|
|
59
|
+
## Review Checklist
|
|
60
|
+
|
|
61
|
+
Reviewers will look for:
|
|
62
|
+
|
|
63
|
+
- All builds, tests, and lints passing in CI
|
|
64
|
+
- New tests covering behavior changes
|
|
65
|
+
- Clear and concise code following existing style (see `README.md` for error handling guidance)
|
|
66
|
+
- Documentation updates for any public API changes
|
|
67
|
+
|
|
68
|
+
## Notes
|
|
69
|
+
|
|
70
|
+
- Fetch workflow histories with `cargo run --bin histfetch <workflow_id> [run_id]` (binary lives in
|
|
71
|
+
`test-utils`).
|
|
72
|
+
- Protobuf files under `sdk-core-protos/protos/api_upstream` are a git subtree; see `README.md` for
|
|
73
|
+
update instructions.
|