Repository navigation
feat(updates): upgrade page with live steps, and roll back when the new version doesn't start - #262
Merged
Merged
Conversation
…ew version doesn't start The Settings → Updates page and banner show each step of an upgrade as the machine goes: back up, download, build, restart, check. If install.sh fails for the new version, the agent checks out the code that ran before and starts it again (LENS_KEEP_CODE=1), and leaves inbox/restore; the previous version restores the backup taken first as it starts, only when the new version had changed the database. Adds the "Email admins about new releases" switch, shown once the server has updates.email. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FZXPL8F3sAdGJKYYgrVHxb
adeelahmad
force-pushed
the
claude/project-thread-djijxj
branch
from
October 10, 2026 20:03
fd8c80b to
3c2ff02
Compare
tick() snapshots the runner's state as cloudflared starts and writes it after; the log reader can snapshot and write the newer state (the error cloudflared printed) in between, and then tick's older write lands last, so the row said no error. Snapshot and write now happen under one lock. Seen as a flaky test_tunnel on the SurrealDB server CI job. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FZXPL8F3sAdGJKYYgrVHxb
Owner
Author
|
Blocked on a merge conflict with main in Generated by Claude Code |
Merged
19 of 20 tasks
updates.restore_on_start now checks the backup with backups.usable and restores it with backups.restore (which takes a before-restore backup, re-applies the schema and reloads settings); migrations.restore and _import are gone. The Updates page links to Settings → Backups instead of listing backups itself. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FZXPL8F3sAdGJKYYgrVHxb
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FZXPL8F3sAdGJKYYgrVHxb
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FZXPL8F3sAdGJKYYgrVHxb
This was referenced Oct 15, 2026
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.
Requested by Adeel · project thread
Description
Before: the upgrade agent (#260) could install a release, but the web app had no page for it, showed no progress beyond "running", and a release that didn't start left Lens down.
After: Settings → Updates (and the admin banner) shows the version, the release notes, a "Back up and install" button, and each step as the machine goes: back up, download, build, restart, check. If the new version doesn't start, the agent goes back to the code that ran before and starts it again; the previous version then restores the backup taken first, but only when the new version had changed the database, so nothing written since is lost otherwise. The page says what happened ("Went back", and what became of the database). Backups themselves live in Settings → Backups, which the page links to. A switch "Email admins about new releases" shows once the server has
updates.email.How:
packaging/host/lens-upgrade.shreads install.sh's lines to report the step, and on failure checks out the previous commit and runsinstall.shwith the newLENS_KEEP_CODE=1, leavinginbox/restore.updates.restore_on_start(first inprepare()) takes that file, checksmigrations.statusfor steps it doesn't know, and restores with the sharedbackups.restorefrom #263. Also fixes a write race in the tunnel status that made a test flaky. Docs:docs/updates.md, "When the new version doesn't start".Tests: the agent runs for real against a local repo with a good and a broken release (
tests/domain/test_upgrade_agent.py); the restore on start (tests/api/test_upgrade_rollback.py); jest covers the steps and rollback text.Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01FZXPL8F3sAdGJKYYgrVHxb