Conversation
carlydf
left a comment
There was a problem hiding this comment.
really close! just left a few comments
| // tell new ramping version it's ramping | ||
| rampUpdateArgs := &deploymentspb.SyncVersionStateUpdateArgs{ | ||
| RoutingUpdateTime: updateTime, | ||
| RampingSinceTime: updateTime, |
There was a problem hiding this comment.
RampingSinceTime is a bit weird, because if the ramp % is changing but the ramping version is staying the same, RampingSinceTime will not change, because the time when the version started ramping is still the same.
I would make a variable called newRampingSinceTime and do:
newRampingSinceTime = updateTime // if this version is newly ramping
if prevRampingVersion == newRampingVersion { // this version was already ramping
newRampingSinceTime = d.State.RoutingInfo.RampingVersionUpdateTime
}
| // update local state | ||
| d.State.RoutingInfo.RampingVersion = newRampingVersion | ||
| d.State.RoutingInfo.RampingVersionPercentage = args.Percentage | ||
| d.State.RoutingInfo.RampingVersionUpdateTime = updateTime |
There was a problem hiding this comment.
If the RampingVersion stayed the same, d.State.RoutingInfo.RampingVersionUpdateTime should not change
There was a problem hiding this comment.
possibly update d.State.RoutingInfo.RampingVersionPercentageUpdateTime
There was a problem hiding this comment.
In my latest commit, d.State.RoutingInfo.RampingVersionUpdateTime now works correctly - I have not made the addition to percentage yet due to a opinion I had which I pasted on our slack thread
| if d.State.RoutingInfo.CurrentVersion == d.State.RoutingInfo.RampingVersion { | ||
| d.State.RoutingInfo.RampingVersion = "" | ||
| d.State.RoutingInfo.RampingVersionPercentage = 0 | ||
| d.State.RoutingInfo.RampingVersionUpdateTime = nil |
There was a problem hiding this comment.
this should be updateTime not nil
tests/worker_deployment_test.go
Outdated
| RoutingInfo: &deploymentpb.RoutingInfo{ | ||
| RampingVersion: "", // no ramping info should be set | ||
| RampingVersionPercentage: 0, // no ramping info should be set | ||
| RampingVersionUpdateTime: nil, // no ramping info should be set |
There was a problem hiding this comment.
this should be the same as CurrentVersionUpdateTime, not nil
| RegisterWorkerInDeployment = "register-task-queue-worker" // for Worker Deployment Version wf | ||
| SyncVersionState = "sync-version-state" // for Worker Deployment Version wfs | ||
| SetCurrentVersion = "set-current-version" // for Worker Deployment wfs | ||
| SetRampingVersion = "set-worker-deployment-ramping-version" // for Worker Deployment wfs |
There was a problem hiding this comment.
Nit: maybe make the string be "set-ramping-version" to match "set-current-version" above
| if prevRampingVersion == newRampingVersion { // the version was alread ramping, user changing ramp % | ||
| rampingSinceTime = d.State.RoutingInfo.RampingVersionUpdateTime | ||
| } else { | ||
| rampingSinceTime = timestamppb.New(workflow.Now(ctx)) // version ramping for the first time |
There was a problem hiding this comment.
| rampingSinceTime = timestamppb.New(workflow.Now(ctx)) // version ramping for the first time | |
| rampingSinceTime = routingUpdateTime // version ramping for the first time |
## What changed? <!-- Describe what has changed in this PR --> - Ramping PR for versioning-3.1 - now, if a ramping version becomes current, the ramp will be unset. ## Why? <!-- Tell your future self why have you made these changes --> - Versioning-3.1 ## How did you test it? <!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? --> - Added more functional tests - Existing suite ## Potential risks <!-- Assuming the worst case, what can be broken when deploying this change to production? --> - None, going to feature. ## Documentation <!-- Have you made sure this change doesn't falsify anything currently stated in `docs/`? If significant new behavior is added, have you described that in `docs/`? --> ## Is hotfix candidate? <!-- Is this PR a hotfix candidate or does it require a notification to be sent to the broader community? (Yes/No) --> No
## What changed? <!-- Describe what has changed in this PR --> - Ramping PR for versioning-3.1 - now, if a ramping version becomes current, the ramp will be unset. ## Why? <!-- Tell your future self why have you made these changes --> - Versioning-3.1 ## How did you test it? <!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? --> - Added more functional tests - Existing suite ## Potential risks <!-- Assuming the worst case, what can be broken when deploying this change to production? --> - None, going to feature. ## Documentation <!-- Have you made sure this change doesn't falsify anything currently stated in `docs/`? If significant new behavior is added, have you described that in `docs/`? --> ## Is hotfix candidate? <!-- Is this PR a hotfix candidate or does it require a notification to be sent to the broader community? (Yes/No) --> No
## What changed? <!-- Describe what has changed in this PR --> - Ramping PR for versioning-3.1 - now, if a ramping version becomes current, the ramp will be unset. ## Why? <!-- Tell your future self why have you made these changes --> - Versioning-3.1 ## How did you test it? <!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? --> - Added more functional tests - Existing suite ## Potential risks <!-- Assuming the worst case, what can be broken when deploying this change to production? --> - None, going to feature. ## Documentation <!-- Have you made sure this change doesn't falsify anything currently stated in `docs/`? If significant new behavior is added, have you described that in `docs/`? --> ## Is hotfix candidate? <!-- Is this PR a hotfix candidate or does it require a notification to be sent to the broader community? (Yes/No) --> No
## What changed? <!-- Describe what has changed in this PR --> - Ramping PR for versioning-3.1 - now, if a ramping version becomes current, the ramp will be unset. ## Why? <!-- Tell your future self why have you made these changes --> - Versioning-3.1 ## How did you test it? <!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? --> - Added more functional tests - Existing suite ## Potential risks <!-- Assuming the worst case, what can be broken when deploying this change to production? --> - None, going to feature. ## Documentation <!-- Have you made sure this change doesn't falsify anything currently stated in `docs/`? If significant new behavior is added, have you described that in `docs/`? --> ## Is hotfix candidate? <!-- Is this PR a hotfix candidate or does it require a notification to be sent to the broader community? (Yes/No) --> No
## What changed? <!-- Describe what has changed in this PR --> - Ramping PR for versioning-3.1 - now, if a ramping version becomes current, the ramp will be unset. ## Why? <!-- Tell your future self why have you made these changes --> - Versioning-3.1 ## How did you test it? <!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? --> - Added more functional tests - Existing suite ## Potential risks <!-- Assuming the worst case, what can be broken when deploying this change to production? --> - None, going to feature. ## Documentation <!-- Have you made sure this change doesn't falsify anything currently stated in `docs/`? If significant new behavior is added, have you described that in `docs/`? --> ## Is hotfix candidate? <!-- Is this PR a hotfix candidate or does it require a notification to be sent to the broader community? (Yes/No) --> No
## What changed? <!-- Describe what has changed in this PR --> - Ramping PR for versioning-3.1 - now, if a ramping version becomes current, the ramp will be unset. ## Why? <!-- Tell your future self why have you made these changes --> - Versioning-3.1 ## How did you test it? <!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? --> - Added more functional tests - Existing suite ## Potential risks <!-- Assuming the worst case, what can be broken when deploying this change to production? --> - None, going to feature. ## Documentation <!-- Have you made sure this change doesn't falsify anything currently stated in `docs/`? If significant new behavior is added, have you described that in `docs/`? --> ## Is hotfix candidate? <!-- Is this PR a hotfix candidate or does it require a notification to be sent to the broader community? (Yes/No) --> No
## What changed? <!-- Describe what has changed in this PR --> - Ramping PR for versioning-3.1 - now, if a ramping version becomes current, the ramp will be unset. ## Why? <!-- Tell your future self why have you made these changes --> - Versioning-3.1 ## How did you test it? <!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? --> - Added more functional tests - Existing suite ## Potential risks <!-- Assuming the worst case, what can be broken when deploying this change to production? --> - None, going to feature. ## Documentation <!-- Have you made sure this change doesn't falsify anything currently stated in `docs/`? If significant new behavior is added, have you described that in `docs/`? --> ## Is hotfix candidate? <!-- Is this PR a hotfix candidate or does it require a notification to be sent to the broader community? (Yes/No) --> No
What changed?
Why?
How did you test it?
Potential risks
Documentation
Is hotfix candidate?
No