Refactor updater complexity hotspots - #286
Open
gmmcosta15 wants to merge 11 commits into
Open
Conversation
…ne dead branch can't brick updates
…ter; disown klipper from moonraker (fresh installs); actionable dead-branch status
…nd pre-main review hardening
…ne-line all comments and docstrings
…recovery/type bugs
…back, recover CLI exit code, ref path-traversal + apt snapshot temp-leak
…h readiness probe instead of Type=simple is-active
…ts so a deleted current branch no longer aborts the whole update
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.
Description
Select the type:
Extract-method pass over the updater module to drop every radon complexity hotspot below grade C, plus correctness fixes and one feature surfaced during review and on-device testing. Behavior-preserving except the fixes/feature noted below.
Refactor
All updater modules now grade C or below.
Bug fixes
Feature
is-active. New optional health_url component field (validated to loopback http); _restart_one/_provision_restart_service verify health after the service is active. A bad Spoolman update now auto-reverts and a bad provision removes the clone, instead of both silently reporting success.Motivation
service.py/executor.py had F/E/D-grade functions that were hard to test. Review and on-device testing also caught a corrupt-file crash, in-flight markers that violated crash-recovery retry semantics, a power-fail brick gap, and a weak Type=simple readiness signal that let broken Spoolman installs report success.