The tracker Guest refuses replacement, and the Test Stack still gets destroyed (TR-59) #44
No reviewers
Labels
No labels
needs-info
needs-triage
ready-for-agent
ready-for-human
wontfix
needs-info
needs-triage
ready-for-agent
ready-for-human
review
merge-ready
review
needs-fix
review
needs-human
review
needs-operator
review
needs-review
review
waiting
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
olympus/infra-tracker!44
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "hermes/TR-59-the-tracker-guest-refuses-replacement-an"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements TR-59
Summary
The replacement guard moves into the module as an input, so the root that owns the Guest decides whether it applies, and the throwaway root is the only one that lifts it.
vikunja/guest/main.tfis untouched: the twomovedblocks stay, and prod's root says nothing about the input, so prod's Guest keeps the guard.The ticket's other option — declaring PROD's container in its own root — was not taken: it would duplicate the module's resource and the Test Stack would stop proving prod's shape, which
docs/reference/test-guest.mdrests on.Evidence
A plan of
vikunja/guestthat would replace the Guest stops, and the vmid is in it. Offline, on this head: a scratch copy of the prod root (its ownmain.tf,variables.tf,providers.tf,versions.tf,keys.d, nobackend.tf) holding a state with the Guest at 142, planned with-refresh=falseand a guest map whose vmid is 143:The Test Stack still creates and destroys its Guest. The same plan with the guard lifted — what
test/guest's module call does — proposes the replacement (rc=0), and the teardown's own target,tofu plan -destroy -target=module.guest.proxmox_virtual_environment_container.vikunja, plans1 to destroy(rc=0). The same destroy plan against the guard on is refused (rc=1, same error).The new declarations have teeth.
make env-teston the naive fix (a literalprevent_destroy = truein the module) printsFAIL modules/guest pins the Guest unless its root lifts the guardand exitsrc=2; on this head it printsenv-test: every assertion holds.The floor.
mise exec -- make check→rc=0:env-test: every assertion holds.,Success! The configuration is valid.×3,pool.tftest.hcl ... 1 passed, 0 failed.,edge.tftest.hcl ... 1 passed, 0 failed.Not verified here:
make test-ciitself — it needs thepreProxmox token and a real Guest, and this container holds neither. Theexecutejob on this pull request is that leg.Merge Danger
Door: two-way — the branch adds a
lifecycleline and an input; a revert removes the guard again.Blast Radius: the one module and its two callers
PROD's Guest carries the guard from the next plan onwards, so a change that would replace it now reds the
guestjob on a push to main instead of proposing the replacement. Lifting the guard for a deliberate replacement is an edit to the module call, which is the Operator's act. A Guest removed on the Node walks past the guard either way.infra-secrets'docs/proxmox-credentials.mdcounts three prod Stacks that guard their Guest withprevent_destroy; after this merge the tracker's is a fourth, and that page isinfra-secrets' to update.Review started (round 1/5) on
6e5fa5455b— reading the diff now.olympus/infra-tracker #44 · head
6e5fa54· round 1/5 · the thread's first review (no earlier review object) · axes: standards, specRecommendation: merge
Verdict
No blocker. The change does what TR-59's three acceptance criteria ask, and I reproduced each of them by hand — the refusal on a scratch prod-shaped root, the lifted guard letting the same plan and the same targeted destroy through, and the floor. Two advisories follow; both are advice, neither turns the verdict.
Spec — TR-59, "The tracker Guest refuses replacement, and the Test Guest still gets destroyed"
Spec source: the body links TR-59 (Vikunja task 345, project 3,
Infra Tracker), fetched live this round. Its contract:vikunja/guestthat would replace the Guest stops with the replacement named, and the plan check reports 142~ vm_id = 142 -> 143 # forces replacement,Plan: 1 to add, 1 to change, 1 to destroy., thenError: Resource instance cannot be destroyednamingmodule.guest.proxmox_virtual_environment_container.vikunja, rc=1make test-cistill creates and destroys its Test Guestexecutesuccess in 2m44s; its log carriesguest answering: 10.12.0.248andtest guest destroyedmise exec -- make checkexits 0env-test: every assertion holds., threeSuccess! The configuration is valid.,pool.tftest.hcl … 1 passed,edge.tftest.hcl … 1 passed, rc=0Both bullets of "What to build" are satisfied. The module gained the input with the guard as its default (
modules/guest/variables.tf:55-59, wired atmodules/guest/container.tf:93);test/guestsets it false by name (test/guest/main.tf:33);vikunja/guest/main.tfis untouched — its module call (:3-10) passes no such input, so the default holds, and bothmovedblocks (:15-23) stand.BLOCKER: none · ADVISORY: none.
Standards
Rules read at the head, not from the standing clone:
AGENTS.md(mise exec -- make; no production apply by an agent; the PR body's## Summary/## Evidence/## Merge Danger),docs/adr/index.mdand 0001–0005, and the org records atolympus/workshopmain— 0009 (PROD deploys through a merge) and 0011 (a deploy never destroys or replaces). This change is the implementation of 0011 for this Stack, and the body carries the three required sections. No documented rule is broken.Neither advisory below rests on a written repo rule: no convention covers how tight a text assertion must be, and no convention covers the second page's enumeration. They are general practice, and they are advice.
ADVISORY —
scripts/tests/run.sh:235-240: the new assertions pass on a commented-out guard. The greps are unanchored, so# prevent_destroy = var.prevent_guest_destroysatisfies the first one. Driven in a full copy of the head tree (git archive HEAD): withmodules/guest/container.tf:93commented out, and separately withtest/guest/main.tf:33commented out,scripts/tests/run.shprintsenv-test: every assertion holds.and exits 0 — the guard it names is gone and the floor is green. Deleting either line instead does red it (FAIL modules/guest pins the Guest unless its root lifts the guard, rc=1), so it is a precision gap, not a vacuous test. Smallest fix: anchor bothpass_ifpatterns to a live line —grep -qE '^[[:space:]]*prevent_destroy *= *var\.prevent_guest_destroy'andgrep -qE '^[[:space:]]*prevent_guest_destroy *= *false'.ADVISORY —
docs/reference/test-guest.md:40: the enumeration is now one short. "Everything else is prod's shape … except the address and the pool" predates this change; the Test root now differs from prod in a third way, which the same page introduces at:99-104. Read at:40alone it is stale. Smallest fix: "except the address, the pool and the replacement guard".BLOCKER: none · ADVISORY: 2.
Named, not charged
docs/reference/guest.md:62-63says "Theguestjob on a push to main is that plan, and a change that would take the Guest away reds it." True as written, but the conflict is then visible only after the merge, while org ADR-0011 puts it on the pull request. That gap predates this change — the Guest plan has been push-only since ADR-0005 — and 0011's own "Update when" names it. Not this change's to close, and not charged.infra-secretsdocs/proxmox-credentials.mdsays "three of them also guard the container withprevent_destroy—silo/guest,semaphore/guestandbao/guest"; after this merge it is four. The claim checks out against that page atmaintoday, and the body discloses it as infra-secrets' follow-up. Not charged here.test/guest/pool.tftest.hclproves the pool claim through the module with a mock provider, while the guard is pinned by text greps. That is the repo's stated pattern for "the declarations" (scripts/tests/run.sh:15-17), so it is named, not charged.Verified
refs/pull/44/headresolved to6e5fa5455bd8bf80339054720e072168278b6abc, equal to the dispatch, re-checked withgit ls-remoteimmediately before this review was posted.mise exec -- make checkat head, rc=0 — the log carries every new assertion,tofu fmt -check, all threevalidates, and both plan-only suites.prod), the head'smodules/guestcopied byte-identical (diff -rrc=0), and a state holding the Guest at 142. Planning-refresh=false -var vmid=143:~ vm_id = 142 -> 143 # forces replacement,Plan: 1 to add, 1 to change, 1 to destroy., thenError: Resource instance cannot be destroyednaming the resource, rc=1;prevent_guest_destroy = false→ the same replacement proposed (-/+ … must be replaced), rc=0.tofu plan -destroy -target=module.guest.proxmox_virtual_environment_container.vikunja— the commandcontainer/ci.sh:96-97runs: guard on →Plan: 0 to add, 0 to change, 1 to destroy.then the same refusal, rc=1; guard off → the same plan, rc=0.staticsuccess (11s),executesuccess (2m44s),edge/guestskipped (bothif: github.event_name == 'push'). Theexecutelog readstemplate import: burns/synology:…,Plan: 3 to add, 1 to change, 0 to destroy,Apply complete! Resources: 3 added, 1 changed, 0 destroyed,guest answering: 10.12.0.248,test guest destroyed— the leg the body said it could not run, green.git status --porcelainclean in the review worktree; all probes ran fromcache/scratch/.Could not verify
plantoken, which this host does not hold; theguestjob on the push to main is that leg. My plan ran on a scratch prod-shaped root over a state a mocked apply left behind, which fixes the shape and the vmid but not the live object.guestjob's own red. It isskippedon a pull request by design (checks.yaml:140-142), so "a change that would replace the Guest reds it" rests on the job's wiring (:160-161) plus the refusal I drove above, not on a live run at this head.