-
Notifications
You must be signed in to change notification settings - Fork 893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Conflict Tokens to Deployment APIs #7203
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
b0a859a
pull api-go versioning-3.1 branch in this branch
carlydf 957bc26
RegisterTaskQueue + DescribeVersion: versioning-3.1 (#7107)
Shivs11 6fbdc7b
Use new versioning fields (#7119)
ShahabT f983da9
Describe worker deployment in versioning 3.1 (#7127)
Shivs11 36d48a6
Support ramp in Matching (#7126)
ShahabT 56ee4d9
flake + unit tests fix (#7149)
Shivs11 7ff7876
SetWorkerDeploymentCurrentVersion: Versioning-3.1 (#7154)
Shivs11 a1fc7bd
ListWorkerDeployments : Versioning-3.1 (#7173)
Shivs11 3d40535
Worker Deployment Version Drainage Status (#7158)
carlydf e632e81
Address Drainage PR comments: Pass RegisterVersion info to task queue…
carlydf 5be3cbb
ramp - Versioning:3.1 (#7183)
Shivs11 7495272
Pull in rebased API changes and fix build (#7201)
carlydf 7b2b165
add conflict tokens to deployment APIs, no tests
carlydf 93e2946
upgrade to latest api/versioning-3.1 with new build id -> version naming
carlydf a4354e4
pull latest versioning-3.1
carlydf 0c8ec0d
Update Deployment Workflow ID's and accept string version values (#7198)
Shivs11 7de0178
DeleteVersion API implementation (#7187)
carlydf 63c99b9
Use Deployment Version strings in all user-facing APIs (#7219)
ShahabT 4741b54
Rename UpdateWorkerDeploymentVersionMetadata
ShahabT a48cccd
rebase to versioning-3.1
carlydf b740307
rebase to versioning-3.1-merge
carlydf bf73b90
remove unversioned change and fix rebase
carlydf 1754818
remove unchanged files from diff
carlydf 6636405
fix linences and imports
carlydf 816cab6
fix import diff
carlydf e064abc
test conflict token
carlydf 58efe5d
no replace in go.mod
carlydf a312969
Update service/history/workflow/mutable_state_impl.go
ShahabT 94e89d8
Update tests/activity_api_pause_test.go
ShahabT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -200,6 +200,72 @@ func (s *WorkerDeploymentSuite) TestDescribeWorkerDeployment_SetCurrentVersion() | |
}, time.Second*10, time.Millisecond*1000) | ||
} | ||
|
||
func (s *WorkerDeploymentSuite) TestConflictToken_Describe_SetCurrent_SetRamping() { | ||
ctx, cancel := context.WithTimeout(context.Background(), time.Second*15) | ||
defer cancel() | ||
tv := testvars.New(s) | ||
|
||
firstVersion := tv.WithBuildIDNumber(1) | ||
secondVersion := tv.WithBuildIDNumber(2) | ||
|
||
// Start deployment version workflow + worker-deployment workflow. Only one version is stared manually | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: started Also, struggling to understand the comment actually |
||
// to prevent erroring out in the successive DescribeWorkerDeployment call. | ||
go s.pollFromDeployment(ctx, firstVersion) | ||
|
||
var cT []byte | ||
// No current deployment version set. | ||
s.EventuallyWithT(func(t *assert.CollectT) { | ||
a := assert.New(t) | ||
|
||
resp, err := s.FrontendClient().DescribeWorkerDeployment(ctx, &workflowservice.DescribeWorkerDeploymentRequest{ | ||
Namespace: s.Namespace().String(), | ||
DeploymentName: tv.DeploymentSeries(), | ||
}) | ||
a.NoError(err) | ||
a.Equal("", resp.GetWorkerDeploymentInfo().GetRoutingConfig().GetCurrentVersion()) | ||
cT = resp.GetConflictToken() | ||
}, time.Second*10, time.Millisecond*1000) | ||
|
||
// Set first version as current version | ||
_, _ = s.FrontendClient().SetWorkerDeploymentCurrentVersion(ctx, &workflowservice.SetWorkerDeploymentCurrentVersionRequest{ | ||
Namespace: s.Namespace().String(), | ||
DeploymentName: tv.DeploymentSeries(), | ||
Version: firstVersion.DeploymentVersionString(), | ||
ConflictToken: cT, | ||
}) | ||
|
||
s.EventuallyWithT(func(t *assert.CollectT) { | ||
a := assert.New(t) | ||
|
||
resp, err := s.FrontendClient().DescribeWorkerDeployment(ctx, &workflowservice.DescribeWorkerDeploymentRequest{ | ||
Namespace: s.Namespace().String(), | ||
DeploymentName: tv.DeploymentSeries(), | ||
}) | ||
a.NoError(err) | ||
a.Equal(firstVersion.DeploymentVersionString(), resp.GetWorkerDeploymentInfo().GetRoutingConfig().GetCurrentVersion()) | ||
cT = resp.GetConflictToken() | ||
}, time.Second*10, time.Millisecond*1000) | ||
|
||
// Set second version as ramping version | ||
_, _ = s.FrontendClient().SetWorkerDeploymentRampingVersion(ctx, &workflowservice.SetWorkerDeploymentRampingVersionRequest{ | ||
Namespace: s.Namespace().String(), | ||
DeploymentName: tv.DeploymentSeries(), | ||
Version: secondVersion.DeploymentVersionString(), | ||
Percentage: 5, | ||
ConflictToken: cT, | ||
}) | ||
|
||
s.EventuallyWithT(func(t *assert.CollectT) { | ||
a := assert.New(t) | ||
resp, err := s.FrontendClient().DescribeWorkerDeployment(ctx, &workflowservice.DescribeWorkerDeploymentRequest{ | ||
Namespace: s.Namespace().String(), | ||
DeploymentName: tv.DeploymentSeries(), | ||
}) | ||
a.NoError(err) | ||
a.Equal(secondVersion.DeploymentVersionString(), resp.GetWorkerDeploymentInfo().GetRoutingConfig().GetRampingVersion()) | ||
}, time.Second*10, time.Millisecond*1000) | ||
} | ||
|
||
func (s *WorkerDeploymentSuite) TestSetCurrentVersion_Idempotent() { | ||
ctx, cancel := context.WithTimeout(context.Background(), time.Second*15) | ||
defer cancel() | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice test!
maybe we can also have a test that errors out because an invalid conflict token has been passed? Not sure if this is tedious but might confirm if things are fully working or not
not a blocker if you think things are working though