Retain compatible releases and recover failed updates - #88
Merged
Merged
Conversation
| fs.renameSync(app, `${app}-external`); | ||
| fs.symlinkSync(`${app}-external`, app); | ||
| } | ||
| const result = spawnSync("bash", ["-c", '. "$1"; pages_update', "_", path.join(root, "scripts/update.sh")], { env, encoding: "utf8", timeout: 20000 }); |
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.
What
The updater could stop Pages, overwrite its only installed code and leave it down after a copy/load/start failure. Build a complete release, preflight its dependencies and production configuration, then atomically switch the active application symlink while retaining the predecessor and installed service/CLI files. Failed activation, service startup or readiness restores the predecessor and reports a failed update.
Closes #45. The first update converts the legacy application directory; assets and local
.envmove to shared paths outside retained releases. Bootstrap reruns preserve active release code. Self-updating the updater releases its lock before reexec; unmanaged symlinks are refused before changes.Database changes are never reversed automatically. Automatic updates require the already-applied migration 022 baseline, explicit backward-compatible classification for pending migrations, and no unknown applied migrations from a newer release. Other upgrades/downgrades require the documented manual database/code restore procedure. New namespace guard 023 is classified compatible. Releases are retained for operator inspection and must be pruned intentionally.
Validation: 257 unit tests and the full mandatory integration suite pass after combining the runtime, readiness, install-settings and environment fixes. Real shell fixtures inject copy/install/module-load/activation/start/readiness failures and exercise recovery, legacy predecessors, successful retention, updater reexec and unmanaged symlinks; unit tests also cover migration compatibility and refused downgrades. Dependency audit, shell syntax and diff checks pass. The full browser sweep will run in GitHub CI.
Checklist
npm testpassesnpm run test:browserandbash test/run-integration.shpass (integration passed; full browser sweep runs in CI)allow-same-originnever joinsallow-scripts