feat(packages): detect interrupted upgrades and add --from restore flag#29
Merged
dipto0321 merged 1 commit intoJun 30, 2026
Conversation
Add an upgrade-in-progress sentinel file under <DataDir> that is written after snapshot save and before the first install, then removed by a deferred cleanup. On every nodeup invocation a PersistentPreRunE hook checks for an orphaned sentinel and prints a stderr warning that includes the snapshot path and the resume command. Add `nodeup packages restore --from <path>` so users can replay an interrupted migration by copy-pasting the path printed in the warning. The positional <manager> <version> form continues to work as before. Refs #26
|
✔️ 111d288 - Conventional commits check succeeded. |
15 tasks
dipto0321
added a commit
that referenced
this pull request
Jul 1, 2026
…ep (#33) The CHANGELOG was missing Phase 6 bullets for PRs #28 (QuotePath for paths with spaces), #29 (interrupted-upgrade sentinel + --from restore), and #30 (system-node classifier with warnings). It also had a duplicate `### Added` header from a prior merge and still listed the scripts/issue-workflow.sh script that PR #32 deleted. The README's Project status table said "Phase 1-5 OK" with no mention of Phase 6 cross-platform polish. The Phase 7 status (GoReleaser config + brew/scoop taps + npm wrapper) was also missing. CHANGELOG.md: - Single Added / Changed / Removed block under [Unreleased] (was two Added blocks). - Add Phase 6 bullets: system-node classifier (#30), interrupted- upgrade sentinel + replay (#29), QuotePath for paths with spaces (#28). - Drop the stale `scripts/issue-workflow.sh` bullet; add a Removed entry pointing at the squash-merged PR #32 commit for context. README.md: - Project status table marks Phase 6 complete, with PR refs and a note that Phase 7 (issue #17) is the remaining work blocking the v1.0.0 tag. - Trailing paragraph updated to reflect Phase 6 in the phase order. Refs #18 Co-authored-by: dipto0321 <dipto@local>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an upgrade-in-progress sentinel file written after snapshot save and
removed by deferred cleanup, plus an
--from <path>flag onnodeup packages restoreso users can replay an interrupted migrationby copy-pasting the path printed in the warning. A
PersistentPreRunEon the root command checks for an orphaned sentinel on every
nodeupinvocation and emits a stderr warning with the resume command.
Linked issues
Closes #26
Type of change
fix— see the title; check the matching box below- [ ]
feat- [ ]
docs- [ ]
style- [ ]
refactor- [ ]
perf- [ ]
test- [ ]
build- [ ]
ci- [ ]
chore- [ ]
revertChecklist
fix(platform): subject)make cilocally and it passesdocs/, inline godoc)Scope notes / things reviewers may want to look at
--from <path>flag is mutually exclusive with positional<manager> <version>args. Mixing them returns a Cobra arg-validationerror.
RestoreFromSnapshotreads the snapshot file directly (noconventional-path lookup), so any user-provided JSON file matching
the snapshot schema works — not only files in
<DataDir>/snapshots/.migrateis enabled (skipped on--no-migrateor whencfg.Packages.Migrate = false), since thereplay path only makes sense when a snapshot was taken.
HOME/USERPROFILEto at.TempDir()and clearAPPDATA/XDG_DATA_HOMEso the sentinel helpers don't pollute thedeveloper's real
$HOME. CI does the same on its runners.Screenshots / output