feat(configure): surface available mureo/plugin updates + one-click mureo upgrade --all (#239)#240
Merged
Merged
Conversation
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.
Summary
Closes #239. When
mureo configureis running, the dashboard now detects available updates for mureo and any installedmureo-*plugin and offers a one-click upgrade.GET /api/updatesin the background (non-blocking); the menu renders immediately with no indicator.name: installed → latest(in red) and an Update button./api/upgrade, shows progress, and on completion prompts the operator to restartmureo configure(the running server is still on the old code).Design
check_for_updates()runspython -m pip list --outdated --format=jsononsys.executableand filters to mureo/mureo-* (reusing_is_mureo_package/_canonicalisefrommureo/cli/upgrade_cmd.py). This respects the operator's configured package index, so private bridges are checked correctly, and it shares the exact venv/index resolution that the upgrade uses — "update available" and "the upgrade" are consistent by construction. No hand-rolled PEP 440, no extra deps. 60s timeout; any failure degrades tostatus=error, any_update=falseand never raises.run_upgrade_all()derives the list from_discover_all_mureo_packages();_post_upgradeignores the request body entirely (pinned by a test that smuggles{"packages":[...]}and asserts it never reaches pip). Command is a fixed argv[sys.executable, "-m", "pip", "install", "--upgrade", "--", *targets](shell=False,--sentinel).mureois belt-and-braces prepended when discovery hides it (editable installs), matching the CLI.GET /api/updatesis Host-gated (read-only, no CSRF on GET, like/api/about);POST /api/upgradeis CSRF + Host gated like every other POST.JSON shapes
GET /api/updates:{"status":"ok"|"error","any_update":bool,"packages":[{"name","installed","latest"},...]}(only outdated mureo* packages)POST /api/upgrade:{"status":"ok"|"noop"|"error","returncode":int,"packages":[str,...],"output":<pip tail ≤4000 chars>}Test plan
tests/test_web_version_check.py— outdated surfaced, non-mureo filtered out, up-to-date, pip nonzero / timeout / FileNotFound / unparseable-JSON all degrade, mureo-itself includedtests/test_web_upgrade_action.py— server-derived targets, body irrelevant, success/nonzero/timeout/OSError, noop on empty, output cap, mureo force-prepend paritytests/test_web_handlers.py—GET /api/updatesshape + Host gating;POST /api/upgradedispatch + CSRF/Host gating + request-body-ignoredtests/test_web_about.py(button element, JS fetch/POST, i18n en+ja parity)Notes
textContent; the raw pip output tail is not injected into the DOM (a fixed translated message is shown).