MCPcopy Create free account
hub / github.com/compozy/agh / applyAvailableUpdate

Function applyAvailableUpdate

internal/cli/update.go:109–131  ·  view source on GitHub ↗
(
	cmd *cobra.Command,
	deps commandDeps,
	manager updateManager,
	release *aghupdate.Release,
	record updateRecord,
)

Source from the content-addressed store, hash-verified

107}
108
109func applyAvailableUpdate(
110 cmd *cobra.Command,
111 deps commandDeps,
112 manager updateManager,
113 release *aghupdate.Release,
114 record updateRecord,
115) error {
116 runtime, running, err := resolveUpdateRuntime(deps)
117 if err != nil {
118 return err
119 }
120
121 applied, err := manager.ApplyRelease(cmd.Context(), release)
122 if err != nil {
123 record.Status = string(aghupdate.StatusFailed)
124 record.Message = err.Error()
125 return writeUpdateFailure(cmd, record, err)
126 }
127 if !running {
128 return finishLocalUpdate(cmd, manager, applied, release, record)
129 }
130 return restartDaemonAfterUpdate(cmd, deps, manager, runtime, applied, release, record)
131}
132
133func resolveUpdateRuntime(deps commandDeps) (*runtimeContext, bool, error) {
134 runtime, err := loadRuntimeContext(deps)

Callers 1

runUpdateCommandFunction · 0.85

Calls 6

resolveUpdateRuntimeFunction · 0.85
writeUpdateFailureFunction · 0.85
finishLocalUpdateFunction · 0.85
restartDaemonAfterUpdateFunction · 0.85
ApplyReleaseMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected