Skip to content

test(hosts): upgrade a real 0.7.1 daemon through the compatible path - #522

Merged
andrebrait merged 1 commit into
mainfrom
test/v071-daemon-upgrade
Nov 17, 2026
Merged

andrebrait merged 1 commit into
mainfrom
test/v071-daemon-upgrade

Conversation

@andrebrait

@andrebrait andrebrait commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Adds a real v0.7.1 daemon (link protocol 12, same as current) to lib/hosts/v10-upgrade.integration.test.mjs, for both the separate and shared install layouts.

  • The hub welcomes it normally (online, not upgrade-only).
  • The update starts through POST /api/hosts/<id>/updates, the route a GUI click uses. A stale shared install is refused there with 409 host_update_blocked.
  • The 0.7.1 daemon's own updater installs or restarts, and the host comes back at the repo version with link 12.
  • Asserts backup kept (separate), no reinstall (shared), exactly one daemon after the update, and an untouched sessions directory. The last two now also run for v10/v11.

No production code changed. Run: npx bun test lib/hosts/v10-upgrade.integration.test.mjs (6 pass, about 66 s).

Summary by CodeRabbit

  • Tests
    • Expanded coverage for daemon compatibility, upgrade eligibility, update responses, and preservation of existing sessions during upgrades.

Adds v0.7.1 (link 12, same as this release) to the real-daemon upgrade harness: separate and shared installs. The hub welcomes it online, the update is started through POST /api/hosts/<id>/updates, and the old daemon's own updater installs/restarts it to the current version. Also asserts, for every legacy version, that exactly one daemon survives and the sessions directory is untouched.
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The integration test now covers real v10, v11, and v12 daemons. It verifies protocol-dependent welcome behavior, sends blocked and accepted updates through the HTTP updates route, and checks that the sessions directory remains unchanged after an update.

Changes: Host upgrade integration tests

Layer / File(s) Summary
Daemon setup and compatibility assertions
lib/hosts/v10-upgrade.integration.test.mjs
The test adds a pinned v12 daemon and checks its online welcome path alongside the upgrade-only path for older daemons. It adds v12 update scenarios and adjusts welcome-frame assertions.
HTTP updates and post-update checks
lib/hosts/v10-upgrade.integration.test.mjs
The test dispatches update requests through the host updates route. It checks the 409 blocked response, the 202 accepted response, remaining host processes, and unchanged session snapshots.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Possibly related PRs

  • ompweb-dev/ompweb#492: Adds the maintenance and update contract exercised by the v12 daemon test.
  • ompweb-dev/ompweb#495: Routes host updates through the maintenance API and defines the blocked shared-install update behavior checked by this test.
Merge Risk: Minimal · up to 71746

This change adds integration test coverage for upgrading from a v0.7.1 daemon and routes update requests through the HTTP route. It does not alter production behavior, and no merge-blocking risk was found.

Security architecture risk: Minimal · up to 71746

The change expands upgrade-test coverage without changing production access controls, installation behavior, or deployment configuration. No introduced or worsened architecture-level security risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "test(hosts): upgrade a real 0.7.1 daemon through the compatible path" matches the main change. The PR adds a real v0.7.1 daemon (link protocol 12) to the v10 upgrade integration test, check…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "test(hosts): upgrade a real 0.7.1 daemon through the compatible path" matches the main change. The PR adds a real v0.7.1 daemon (link protocol 12) to the v10 upgrade integration test, checks that it connects online and updates through the compatible path, and checks the 409 host_update_blocked case. The title omits the sessions-directory and single-daemon assertions, which is acceptable because it names the primary change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 55a3fdc9-bf15-4b94-bb23-06c1f8c301d4
Commits

Reviewing files that changed from the base of the PR and between 00310fb and 71746ba.

Files selected for processing: 1

  • lib/hosts/v10-upgrade.integration.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@andrebrait
andrebrait merged commit 8efbd9b into main Nov 17, 2026
5 checks passed
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.

1 participant