Skip to content

Commit 9ef7069

Browse files
authored
Add flag to restore activity options to reset and update (#593)
<!-- Describe what has changed in this PR --> **What changed?** Add flags to activity reset/activity update-options requests to support "restore original options" behaviour. <!-- Tell your future self why have you made these changes --> **Why?** They will help users to "reset" their changes. <!-- Are there any breaking changes on binary or code level? --> **Breaking changes** No
1 parent e11b55a commit 9ef7069

File tree

3 files changed

+42
-7
lines changed

3 files changed

+42
-7
lines changed

openapi/openapiv2.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7453,6 +7453,10 @@
74537453
"jitter": {
74547454
"type": "string",
74557455
"title": "If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration.\n(unless it is paused and keep_paused is set)"
7456+
},
7457+
"restoreOriginalOptions": {
7458+
"type": "boolean",
7459+
"description": "If set, the activity options will be restored to the defaults.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event."
74567460
}
74577461
}
74587462
},
@@ -8190,6 +8194,10 @@
81908194
"type": {
81918195
"type": "string",
81928196
"description": "Update all running activities of this type."
8197+
},
8198+
"restoreOriginal": {
8199+
"type": "boolean",
8200+
"description": "If set, the activity options will be restored to the default.\nDefault options are then options activity was created with.\nThey are part of the first SCHEDULE event.\nThis flag cannot be combined with any other option; if you supply\nrestore_original together with other options, the request will be rejected."
81938201
}
81948202
}
81958203
},

openapi/openapiv3.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9740,6 +9740,12 @@ components:
97409740
description: |-
97419741
If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration.
97429742
(unless it is paused and keep_paused is set)
9743+
restoreOriginalOptions:
9744+
type: boolean
9745+
description: |-
9746+
If set, the activity options will be restored to the defaults.
9747+
Default options are then options activity was created with.
9748+
They are part of the first SCHEDULE event.
97439749
ResetActivityResponse:
97449750
type: object
97459751
properties: {}
@@ -11762,6 +11768,14 @@ components:
1176211768
type:
1176311769
type: string
1176411770
description: Update all running activities of this type.
11771+
restoreOriginal:
11772+
type: boolean
11773+
description: |-
11774+
If set, the activity options will be restored to the default.
11775+
Default options are then options activity was created with.
11776+
They are part of the first SCHEDULE event.
11777+
This flag cannot be combined with any other option; if you supply
11778+
restore_original together with other options, the request will be rejected.
1176511779
UpdateActivityOptionsResponse:
1176611780
type: object
1176711781
properties:

temporal/api/workflowservice/v1/request_response.proto

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,13 +1835,20 @@ message UpdateActivityOptionsRequest {
18351835
// Controls which fields from `activity_options` will be applied
18361836
google.protobuf.FieldMask update_mask = 5;
18371837

1838-
// either activity id or activity type must be provided
1839-
oneof activity {
1840-
// Only activity with this ID will be updated.
1841-
string id = 6;
1842-
// Update all running activities of this type.
1843-
string type = 7;
1844-
}
1838+
// either activity id or activity type must be provided
1839+
oneof activity {
1840+
// Only activity with this ID will be updated.
1841+
string id = 6;
1842+
// Update all running activities of this type.
1843+
string type = 7;
1844+
}
1845+
1846+
// If set, the activity options will be restored to the default.
1847+
// Default options are then options activity was created with.
1848+
// They are part of the first SCHEDULE event.
1849+
// This flag cannot be combined with any other option; if you supply
1850+
// restore_original together with other options, the request will be rejected.
1851+
bool restore_original = 8;
18451852
}
18461853

18471854
message UpdateActivityOptionsResponse {
@@ -1932,6 +1939,12 @@ message ResetActivityRequest {
19321939
// If set, and activity is in backoff, the activity will start at a random time within the specified jitter duration.
19331940
// (unless it is paused and keep_paused is set)
19341941
google.protobuf.Duration jitter = 8;
1942+
1943+
// If set, the activity options will be restored to the defaults.
1944+
// Default options are then options activity was created with.
1945+
// They are part of the first SCHEDULE event.
1946+
bool restore_original_options = 9;
1947+
19351948
}
19361949

19371950
message ResetActivityResponse {

0 commit comments

Comments
 (0)