Problem
The plan and nodeup.md §10 say: "every step writes to disk BEFORE mutation so an interrupted run can be replayed via nodeup packages restore". Today, internal/cli/upgrade.go calls snapshot BEFORE install and restore AFTER install, but if the process is killed mid-install, the user must know how to invoke restore manually. A first-class replay command and a startup-time "looks like upgrade was interrupted" detection are missing.
Solution
- Add a sentinel file:
<DataDir>/upgrade-in-progress.json written at the start of nodeup upgrade (after snapshot save, before first install), removed at the end.
- On every
nodeup invocation, detect an orphaned sentinel and print:
Detected an interrupted upgrade (snapshot: <mng>-<ver>.json, started: <RFC3339>).
To resume: `nodeup packages restore --manager <mng> --version <ver>`
- Expose
nodeup packages restore --from <snapshot-path> for explicit replay.
Tests
- Write a sentinel in a tempdir, invoke the detector, verify the warning message contains the snapshot path.
- Verify the sentinel is deleted on a successful (mocked) upgrade run.
- CI: Test (ubuntu-latest) must pass.
Linked PRs
Refs #16 (Phase 6 meta-issue)
Problem
The plan and
nodeup.md §10say: "every step writes to disk BEFORE mutation so an interrupted run can be replayed vianodeup packages restore". Today,internal/cli/upgrade.gocalls snapshot BEFORE install and restore AFTER install, but if the process is killed mid-install, the user must know how to invoke restore manually. A first-class replay command and a startup-time "looks like upgrade was interrupted" detection are missing.Solution
<DataDir>/upgrade-in-progress.jsonwritten at the start ofnodeup upgrade(after snapshot save, before first install), removed at the end.nodeupinvocation, detect an orphaned sentinel and print:nodeup packages restore --from <snapshot-path>for explicit replay.Tests
Linked PRs
Refs #16 (Phase 6 meta-issue)