You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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]>
// Always present. Specifies which Deployment Version should should receive new workflow
202
-
// executions and tasks of existing unversioned or AutoUpgrade workflows.
203
-
// Can be one of the following:
204
-
// - A Deployment Version identifier in the form "<deployment_name>.<build_id>".
205
-
// - Or, the "__unversioned__" special value, to represent all the unversioned workers (those
206
-
// with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
207
-
// Note: Current Version is overridden by the Ramping Version for a portion of traffic when a ramp
208
-
// is set (see `ramping_version`.)
209
-
stringcurrent_version=1;
210
-
// When present, it means the traffic is being shifted from the Current Version to the Ramping
211
-
// Version.
212
-
// Must always be different from Current Version. Can be one of the following:
213
-
// - A Deployment Version identifier in the form "<deployment_name>.<build_id>".
214
-
// - Or, the "__unversioned__" special value, to represent all the unversioned workers (those
215
-
// with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
222
+
// Specifies which Deployment Version should receive new workflow executions and tasks of
223
+
// existing unversioned or AutoUpgrade workflows.
224
+
// Nil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set) goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.).
225
+
// Note: Current Version is overridden by the Ramping Version for a portion of traffic when ramp percentage
226
+
// is non-zero (see `ramping_deployment_version` and `ramping_version_percentage`).
0 commit comments