From 70885ab3c4a32a3c6f37e36a414dbb6b1b4499a7 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 14 Oct 2026 02:22:25 +0200 Subject: [PATCH] Share one prefix between the no-move Why's writer and its reader (review of #309, issue 648) --- cmd/mesh-controller/release_plan.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/mesh-controller/release_plan.go b/cmd/mesh-controller/release_plan.go index e7d6586d..f28516fa 100644 --- a/cmd/mesh-controller/release_plan.go +++ b/cmd/mesh-controller/release_plan.go @@ -253,12 +253,16 @@ func gates(p inventory.Plan, edges []inventory.Edge, rollsOut func(string) bool) // noMoveWhy is what a plan says of a module of its tier whose build was made from the source every machine // running it runs (novox/hq issue 280): nothing is sent for it. -const noMoveWhy = "no move: made from the source every machine running it runs" +// noMovePrefix opens it, and is what noMove reads: one prefix for the writer and the reader. +const ( + noMovePrefix = "no move" + noMoveWhy = noMovePrefix + ": made from the source every machine running it runs" +) // noMove is whether the plan marked the module no move and sent it nothing. Read from what the plan says, // so a plan kept before the mark had a name of its own is read the same (novox/hq issue 648). func noMove(s *inventory.PlanModule) bool { - return s != nil && s.FirstAt == nil && s.Gate == nil && strings.HasPrefix(s.Why, "no move") + return s != nil && s.FirstAt == nil && s.Gate == nil && strings.HasPrefix(s.Why, noMovePrefix) } // applied says whether every machine running the module has reported since the module was built.