Skip to content

Commit a3cd3fa

Browse files
authored
Rust / Packages upgrade (#880)
1 parent 6e60111 commit a3cd3fa

File tree

115 files changed

+1058
-982
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+1058
-982
lines changed

.github/workflows/per-pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
submodules: recursive
2222
- uses: dtolnay/rust-toolchain@stable
2323
with:
24-
toolchain: 1.84.0
24+
toolchain: 1.85.0
2525
- name: Install protoc
2626
uses: arduino/setup-protoc@v3
2727
with:
@@ -56,7 +56,7 @@ jobs:
5656
- uses: actions/checkout@v4
5757
- uses: dtolnay/rust-toolchain@stable
5858
with:
59-
toolchain: 1.84.0
59+
toolchain: 1.85.0
6060
- name: Install protoc
6161
uses: arduino/setup-protoc@v3
6262
with:
@@ -100,7 +100,7 @@ jobs:
100100
- uses: actions/checkout@v4
101101
- uses: dtolnay/rust-toolchain@stable
102102
with:
103-
toolchain: 1.84.0
103+
toolchain: 1.85.0
104104
- name: Install protoc
105105
uses: arduino/setup-protoc@v3
106106
with:
@@ -125,7 +125,7 @@ jobs:
125125
- uses: actions/checkout@v4
126126
- uses: dtolnay/rust-toolchain@stable
127127
with:
128-
toolchain: 1.84.0
128+
toolchain: 1.85.0
129129
- name: Install protoc
130130
uses: arduino/setup-protoc@v3
131131
with:

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license-file = "LICENSE.txt"
88

99
[workspace.dependencies]
1010
derive_builder = "0.20"
11-
derive_more = { version = "1.0", features = ["constructor", "display", "from", "into", "debug"] }
11+
derive_more = { version = "2.0", features = ["constructor", "display", "from", "into", "debug"] }
1212
thiserror = "2"
1313
tonic = "0.12"
1414
tonic-build = "0.12"

client/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "temporal-client"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55
authors = ["Spencer Judge <[email protected]>"]
66
license-file = { workspace = true }
77
description = "Clients for interacting with Temporal Clusters"
@@ -28,7 +28,6 @@ hyper = { version = "1.4.1" }
2828
hyper-util = "0.1.6"
2929
opentelemetry = { workspace = true, features = ["metrics"], optional = true }
3030
parking_lot = "0.12"
31-
prost-types = { workspace = true }
3231
slotmap = "1.0"
3332
thiserror = { workspace = true }
3433
tokio = "1.1"

client/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ mod workflow_handle;
1616

1717
pub use crate::{
1818
proxy::HttpConnectProxyOptions,
19-
retry::{CallType, RetryClient, RETRYABLE_ERROR_CODES},
19+
retry::{CallType, RETRYABLE_ERROR_CODES, RetryClient},
2020
};
2121
pub use metrics::{LONG_REQUEST_LATENCY_HISTOGRAM_NAME, REQUEST_LATENCY_HISTOGRAM_NAME};
2222
pub use raw::{CloudService, HealthService, OperatorService, TestService, WorkflowService};
@@ -36,12 +36,12 @@ pub use workflow_handle::{
3636

3737
use crate::{
3838
metrics::{GrpcMetricSvc, MetricsContext},
39-
raw::{sealed::RawClientLike, AttachMetricLabels},
39+
raw::{AttachMetricLabels, sealed::RawClientLike},
4040
sealed::WfHandleClient,
4141
workflow_handle::UntypedWorkflowHandle,
4242
};
43-
use backoff::{exponential, ExponentialBackoff, SystemClock};
44-
use http::{uri::InvalidUri, Uri};
43+
use backoff::{ExponentialBackoff, SystemClock, exponential};
44+
use http::{Uri, uri::InvalidUri};
4545
use parking_lot::RwLock;
4646
use std::{
4747
collections::HashMap,
@@ -53,6 +53,7 @@ use std::{
5353
};
5454
use temporal_sdk_core_api::telemetry::metrics::TemporalMeter;
5555
use temporal_sdk_core_protos::{
56+
TaskToken,
5657
coresdk::IntoPayloadsExt,
5758
grpc::health::v1::health_client::HealthClient,
5859
temporal::api::{
@@ -68,16 +69,15 @@ use temporal_sdk_core_protos::{
6869
update,
6970
workflowservice::v1::{workflow_service_client::WorkflowServiceClient, *},
7071
},
71-
TaskToken,
7272
};
7373
use tonic::{
74+
Code, Status,
7475
body::BoxBody,
7576
client::GrpcService,
7677
codegen::InterceptedService,
7778
metadata::{MetadataKey, MetadataMap, MetadataValue},
7879
service::Interceptor,
7980
transport::{Certificate, Channel, Endpoint, Identity},
80-
Code, Status,
8181
};
8282
use tower::ServiceBuilder;
8383
use url::Url;

client/src/metrics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::{AttachMetricLabels, CallType};
2-
use futures_util::{future::BoxFuture, FutureExt};
2+
use futures_util::{FutureExt, future::BoxFuture};
33
use std::{
44
sync::Arc,
55
task::{Context, Poll},
@@ -9,7 +9,7 @@ use temporal_sdk_core_api::telemetry::metrics::{
99
CoreMeter, Counter, HistogramDuration, MetricAttributes, MetricKeyValue, MetricParameters,
1010
TemporalMeter,
1111
};
12-
use tonic::{body::BoxBody, transport::Channel, Code};
12+
use tonic::{Code, body::BoxBody, transport::Channel};
1313
use tower::Service;
1414

1515
/// The string name (which may be prefixed) for this metric

client/src/proxy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::{
1212
};
1313
use tokio::net::TcpStream;
1414
use tonic::transport::{Channel, Endpoint};
15-
use tower::{service_fn, Service};
15+
use tower::{Service, service_fn};
1616

1717
/// Options for HTTP CONNECT proxy.
1818
#[derive(Clone, Debug)]

client/src/raw.rs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
//! happen.
44
55
use crate::{
6+
Client, ConfiguredClient, InterceptedMetricsSvc, LONG_POLL_TIMEOUT, RequestExt, RetryClient,
7+
TEMPORAL_NAMESPACE_HEADER_KEY, TemporalServiceClient,
68
metrics::{namespace_kv, task_queue_kv},
79
raw::sealed::RawClientLike,
810
worker_registry::{Slot, SlotManager},
9-
Client, ConfiguredClient, InterceptedMetricsSvc, RequestExt, RetryClient,
10-
TemporalServiceClient, LONG_POLL_TIMEOUT, TEMPORAL_NAMESPACE_HEADER_KEY,
1111
};
12-
use futures_util::{future::BoxFuture, FutureExt, TryFutureExt};
12+
use futures_util::{FutureExt, TryFutureExt, future::BoxFuture};
1313
use std::sync::Arc;
1414
use temporal_sdk_core_api::telemetry::metrics::MetricKeyValue;
1515
use temporal_sdk_core_protos::{
@@ -23,10 +23,10 @@ use temporal_sdk_core_protos::{
2323
},
2424
};
2525
use tonic::{
26+
Request, Response, Status,
2627
body::BoxBody,
2728
client::GrpcService,
2829
metadata::{AsciiMetadataValue, KeyAndValueRef},
29-
Request, Response, Status,
3030
};
3131

3232
pub(super) mod sealed {
@@ -1411,29 +1411,33 @@ mod tests {
14111411
#[test]
14121412
fn verify_all_workflow_service_methods_implemented() {
14131413
// This is less work than trying to hook into the codegen process
1414-
let proto_def =
1415-
include_str!("../../sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto");
1414+
let proto_def = include_str!(
1415+
"../../sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto"
1416+
);
14161417
verify_methods(proto_def, ALL_IMPLEMENTED_WORKFLOW_SERVICE_RPCS);
14171418
}
14181419

14191420
#[test]
14201421
fn verify_all_operator_service_methods_implemented() {
1421-
let proto_def =
1422-
include_str!("../../sdk-core-protos/protos/api_upstream/temporal/api/operatorservice/v1/service.proto");
1422+
let proto_def = include_str!(
1423+
"../../sdk-core-protos/protos/api_upstream/temporal/api/operatorservice/v1/service.proto"
1424+
);
14231425
verify_methods(proto_def, ALL_IMPLEMENTED_OPERATOR_SERVICE_RPCS);
14241426
}
14251427

14261428
#[test]
14271429
fn verify_all_cloud_service_methods_implemented() {
1428-
let proto_def =
1429-
include_str!("../../sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/service.proto");
1430+
let proto_def = include_str!(
1431+
"../../sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/service.proto"
1432+
);
14301433
verify_methods(proto_def, ALL_IMPLEMENTED_CLOUD_SERVICE_RPCS);
14311434
}
14321435

14331436
#[test]
14341437
fn verify_all_test_service_methods_implemented() {
1435-
let proto_def =
1436-
include_str!("../../sdk-core-protos/protos/testsrv_upstream/temporal/api/testservice/v1/service.proto");
1438+
let proto_def = include_str!(
1439+
"../../sdk-core-protos/protos/testsrv_upstream/temporal/api/testservice/v1/service.proto"
1440+
);
14371441
verify_methods(proto_def, ALL_IMPLEMENTED_TEST_SERVICE_RPCS);
14381442
}
14391443

client/src/retry.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::{
2-
raw::IsUserLongPoll, Client, IsWorkerTaskLongPoll, NamespacedClient, Result, RetryConfig,
2+
Client, IsWorkerTaskLongPoll, NamespacedClient, Result, RetryConfig, raw::IsUserLongPoll,
33
};
4-
use backoff::{backoff::Backoff, exponential::ExponentialBackoff, Clock, SystemClock};
4+
use backoff::{Clock, SystemClock, backoff::Backoff, exponential::ExponentialBackoff};
55
use futures_retry::{ErrorHandler, FutureRetry, RetryPolicy};
66
use std::{error::Error, fmt::Debug, future::Future, sync::Arc, time::Duration};
77
use tonic::{Code, Request};

client/src/worker_registry/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use parking_lot::RwLock;
66
use slotmap::SlotMap;
7-
use std::collections::{hash_map::Entry::Vacant, HashMap};
7+
use std::collections::{HashMap, hash_map::Entry::Vacant};
88

99
use temporal_sdk_core_protos::temporal::api::workflowservice::v1::PollWorkflowTaskQueueResponse;
1010

core-api/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "temporal-sdk-core-api"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55
authors = ["Spencer Judge <[email protected]>"]
66
license-file = { workspace = true }
77
description = "Interface definitions for the Temporal Core SDK"
@@ -21,7 +21,6 @@ derive_builder = { workspace = true }
2121
derive_more = { workspace = true }
2222
opentelemetry = { workspace = true, optional = true }
2323
prost = { workspace = true }
24-
prost-types = { workspace = true }
2524
serde_json = "1.0"
2625
thiserror = { workspace = true }
2726
tonic = { workspace = true }

core-api/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ use crate::{
1010
worker::WorkerConfig,
1111
};
1212
use temporal_sdk_core_protos::coresdk::{
13+
ActivityHeartbeat, ActivityTaskCompletion,
1314
activity_task::ActivityTask,
1415
nexus::{NexusTask, NexusTaskCompletion},
1516
workflow_activation::WorkflowActivation,
1617
workflow_completion::WorkflowActivationCompletion,
17-
ActivityHeartbeat, ActivityTaskCompletion,
1818
};
1919

2020
/// This trait is the primary way by which language specific SDKs interact with the core SDK.

core-api/src/telemetry/metrics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ impl CustomMetricAttributes for NoOpAttributes {
345345
#[cfg(feature = "otel_impls")]
346346
mod otel_impls {
347347
use super::*;
348-
use opentelemetry::{metrics, KeyValue};
348+
use opentelemetry::{KeyValue, metrics};
349349

350350
impl From<MetricKeyValue> for KeyValue {
351351
fn from(kv: MetricKeyValue) -> Self {

core/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "temporal-sdk-core"
33
version = "0.1.0"
44
authors = ["Spencer Judge <[email protected]>", "Vitaly Arbuzov <[email protected]>"]
5-
edition = "2021"
5+
edition = "2024"
66
license-file = { workspace = true }
77
description = "Library for building new Temporal SDKs"
88
homepage = "https://temporal.io/"
@@ -35,12 +35,12 @@ enum-iterator = "2"
3535
flate2 = { version = "1.0", optional = true }
3636
futures-util = { version = "0.3", default-features = false }
3737
futures-channel = { version = "0.3", default-features = false, features = ["std"] }
38-
governor = "0.7"
38+
governor = "0.8"
3939
http-body-util = { version = "0.1", optional = true }
4040
hyper = { version = "1.2", optional = true }
4141
hyper-util = { version = "0.1", features = ["server", "http1", "http2", "tokio"], optional = true }
42-
itertools = "0.13"
43-
lru = "0.12"
42+
itertools = "0.14"
43+
lru = "0.13"
4444
mockall = "0.13"
4545
opentelemetry = { workspace = true, features = ["metrics"], optional = true }
4646
opentelemetry_sdk = { version = "0.26", features = ["rt-tokio", "metrics"], optional = true }
@@ -52,14 +52,14 @@ pin-project = "1.0"
5252
prometheus = "0.13"
5353
prost = { workspace = true }
5454
prost-types = { version = "0.6", package = "prost-wkt-types" }
55-
rand = "0.8.3"
55+
rand = "0.9"
5656
reqwest = { version = "0.12", features = ["json", "stream", "rustls-tls-native-roots"], default-features = false, optional = true }
5757
ringbuf = "0.4"
5858
serde = "1.0"
5959
serde_json = "1.0"
6060
siphasher = "1.0"
6161
slotmap = "1.0"
62-
sysinfo = { version = "0.32", default-features = false, features = ["system"] }
62+
sysinfo = { version = "0.33", default-features = false, features = ["system"] }
6363
tar = { version = "0.4", optional = true }
6464
thiserror = { workspace = true }
6565
tokio = { version = "1.37", features = ["rt", "rt-multi-thread", "parking_lot", "time", "fs", "process"] }

core/benches/workflow_replay.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use criterion::{criterion_group, criterion_main, Criterion};
1+
use criterion::{Criterion, criterion_group, criterion_main};
22
use futures_util::StreamExt;
33
use std::time::Duration;
44
use temporal_sdk::{WfContext, WorkflowFunction};

core/src/abstractions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use crate::MetricsContext;
66
use std::{
77
fmt::{Debug, Formatter},
88
sync::{
9-
atomic::{AtomicBool, AtomicUsize, Ordering},
109
Arc,
10+
atomic::{AtomicBool, AtomicUsize, Ordering},
1111
},
1212
};
1313
use temporal_sdk_core_api::worker::{

0 commit comments

Comments
 (0)