@@ -200,41 +200,31 @@ def _steps(
200200 * common_health ,
201201 ]
202202 if action == "update" :
203- sandwich_root = (
204- Path (
203+ configured = os .environ .get ("ULYSSES_SANDWICH_ROOT" , "" ).strip ()
204+ if configured :
205+ sandwich_root = Path (configured ).expanduser ().resolve ()
206+ else :
207+ services_root = Path (
205208 os .environ .get ("ULYSSES_MICROSERVICES_ROOT" )
206209 or Path .home () / "Hermes"
207- )
208- / "sandwich"
209- ).resolve ()
210- preflight = sandwich_root / "scripts" / "apply-hermes-maintenance.sh"
211- refresh = sandwich_root / "scripts" / "refresh-hermes-artifacts.sh"
212- if not preflight .is_file ():
213- raise RuntimeJobError ("Sandwich Hermes preflight is unavailable" )
214- steps = [
215- {
216- "label" : "Run Sandwich Hermes preflight" ,
217- "argv" : [str (preflight ), "--check" , "--allow-active" ],
218- "timeout" : 120 ,
219- },
210+ ).expanduser ()
211+ sandwich_root = (services_root / "sandwich" ).resolve ()
212+ sandwich = sandwich_root / "bin" / "sandwich"
213+ if not sandwich .is_file ():
214+ raise RuntimeJobError ("Sandwich Hermes updater is unavailable" )
215+ return [
220216 {
221- "label" : "Back up and update Hermes" ,
222- "argv" : [executable , "update" , "--backup" , "--yes" ],
223- "cwd" : identity ["source_root" ],
224- "timeout" : 1800 ,
217+ "label" : "Update pristine Hermes through Sandwich" ,
218+ "argv" : [
219+ str (sandwich ),
220+ "hermes" ,
221+ "update" ,
222+ "--backup" ,
223+ "--yes" ,
224+ ],
225+ "timeout" : 7200 ,
225226 },
226227 ]
227- if refresh .is_file ():
228- steps .append (
229- {
230- "label" : "Refresh commit-pinned Sandwich artifacts" ,
231- "argv" : [str (refresh )],
232- "environment" : {"HERMES_UPSTREAM_REF" : "origin/main" },
233- "timeout" : 120 ,
234- "allow_failure" : True ,
235- }
236- )
237- return [* steps , * common_health ]
238228 raise RuntimeJobError (f"unsupported Hermes lifecycle action: { action } " )
239229
240230 def create_lifecycle_plan (
@@ -245,7 +235,7 @@ def create_lifecycle_plan(
245235 ) -> tuple [dict [str , Any ], str ]:
246236 if action not in ALLOWED_ACTIONS :
247237 raise RuntimeJobError ("unsupported Hermes lifecycle action" )
248- if not self .adoption_status (report )["current" ]:
238+ if action != "update" and not self .adoption_status (report )["current" ]:
249239 raise RuntimeJobError ("Hermes must be adopted before lifecycle control" )
250240 label = action .capitalize ()
251241 return self .jobs .create_plan (
0 commit comments