v0.263.2: the undo keeps the probe of the pinned version (R-637)
gates / gates (push) Successful in 25s

Found live on 9202 (romm): .felhom.yml flows into the stack dir on every
catalog sync, so "the old .felhom.yml" saved at update time was already the
new one, and the serving old version was judged with the new probe.

New record applied-meta/.felhom.yml, written whenever a version is pinned
(deploy, adoption, pin advance) and put back by the undo, like
applied-compose.yml. The fixture now places the new file at sync time.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
2026-09-23 11:53:53 +02:00
parent 5d38573a1a
commit 2cd66663f3
7 changed files with 197 additions and 20 deletions
+12 -3
View File
@@ -688,9 +688,14 @@ func (m *Manager) runGuardedUpdate(ctx context.Context, name string) {
}
entry.PrevCompose = filepath.Join(dir, preUpdateComposeFile)
// R-639: the OLD .felhom.yml too — its probe is the one the old version answers.
if md, merr := savePreUpdateMeta(dir); merr != nil {
md, merr := savePreUpdateMeta(dir)
switch {
case md == "":
m.logger.Printf("[WARN] [stacks] update %s: could not keep the previous .felhom.yml (%v) — an undo would check health with the current one", name, merr)
} else {
case merr != nil:
m.logger.Printf("[WARN] [stacks] update %s: %v", name, merr)
entry.PrevMeta = md
default:
entry.PrevMeta = md
}
if applied, aerr := LoadAppliedDefinition(dir); aerr == nil {
@@ -861,8 +866,12 @@ func (m *Manager) pinBack(name, dir string, entry updateJournalEntry) {
}
// restoreDefinition is pinBack WITHOUT removing the copies — the undo's form, so a power cut after it
// can run it again (RecoverUpdates → undoing) and find the copies still there.
// can run it again (RecoverUpdates → undoing) and find the copies still there. It also puts the pinned
// version's .felhom.yml record back (v0.263.2), so the NEXT update's undo probes the right version.
func (m *Manager) restoreDefinition(name, dir string, entry updateJournalEntry) {
if entry.PrevMeta != "" {
m.storeAppliedMetaFrom(name, dir, filepath.Join(entry.PrevMeta, ".felhom.yml"))
}
prevLive, lerr := os.ReadFile(entry.PrevCompose)
if lerr != nil {
m.logger.Printf("[ERROR] [stacks] update %s: cannot read the pre-update compose copy (%v) — the definition could NOT be put back", name, lerr)