Skip to content

Commit 2c78378

Browse files
committed
chore: Support taskExecutionId
Signed-off-by: Javier Aliaga <[email protected]>
1 parent 16374cd commit 2c78378

File tree

4 files changed

+29
-8
lines changed

4 files changed

+29
-8
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.24.2
44

55
require (
66
github.com/dapr/dapr v1.15.5
7-
github.com/dapr/durabletask-go v0.6.5
7+
github.com/dapr/durabletask-go v0.7.3-0.20250705135742-20fd7583dc03
88
github.com/go-chi/chi/v5 v5.1.0
99
github.com/golang/mock v1.6.0
1010
github.com/google/uuid v1.6.0
@@ -16,7 +16,7 @@ require (
1616

1717
require (
1818
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
19-
github.com/dapr/kit v0.15.2 // indirect
19+
github.com/dapr/kit v0.15.3-0.20250616160611-598b032bce69 // indirect
2020
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
2121
github.com/go-logr/logr v1.4.2 // indirect
2222
github.com/go-logr/stdr v1.2.2 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK3
22
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
33
github.com/dapr/dapr v1.15.5 h1:bkCmcQQfaQ5C49P3l0elCzDr4/Oja5kitM3jStY+2RY=
44
github.com/dapr/dapr v1.15.5/go.mod h1:wwopO8AD9CZOgVj4bsdXNmeQujMo0v3MLAqeaX+gb00=
5-
github.com/dapr/durabletask-go v0.6.5 h1:aWcxMfYudojpgRjJRdUr7yyZ7rGcvLtWXUuA4cGHBR0=
6-
github.com/dapr/durabletask-go v0.6.5/go.mod h1:nTZ5fCbJLnZbVdi6Z2YxdDF1OgQZL3LroogGuetrwuA=
7-
github.com/dapr/kit v0.15.2 h1:5H9IhKScU/SpE2Hxvr5vUlmYN1e2MJN15RoT8/KSziU=
8-
github.com/dapr/kit v0.15.2/go.mod h1:HwFsBKEbcyLanWlDZE7u/jnaDCD/tU+n3pkFNUctQNw=
5+
github.com/dapr/durabletask-go v0.7.3-0.20250705135742-20fd7583dc03 h1:/Sl6sJE3jdPh96KfGShshIF0xZlAjN36Buq9mcNFV7Q=
6+
github.com/dapr/durabletask-go v0.7.3-0.20250705135742-20fd7583dc03/go.mod h1:0Ts4rXp74JyG19gDWPcwNo5V6NBZzhARzHF5XynmA7Q=
7+
github.com/dapr/kit v0.15.3-0.20250616160611-598b032bce69 h1:I1Uoy3fn906AZZdG8+n8fHitgY7Wn9c+smz4WQdOy1Q=
8+
github.com/dapr/kit v0.15.3-0.20250616160611-598b032bce69/go.mod h1:6w2Pr38zOAtBn+ld/jknwI4kgMfwanCIcFVnPykdPZQ=
99
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1010
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1111
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=

workflow/activity_context.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ func (wfac *ActivityContext) Context() context.Context {
3636
return wfac.ctx.Context()
3737
}
3838

39+
func (wfac *ActivityContext) GetTaskExecutionID() string {
40+
return wfac.ctx.GetTaskExecutionID()
41+
}
42+
3943
type callActivityOption func(*callActivityOptions) error
4044

4145
type callActivityOptions struct {

workflow/activity_context_test.go

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,17 @@ import (
2828
)
2929

3030
type testingTaskActivityContext struct {
31-
inputBytes []byte
32-
ctx context.Context
31+
inputBytes []byte
32+
ctx context.Context
33+
taskExecutionID string
34+
}
35+
36+
func (t *testingTaskActivityContext) GetTaskID() int32 {
37+
return 0
38+
}
39+
40+
func (t *testingTaskActivityContext) GetTaskExecutionID() string {
41+
return t.taskExecutionID
3342
}
3443

3544
func (t *testingTaskActivityContext) GetInput(v any) error {
@@ -119,3 +128,11 @@ func TestMarshalData(t *testing.T) {
119128
assert.Equal(t, []byte{0x22, 0x74, 0x65, 0x73, 0x74, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22}, out)
120129
})
121130
}
131+
132+
func TestTaskExecutionId(t *testing.T) {
133+
ac := ActivityContext{ctx: &testingTaskActivityContext{ctx: t.Context(), taskExecutionID: "testTaskExecutionID"}}
134+
135+
t.Run("test getTaskExecutionId", func(t *testing.T) {
136+
assert.Equal(t, "testTaskExecutionID", ac.GetTaskExecutionID())
137+
})
138+
}

0 commit comments

Comments
 (0)