Skip to content

Retain compatible releases and recover failed updates - #88

Merged
obsessixnv merged 8 commits into
mainfrom
fix/45-rollback-updates
Sep 15, 2026
Merged

obsessixnv merged 8 commits into
mainfrom
fix/45-rollback-updates

Conversation

@obsessixnv

Copy link
Copy Markdown
Contributor

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 .env move 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 test passes
  • npm run test:browser and bash test/run-integration.sh pass (integration passed; full browser sweep runs in CI)
  • Nothing renders agent HTML on the dashboard origin; allow-same-origin never joins allow-scripts
  • Docs updated where behaviour changed
  • New source files carry the SPDX header
  • No secrets, real customer data, or internal hostnames in the diff

@obsessixnv obsessixnv added enhancement New feature or request audit:2026-09-14 Functional and reliability audit of commit 420bad8; cybersecurity excluded. priority:P2 Normal: correctness, reliability, or supported-workflow failure. size:L Large: roughly 4+ engineering days or migration/rollout work. area:operations Pages operations functionality and maintenance. labels Sep 15, 2026
Comment thread test/update.test.js
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 });
@obsessixnv
obsessixnv merged commit 0bc712c into main Sep 15, 2026
5 checks passed
@obsessixnv
obsessixnv deleted the fix/45-rollback-updates branch September 15, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:operations Pages operations functionality and maintenance. audit:2026-09-14 Functional and reliability audit of commit 420bad8; cybersecurity excluded. enhancement New feature or request priority:P2 Normal: correctness, reliability, or supported-workflow failure. size:L Large: roughly 4+ engineering days or migration/rollout work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P2] Updater removes the working release before validating the replacement and cannot recover automatically

2 participants