Skip to content

Commit ebc5a36

Browse files
ashraffoudaclaude
andauthored
fix(upgrade): exempt dev from the canary rollout gate (#122)
Dev is not part of canary rollouts — dev envs are updated when code is merged to main. The canary change (#121) started gating dev nodes by safe_to_upgrade / test_farms, which could make a dev node wait instead of tracking latest. Make dev fully exempt: a dev node follows its network `latest` symlink unconditionally (no safe_to_upgrade / test_farms gating) and skips the version-match check. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 0516cc1 commit ebc5a36

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

pkg/upgrade/upgrade.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,12 +294,18 @@ func (u *Upgrader) update(ctx context.Context) error {
294294
targetVer = chainVer.VersionLight
295295
}
296296

297+
isDev := env.RunningMode == environment.RunningDev
298+
297299
// During a canary rollout (safe_to_upgrade == false) the update worker holds the
298300
// network `latest` taglink back at the last GA version, so a freshly bootstrapped
299301
// node comes up on GA and non-canary nodes stay put. Only nodes whose farm is in
300-
// test_farms take part, and they must target the chain (canary) version directly
302+
// test_farms take part, and they must target the chain (canary) version tag directly
301303
// because `latest` no longer points at it.
302-
if !chainVer.SafeToUpgrade && slices.Contains(testFarms, uint32(env.FarmID)) {
304+
//
305+
// dev is not part of canary rollouts: dev envs are updated when code is merged to
306+
// main, so a dev node just follows its network `latest` symlink unconditionally (no
307+
// safe_to_upgrade / test_farms gating, and the version-match check below is skipped).
308+
if !isDev && !chainVer.SafeToUpgrade && slices.Contains(testFarms, uint32(env.FarmID)) {
303309
// retarget the taglink at the chain version, keeping the repo/tags prefix
304310
prefix := remote.Target[:strings.LastIndex(remote.Target, "/")+1]
305311
remote.Target = prefix + targetVer
@@ -314,8 +320,9 @@ func (u *Upgrader) update(ctx context.Context) error {
314320

315321
// the resolved hub version must match the version the chain wants us to run; for a
316322
// non-canary node during a canary this keeps it from moving ahead of the GA `latest`.
323+
// dev skips this check so it always follows `latest`.
317324
remoteVer := remote.Target[strings.LastIndex(remote.Target, "/")+1:]
318-
if env.RunningMode != environment.RunningDev && remoteVer != targetVer {
325+
if !isDev && remoteVer != targetVer {
319326
// nothing to do! `latest` hasn't caught up to the chain version yet
320327
return nil
321328
}

0 commit comments

Comments
 (0)