Skip to content

Commit cde9f12

Browse files
carlydfSushisourceShahabT
committed
change Version to struct, prevent misconfiguration of VersioningOverride (#579)
_**READ BEFORE MERGING:** All PRs require approval by both Server AND SDK teams before merging! This is why the number of required approvals is "2" and not "1"--two reviewers from the same team is NOT sufficient. If your PR is not approved by someone in BOTH teams, it may be summarily reverted._ What changed? - Make override a one of and add different pinned override types. - Change version from string to struct - Make nil Version represent "send tasks away from versioned workers and to unversioned workers" Why? - To prevent misconfiguration and to expand the override definition to accommodate the new PinnedUntilContinueAsNew behaviors. - Using a string to represent structured data, whose subfields frequently need to be considered separately, is brittle and not good for anyone using it. Struct is better. - "unversioned version" is contradictory, and nil is a nice way to represent that the versioning story of a task queue is no longer in the control of the Deployment whose `RoutingConfig` you are reading. <!-- Are there any breaking changes on binary or code level? --> Variables are being deprecated, but the content of the code is not changing. The idea of "Unset Ramp" having a separate meaning from "0% Ramp" is removed. 0% ramp now is the only way to have "no ramp" / 100% of traffic going to Current Version. Nil `ramping_deployment_version` + non-zero `ramping_version_percentage` is the way to ramp traffic to unversioned workers. The SDK interface for this could look like: ``` deployment := client.GetHandle(deploymentName) // set current to a version deployment.SetCurrentVersion(buildId) -> current set to deploymentName/buildId deployment.UnsetCurrentVersion() -> current set to nil // set current to unversioned deployment.UnsetCurrentVersion() -> current set to nil deployment.SetRampingVersion(buildId, 50) -> ramp set to (deploymentName/buildId, 50) deployment.UnsetRampingVersion() -> ramp set to (nil, 0%) deployment.RampToUnversioned(50) -> set to (nil, 50%) ``` <!-- If this breaks the Server, please provide the Server PR to merge right after this PR was merged. --> **Server PR** --------- Co-authored-by: Spencer Judge <[email protected]> Co-authored-by: Shahab Tajik <[email protected]>
1 parent 4c3944c commit cde9f12

File tree

11 files changed

+1743
-999
lines changed

11 files changed

+1743
-999
lines changed

deployment/v1/message.go-helpers.pb.go

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deployment/v1/message.pb.go

Lines changed: 217 additions & 103 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

history/v1/message.pb.go

Lines changed: 339 additions & 264 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

taskqueue/v1/message.pb.go

Lines changed: 78 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporalproto/openapi/openapiv2.go

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

temporalproto/openapi/openapiv3.go

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

workflow/v1/message.pb.go

Lines changed: 473 additions & 216 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

workflowservice/v1/request_response.pb.go

Lines changed: 397 additions & 282 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

workflowservice/v1/service.pb.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)