fix(planner): do not treat an already-current version as a rollback - #610
Open
ViktorLindgren95 wants to merge 1 commit into
Open
ViktorLindgren95 wants to merge 1 commit into
ViktorLindgren95 wants to merge 1 commit into
Conversation
isRollbackScenario only checked whether the target version had a LastCurrentTime within RollbackMaxVersionAge. A version that is simply current has that timestamp set, so a deployment sitting on its current version was classified as a rollback on every reconcile. It logged the rollback warning, or after the max age elapsed the "Skipping rollback" message, roughly every 10 seconds for as long as the version stayed current. A version that is already current is not a rollback target, so return early in that case. This also stops the configured rollout strategy from being replaced with AllAtOnce when target and current match, which means a gate is no longer skipped in that state.
ViktorLindgren95
requested review from
a team,
eniko-dif and
jlegrone
as code owners
September 19, 2026 19:57
ViktorLindgren95
marked this pull request as draft
September 19, 2026 20:01
Author
|
Moving this to draft while I complete an internal review on my side before signing the CLA. The change itself is ready and tests pass; this is purely a process step, and I'll mark it ready once that's resolved. The analysis in #609 stands independently of this PR, so please feel free to pick the fix up there if it's useful in the meantime. |
ViktorLindgren95
marked this pull request as ready for review
September 19, 2026 20:09
Author
|
Internal review is done on my side, so marking this ready for review. Signing the CLA shortly. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What was changed
isRollbackScenarionow returns early when the target version is already the current version.Why?
Closes #609.
isRollbackScenariodecided a rollback was underway purely fromLastCurrentTimebeing set and recent. A version that is simply current has that timestamp set, so a deployment sitting on its current version was classified as a rollback on every reconcile. WithinRollbackMaxVersionAgeit logged:and once that age elapsed it logged
Skipping rollback: the version's last current time exceeds the max rollback version ageinstead — both roughly every 10 seconds, for as long as the version stayed current. Nothing was actually rolled back:getVersionConfigDiffreaches thecurrent == targetbranch and returnsnil.A version that is already current is not a rollback target, so the check returns
falsein that case.Note on behaviour
This is not purely a logging change, and I would rather call it out than have it found in review.
Previously, when target and current matched,
isRollbackScenarioreturnedtrueand the strategy was replaced withAllAtOnce, which carries no gate — so the gate check ingetVersionConfigDiffwas skipped. With this change the configured strategy and its gate are retained in that state.The case where that is observable: target equals current, a ramp is in flight (
RampingBuildID != ""), and the gate's test workflows have not completed. Previously the ramp reset proceeded because the gate was skipped; now it waits on the gate. I believe returningfalseis the semantically correct answer, since a version that is already current cannot be rolled back to, but I am happy to take a different approach if you would prefer the strategy selection left untouched and only the logging changed.Checklist
Closes [Bug] "Detected rollback scenario" logged on every reconcile for a steady-state current version #609
How was this tested:
Added
TestGetVersionConfigDiff_NoRollbackWhenTargetIsAlreadyCurrentininternal/planner, covering a current version both inside and outsideRollbackMaxVersionAge, asserting that no version config change is produced and that nothing is logged. Without the fix, both cases log.go test ./internal/planner/passes. Across./internal/...the only failure isTestNewDeploymentWithOwnerRef_EnvConfigSDKCompatibility/without_TLSininternal/k8s, which fails identically on a clean checkout ofmainatfde47e73and is unrelated to this change.No.
docs/configuration.mddescribes rollback detection in terms of a target version that was previously current, which this does not change.