@temporalio/core-bridge 1.7.1 → 1.7.3
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 +21 -0
- package/lib/index.d.ts +10 -10
- package/package.json +4 -4
- package/releases/aarch64-apple-darwin/index.node +0 -0
- package/sdk-core/.buildkite/pipeline.yml +1 -1
- package/sdk-core/.cargo/config.toml +2 -0
- package/sdk-core/CODEOWNERS +1 -1
- package/sdk-core/client/src/raw.rs +15 -6
- package/sdk-core/core/Cargo.toml +1 -0
- package/sdk-core/core/src/core_tests/activity_tasks.rs +13 -5
- package/sdk-core/core/src/core_tests/workflow_tasks.rs +45 -77
- package/sdk-core/core/src/internal_flags.rs +132 -46
- package/sdk-core/core/src/worker/activities/activity_task_poller_stream.rs +10 -7
- package/sdk-core/core/src/worker/activities.rs +152 -142
- package/sdk-core/core/src/worker/client.rs +12 -8
- package/sdk-core/core/src/worker/mod.rs +7 -5
- package/sdk-core/core/src/worker/workflow/history_update.rs +733 -33
- package/sdk-core/core/src/worker/workflow/machines/child_workflow_state_machine.rs +1 -1
- package/sdk-core/core/src/worker/workflow/machines/signal_external_state_machine.rs +4 -1
- package/sdk-core/core/src/worker/workflow/machines/workflow_machines.rs +5 -2
- package/sdk-core/core/src/worker/workflow/managed_run/managed_wf_test.rs +1 -1
- package/sdk-core/core/src/worker/workflow/managed_run.rs +0 -4
- package/sdk-core/protos/api_upstream/.github/workflows/publish-docs.yml +23 -0
- package/sdk-core/protos/api_upstream/Makefile +1 -1
- package/sdk-core/protos/api_upstream/buf.yaml +5 -0
- package/sdk-core/protos/api_upstream/temporal/api/common/v1/message.proto +17 -0
- package/sdk-core/protos/api_upstream/temporal/api/enums/v1/failed_cause.proto +2 -0
- package/sdk-core/protos/api_upstream/temporal/api/history/v1/message.proto +6 -3
- package/sdk-core/protos/api_upstream/temporal/api/protocol/v1/message.proto +1 -1
- package/sdk-core/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +12 -22
- package/sdk-core/protos/api_upstream/temporal/api/update/v1/message.proto +2 -2
- package/sdk-core/protos/api_upstream/temporal/api/workflow/v1/message.proto +2 -0
- package/sdk-core/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +145 -48
- package/sdk-core/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +19 -8
- package/sdk-core/sdk/src/workflow_context/options.rs +1 -1
- package/sdk-core/sdk/src/workflow_context.rs +9 -1
- package/sdk-core/test-utils/src/lib.rs +29 -7
- package/sdk-core/tests/integ_tests/activity_functions.rs +5 -0
- package/sdk-core/tests/integ_tests/workflow_tests/activities.rs +2 -4
- package/sdk-core/tests/integ_tests/workflow_tests/determinism.rs +0 -1
- package/sdk-core/tests/integ_tests/workflow_tests/local_activities.rs +5 -7
- package/sdk-core/tests/integ_tests/workflow_tests.rs +3 -7
- package/sdk-core/tests/main.rs +1 -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
|
@@ -22,7 +22,8 @@ use std::{
|
|
|
22
22
|
time::Duration,
|
|
23
23
|
};
|
|
24
24
|
use temporal_client::{
|
|
25
|
-
Client, RetryClient, WorkflowClientTrait, WorkflowExecutionInfo,
|
|
25
|
+
Client, ClientTlsConfig, RetryClient, TlsConfig, WorkflowClientTrait, WorkflowExecutionInfo,
|
|
26
|
+
WorkflowOptions,
|
|
26
27
|
};
|
|
27
28
|
use temporal_sdk::{
|
|
28
29
|
interceptors::{FailOnNondeterminismInterceptor, WorkerInterceptor},
|
|
@@ -34,8 +35,8 @@ use temporal_sdk_core::{
|
|
|
34
35
|
replay::HistoryForReplay,
|
|
35
36
|
ClientOptions, ClientOptionsBuilder, CoreRuntime, WorkerConfig, WorkerConfigBuilder,
|
|
36
37
|
};
|
|
37
|
-
use temporal_sdk_core_api::errors::{PollActivityError, PollWfError};
|
|
38
38
|
use temporal_sdk_core_api::{
|
|
39
|
+
errors::{PollActivityError, PollWfError},
|
|
39
40
|
telemetry::{
|
|
40
41
|
Logger, MetricsExporter, OtelCollectorOptions, TelemetryOptions, TelemetryOptionsBuilder,
|
|
41
42
|
TraceExportConfig, TraceExporter,
|
|
@@ -60,6 +61,7 @@ pub const NAMESPACE: &str = "default";
|
|
|
60
61
|
pub const TEST_Q: &str = "q";
|
|
61
62
|
/// The env var used to specify where the integ tests should point
|
|
62
63
|
pub const INTEG_SERVER_TARGET_ENV_VAR: &str = "TEMPORAL_SERVICE_ADDRESS";
|
|
64
|
+
pub const INTEG_USE_TLS_ENV_VAR: &str = "TEMPORAL_USE_TLS";
|
|
63
65
|
/// This env var is set (to any value) if temporal CLI dev server is in use
|
|
64
66
|
pub const INTEG_TEMPORAL_DEV_SERVER_USED_ENV_VAR: &str = "INTEG_TEMPORAL_DEV_SERVER_ON";
|
|
65
67
|
/// This env var is set (to any value) if the test server is in use
|
|
@@ -533,13 +535,33 @@ pub fn get_integ_server_options() -> ClientOptions {
|
|
|
533
535
|
Err(_) => "http://localhost:7233".to_owned(),
|
|
534
536
|
};
|
|
535
537
|
let url = Url::try_from(&*temporal_server_address).unwrap();
|
|
536
|
-
ClientOptionsBuilder::default()
|
|
537
|
-
|
|
538
|
+
let mut cb = ClientOptionsBuilder::default();
|
|
539
|
+
cb.identity("integ_tester".to_string())
|
|
538
540
|
.target_url(url)
|
|
539
541
|
.client_name("temporal-core".to_string())
|
|
540
|
-
.client_version("0.1.0".to_string())
|
|
541
|
-
|
|
542
|
-
.
|
|
542
|
+
.client_version("0.1.0".to_string());
|
|
543
|
+
if let Some(tls) = get_integ_tls_config() {
|
|
544
|
+
cb.tls_cfg(tls);
|
|
545
|
+
};
|
|
546
|
+
cb.build().unwrap()
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
pub fn get_integ_tls_config() -> Option<TlsConfig> {
|
|
550
|
+
if env::var(INTEG_USE_TLS_ENV_VAR).is_ok() {
|
|
551
|
+
let root = std::fs::read("../.cloud_certs/ca.pem").unwrap();
|
|
552
|
+
let client_cert = std::fs::read("../.cloud_certs/client.pem").unwrap();
|
|
553
|
+
let client_private_key = std::fs::read("../.cloud_certs/client.key").unwrap();
|
|
554
|
+
Some(TlsConfig {
|
|
555
|
+
server_root_ca_cert: Some(root),
|
|
556
|
+
domain: None,
|
|
557
|
+
client_tls_config: Some(ClientTlsConfig {
|
|
558
|
+
client_cert,
|
|
559
|
+
client_private_key,
|
|
560
|
+
}),
|
|
561
|
+
})
|
|
562
|
+
} else {
|
|
563
|
+
None
|
|
564
|
+
}
|
|
543
565
|
}
|
|
544
566
|
|
|
545
567
|
pub fn get_integ_telem_options() -> TelemetryOptions {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
use crate::integ_tests::activity_functions::echo;
|
|
1
2
|
use anyhow::anyhow;
|
|
2
3
|
use assert_matches::assert_matches;
|
|
3
4
|
use futures_util::future::join_all;
|
|
@@ -52,10 +53,7 @@ async fn one_activity() {
|
|
|
52
53
|
let mut worker = starter.worker().await;
|
|
53
54
|
let client = starter.get_client().await;
|
|
54
55
|
worker.register_wf(wf_name.to_owned(), one_activity_wf);
|
|
55
|
-
worker.register_activity(
|
|
56
|
-
"echo_activity",
|
|
57
|
-
|_ctx: ActContext, echo_me: String| async move { Ok(echo_me) },
|
|
58
|
-
);
|
|
56
|
+
worker.register_activity("echo_activity", echo);
|
|
59
57
|
|
|
60
58
|
let run_id = worker
|
|
61
59
|
.submit_wf(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
use crate::integ_tests::activity_functions::echo;
|
|
1
2
|
use anyhow::anyhow;
|
|
2
3
|
use futures::future::join_all;
|
|
3
4
|
use std::{
|
|
@@ -12,9 +13,10 @@ use temporal_sdk::{
|
|
|
12
13
|
use temporal_sdk_core::replay::HistoryForReplay;
|
|
13
14
|
use temporal_sdk_core_protos::{
|
|
14
15
|
coresdk::{
|
|
15
|
-
workflow_commands::workflow_command::Variant,
|
|
16
|
-
workflow_completion,
|
|
17
|
-
workflow_completion::
|
|
16
|
+
workflow_commands::{workflow_command::Variant, ActivityCancellationType},
|
|
17
|
+
workflow_completion,
|
|
18
|
+
workflow_completion::{workflow_activation_completion, WorkflowActivationCompletion},
|
|
19
|
+
AsJsonPayloadExt,
|
|
18
20
|
},
|
|
19
21
|
temporal::api::{common::v1::RetryPolicy, enums::v1::TimeoutType},
|
|
20
22
|
TestHistoryBuilder,
|
|
@@ -25,10 +27,6 @@ use temporal_sdk_core_test_utils::{
|
|
|
25
27
|
};
|
|
26
28
|
use tokio_util::sync::CancellationToken;
|
|
27
29
|
|
|
28
|
-
pub async fn echo(_ctx: ActContext, e: String) -> anyhow::Result<String> {
|
|
29
|
-
Ok(e)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
30
|
pub async fn one_local_activity_wf(ctx: WfContext) -> WorkflowResult<()> {
|
|
33
31
|
let initial_workflow_time = ctx.workflow_time().expect("Workflow time should be set");
|
|
34
32
|
ctx.local_activity(LocalActivityOptions {
|
|
@@ -15,6 +15,7 @@ mod stickyness;
|
|
|
15
15
|
mod timers;
|
|
16
16
|
mod upsert_search_attrs;
|
|
17
17
|
|
|
18
|
+
use crate::integ_tests::activity_functions::echo;
|
|
18
19
|
use assert_matches::assert_matches;
|
|
19
20
|
use futures::{channel::mpsc::UnboundedReceiver, future, SinkExt, StreamExt};
|
|
20
21
|
use std::{
|
|
@@ -26,9 +27,7 @@ use std::{
|
|
|
26
27
|
time::Duration,
|
|
27
28
|
};
|
|
28
29
|
use temporal_client::{WorkflowClientTrait, WorkflowOptions};
|
|
29
|
-
use temporal_sdk::{
|
|
30
|
-
interceptors::WorkerInterceptor, ActContext, ActivityOptions, WfContext, WorkflowResult,
|
|
31
|
-
};
|
|
30
|
+
use temporal_sdk::{interceptors::WorkerInterceptor, ActivityOptions, WfContext, WorkflowResult};
|
|
32
31
|
use temporal_sdk_core::replay::HistoryForReplay;
|
|
33
32
|
use temporal_sdk_core_api::{errors::PollWfError, Worker};
|
|
34
33
|
use temporal_sdk_core_protos::{
|
|
@@ -564,10 +563,7 @@ async fn slow_completes_with_small_cache() {
|
|
|
564
563
|
}
|
|
565
564
|
Ok(().into())
|
|
566
565
|
});
|
|
567
|
-
worker.register_activity(
|
|
568
|
-
"echo_activity",
|
|
569
|
-
|_ctx: ActContext, echo_me: String| async move { Ok(echo_me) },
|
|
570
|
-
);
|
|
566
|
+
worker.register_activity("echo_activity", echo);
|
|
571
567
|
for i in 0..20 {
|
|
572
568
|
worker
|
|
573
569
|
.submit_wf(
|
package/sdk-core/tests/main.rs
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|