8000 feat(updates): upgrade page with live steps, and roll back when the new version doesn't start by adeelahmad · Pull Request #262 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(updates): upgrade page with live steps, and roll back when the new version doesn't start - #262

Merged
adeelahmad merged 5 commits into
mainfrom
claude/project-thread-djijxj
Oct 15, 2026
Merged

adeelahmad merged 5 commits into
mainfrom
claude/project-thread-djijxj

Conversation

@adeelahmad
@adeelahmad adeelahmad commented Oct 10, 2026 •
Copy link
Copy Markdown
Owner

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.sh reads install.sh's lines to report the step, and on failure checks out the previous commit and runs install.sh with the new LENS_KEEP_CODE=1, leaving inbox/restore. updates.restore_on_start (first in prepare()) takes that file, checks migrations.status for steps it doesn't know, and restores with the shared backups.restore from #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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests.
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FZXPL8F3sAdGJKYYgrVHxb

@adeelahmad adeelahmad self-assigned this Oct 10, 2026
Base automatically changed from claude/project-thread-k36y5e to main October 10, 2026 19:53
…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
adeelahmad force-pushed the claude/project-thread-djijxj branch from fd8c80b to 3c2ff02 Compare October 10, 2026 20:03
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
Copy link
Copy Markdown
Owner Author

Blocked on a merge conflict with main in nextjs-frontend/components/settings/bodies.tsx, and there are no check runs on the current head. Merging main in will also pick up the 0.7.0 schema version; if #310 hasn't landed yet, set nextjs-frontend/openapi.json's info.version to 0.7.0 so the schema check passes.


Generated by Claude Code

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
@adeelahmad
adeelahmad merged commit 755f298 into main Oct 15, 2026
17 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-djijxj branch October 15, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0