Skip to content

Commit 92bf871

Browse files
authored
Rename operation_id to operation_token in Nexus code paths (#944)
1 parent 6560876 commit 92bf871

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

core/src/worker/workflow/machines/nexus_operation_state_machine.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fsm! {
8585
#[derive(Debug, derive_more::Display)]
8686
pub(super) enum NexusOperationCommand {
8787
#[display("Start")]
88-
Start { operation_id: String },
88+
Start { operation_token: String },
8989
#[display("StartSync")]
9090
StartSync,
9191
#[display("CancelBeforeStart")]
@@ -249,7 +249,7 @@ impl ScheduledEventRecorded {
249249
sa: NexusOperationStartedEventAttributes,
250250
) -> NexusOperationMachineTransition<Started> {
251251
NexusOperationMachineTransition::commands([NexusOperationCommand::Start {
252-
operation_id: sa.operation_id,
252+
operation_token: sa.operation_token,
253253
}])
254254
}
255255
}
@@ -478,12 +478,12 @@ impl WFMachinesAdapter for NexusOperationMachine {
478478
.into(),
479479
]
480480
}
481-
NexusOperationCommand::Start { operation_id } => {
481+
NexusOperationCommand::Start { operation_token } => {
482482
vec![
483483
ResolveNexusOperationStart {
484484
seq: self.shared_state.lang_seq_num,
485-
status: Some(resolve_nexus_operation_start::Status::OperationId(
486-
operation_id,
485+
status: Some(resolve_nexus_operation_start::Status::OperationToken(
486+
operation_token,
487487
)),
488488
}
489489
.into(),

sdk-core-protos/protos/local/temporal/sdk/core/workflow_activation/workflow_activation.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,10 @@ message ResolveNexusOperationStart {
343343
// Sequence number as provided by lang in the corresponding ScheduleNexusOperation command
344344
uint32 seq = 1;
345345
oneof status {
346-
// The operation started asynchronously. Contains an ID that can be used to perform
346+
// The operation started asynchronously. Contains a token that can be used to perform
347347
// operations on the started operation by, ex, clients. A `ResolveNexusOperation` job will
348348
// follow at some point.
349-
string operation_id = 2;
349+
string operation_token = 2;
350350
// If true the operation "started" but only because it's also already resolved. A
351351
// `ResolveNexusOperation` job will be in the same activation.
352352
bool started_sync = 3;
@@ -395,4 +395,4 @@ message RemoveFromCache {
395395
WORKFLOW_EXECUTION_ENDING = 10;
396396
}
397397
EvictionReason reason = 2;
398-
}
398+
}

sdk/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,15 +711,15 @@ impl Unblockable for NexusStartResult {
711711
fn unblock(ue: UnblockEvent, od: Self::OtherDat) -> Self {
712712
match ue {
713713
UnblockEvent::NexusOperationStart(_, result) => match *result {
714-
resolve_nexus_operation_start::Status::OperationId(op_id) => {
714+
resolve_nexus_operation_start::Status::OperationToken(op_token) => {
715715
Ok(StartedNexusOperation {
716-
operation_id: Some(op_id),
716+
operation_token: Some(op_token),
717717
unblock_dat: od,
718718
})
719719
}
720720
resolve_nexus_operation_start::Status::StartedSync(_) => {
721721
Ok(StartedNexusOperation {
722-
operation_id: None,
722+
operation_token: None,
723723
unblock_dat: od,
724724
})
725725
}

sdk/src/workflow_context.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -866,10 +866,10 @@ impl StartedChildWorkflow {
866866
}
867867

868868
#[derive(derive_more::Debug)]
869-
#[debug("StartedNexusOperation{{ operation_id: {operation_id:?} }}")]
869+
#[debug("StartedNexusOperation{{ operation_token: {operation_token:?} }}")]
870870
pub struct StartedNexusOperation {
871-
/// The operation id, if the operation started asynchronously
872-
pub operation_id: Option<String>,
871+
/// The operation token, if the operation started asynchronously
872+
pub operation_token: Option<String>,
873873
pub(crate) unblock_dat: NexusUnblockData,
874874
}
875875

tests/integ_tests/workflow_tests/nexus.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ async fn nexus_basic(
6464
})
6565
.await
6666
.unwrap();
67-
assert_eq!(started.operation_id, None);
67+
assert_eq!(started.operation_token, None);
6868
let res = started.result().await;
6969
Ok(res.into())
7070
}

0 commit comments

Comments
 (0)