Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ integ-test = ["test", "--features", "temporal-sdk-core-protos/serde_serialize",
lint = ["clippy", "--workspace", "--examples", "--all-features",
"--test", "integ_tests", "--test", "heavy_tests", "--test", "manual_tests",
"--", "--D", "warnings"]
lint-fix = ["clippy", "--workspace", "--examples", "--all-features",
"--test", "integ_tests", "--test", "heavy_tests", "--test", "manual_tests",
"--fix", "--allow-dirty"]
test-lint = ["clippy", "--all", "--all-features", "--examples", "--workspace",
"--tests", "--", "--D", "warnings"]
test-lint-fix = ["clippy", "--all", "--all-features", "--examples", "--workspace",
"--tests", "--fix", "--allow-dirty"]
10 changes: 5 additions & 5 deletions .github/workflows/per-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.87.0
toolchain: 1.88.0
- name: Install protoc
uses: arduino/setup-protoc@v3
with:
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.87.0
toolchain: 1.88.0
- name: Install protoc
uses: arduino/setup-protoc@v3
with:
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.87.0
toolchain: 1.88.0
- name: Install protoc
uses: arduino/setup-protoc@v3
with:
Expand All @@ -129,7 +129,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.87.0
toolchain: 1.88.0
- name: Install protoc
uses: arduino/setup-protoc@v3
with:
Expand All @@ -154,7 +154,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.87.0
toolchain: 1.88.0
- name: Install protoc
uses: arduino/setup-protoc@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ src/protos/*.rs
# Keep secrets here
/.cloud_certs/
cloud_envs.fish
/.claude/settings.local.json
4 changes: 2 additions & 2 deletions client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ impl ClientHeaders {
if let Some(api_key) = &self.api_key {
// Only if not already present
if !metadata.contains_key("authorization") {
if let Ok(val) = format!("Bearer {}", api_key).parse() {
if let Ok(val) = format!("Bearer {api_key}").parse() {
metadata.insert("authorization", val);
}
}
Expand Down Expand Up @@ -512,7 +512,7 @@ impl ClientOptions {
// up correct on requests while we use TLS. Setting the header directly in our
// interceptor doesn't work since seemingly it is overridden at some point by
// something lower level.
let uri: Uri = format!("https://{}", domain).parse()?;
let uri: Uri = format!("https://{domain}").parse()?;
channel = channel.origin(uri);
}

Expand Down
4 changes: 2 additions & 2 deletions client/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ impl HttpConnectProxyOptions {
// Create CONNECT request
let mut req_build = hyper::Request::builder().method("CONNECT").uri(uri);
if let Some((user, pass)) = &self.basic_auth {
let creds = BASE64_STANDARD.encode(format!("{}:{}", user, pass));
req_build = req_build.header(header::PROXY_AUTHORIZATION, format!("Basic {}", creds));
let creds = BASE64_STANDARD.encode(format!("{user}:{pass}"));
req_build = req_build.header(header::PROXY_AUTHORIZATION, format!("Basic {creds}"));
}
let req = req_build.body(Empty::<Bytes>::new())?;

Expand Down
2 changes: 1 addition & 1 deletion client/src/workflow_handle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ where
pub fn unwrap_success(self) -> T {
match self {
Self::Succeeded(t) => t,
o => panic!("Expected success, got {:?}", o),
o => panic!("Expected success, got {o:?}"),
}
}
}
Expand Down
9 changes: 3 additions & 6 deletions core-api/src/envconfig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,7 @@ fn apply_data_source_env_var(

if has_path_env && has_data_env {
return Err(ConfigError::InvalidConfig(format!(
"Cannot specify both {} and {}",
path_var, data_var
"Cannot specify both {path_var} and {data_var}"
)));
}

Expand All @@ -488,8 +487,7 @@ fn apply_data_source_env_var(
.is_some_and(|s| matches!(s, DataSource::Path(_)))
{
return Err(ConfigError::InvalidConfig(format!(
"Cannot specify {0} data via {1} when {0} path is already specified",
name, data_var
"Cannot specify {name} data via {data_var} when {name} path is already specified"
)));
}
*dest = Some(DataSource::Data(
Expand All @@ -501,8 +499,7 @@ fn apply_data_source_env_var(
.is_some_and(|s| matches!(s, DataSource::Data(_)))
{
return Err(ConfigError::InvalidConfig(format!(
"Cannot specify {0} path via {1} when {0} data is already specified",
name, path_var
"Cannot specify {name} path via {path_var} when {name} data is already specified"
)));
}
*dest = Some(DataSource::Path(env_vars.get(path_var).unwrap().clone()));
Expand Down
6 changes: 3 additions & 3 deletions core/src/telemetry/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,10 +556,10 @@ impl Display for FailureReason {
FailureReason::Nondeterminism => "NonDeterminismError".to_owned(),
FailureReason::Workflow => "WorkflowError".to_owned(),
FailureReason::Timeout => "timeout".to_owned(),
FailureReason::NexusOperation(op) => format!("operation_{}", op),
FailureReason::NexusHandlerError(op) => format!("handler_error_{}", op),
FailureReason::NexusOperation(op) => format!("operation_{op}"),
FailureReason::NexusHandlerError(op) => format!("handler_error_{op}"),
};
write!(f, "{}", str)
write!(f, "{str}")
}
}
impl From<WorkflowTaskFailedCause> for FailureReason {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,7 @@ impl StartCommandCreated {
) -> ChildWorkflowMachineTransition<Cancelled> {
state.cancelled_before_sent = true;
ChildWorkflowMachineTransition::commands(vec![ChildWorkflowCommand::StartCancel(Failure {
message: format!(
"Child Workflow Execution cancelled before scheduled: {}",
reason
),
message: format!("Child Workflow Execution cancelled before scheduled: {reason}"),
cause: Some(Box::new(Failure {
failure_info: Some(FailureInfo::CanceledFailureInfo(
failure::CanceledFailureInfo {
Expand Down
2 changes: 1 addition & 1 deletion core/src/worker/workflow/machines/update_state_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl UpdateMachine {
msg: UpdateMsg,
) -> Result<MachineResponse, WFMachinesError> {
let accept_body = msg.pack().map_err(|e| {
WFMachinesError::Fatal(format!("Failed to serialize update response: {:?}", e))
WFMachinesError::Fatal(format!("Failed to serialize update response: {e:?}"))
})?;
Ok(MachineResponse::IssueNewMessage(ProtocolMessage {
id: outgoing_id.clone(),
Expand Down
8 changes: 2 additions & 6 deletions core/src/worker/workflow/machines/workflow_machines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,15 +512,11 @@ impl WorkflowMachines {
self.last_processed_event -= 2;
// Then, we have to drop any state machines (which should only be one workflow task machine)
// we may have created when servicing the speculative task.
// Remove when https://github.com/rust-lang/rust/issues/59618 is stable
let remove_these: Vec<_> = self
.machines_by_event_id
.iter()
.filter(|(mid, _)| **mid > self.last_processed_event)
.map(|(mid, mkey)| (*mid, *mkey))
.extract_if(|mid, _| *mid > self.last_processed_event)
.collect();
for (mid, mkey) in remove_these {
self.machines_by_event_id.remove(&mid);
for (_, mkey) in remove_these {
self.all_machines.remove(mkey);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/integ_tests/metrics_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ async fn docker_metrics_with_prometheus(
.starts_with(test_name)
);
} else {
panic!("Invalid Prometheus response: {:?}", response);
panic!("Invalid Prometheus response: {response:?}");
}
}

Expand Down
6 changes: 3 additions & 3 deletions tests/integ_tests/worker_versioning_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ async fn sets_deployment_info_on_task_responses(#[values(true, false)] use_defau
.set_worker_deployment_current_version(SetWorkerDeploymentCurrentVersionRequest {
namespace: client.namespace().to_owned(),
deployment_name: deploy_name.clone(),
version: format!("{}.1.0", deploy_name),
version: format!("{deploy_name}.1.0"),
conflict_token: desc_resp.conflict_token,
..Default::default()
})
Expand Down Expand Up @@ -135,7 +135,7 @@ async fn sets_deployment_info_on_task_responses(#[values(true, false)] use_defau
{
assert_eq!(
wft_complete.worker_deployment_version,
format!("{}.1.0", deploy_name)
format!("{deploy_name}.1.0")
);
}
}
Expand Down Expand Up @@ -198,7 +198,7 @@ async fn activity_has_deployment_stamp() {
.set_worker_deployment_current_version(SetWorkerDeploymentCurrentVersionRequest {
namespace: client.namespace().to_owned(),
deployment_name: deploy_name.clone(),
version: format!("{}.1.0", deploy_name),
version: format!("{deploy_name}.1.0"),
conflict_token: desc_resp.conflict_token,
..Default::default()
})
Expand Down
2 changes: 1 addition & 1 deletion tests/integ_tests/workflow_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async fn parallel_workflows_same_queue() {
});
for i in 0..25 {
core.submit_wf(
format!("{}-{}", wf_name, i),
format!("{wf_name}-{i}"),
wf_name,
vec![],
starter.workflow_options.clone(),
Expand Down
2 changes: 1 addition & 1 deletion tests/integ_tests/workflow_tests/local_activities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ async fn long_local_activity_with_update(
let replay_worker = init_core_replay_preloaded(
starter.get_task_queue(),
[HistoryForReplay::new(
history_from_proto_binary(&format!("histories/{}_history.bin", wf_name))
history_from_proto_binary(&format!("histories/{wf_name}_history.bin"))
.await
.unwrap(),
"fake".to_owned(),
Expand Down
Loading