Self-update: check for and apply newer releases before each run - #3
Merged
Conversation
Mirrors the actual-ai-categorizer model. When auto_update.enabled, each run (before taking the lock) fetches the remote, resolves the target (latest vX.Y.Z tag by default, or a tracked branch), and if it is newer and the tree is clean, optionally verifies the commit signature (fail-closed), checks it out, reinstalls when pyproject.toml changed, and re-execs into the new version so the run uses it. Fully fail-safe: any problem logs and continues on the current version; a failed install rolls back. Skipped off a git clone, on a dirty tree, and on --dry-run. Dependency-injected (run/reexec/env/log) for testability. Adds AutoUpdateConfig, scanfiler/self_update.py, wiring in _run_once, docs in README/config templates, and 21 tests (overall coverage 96%). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The assertion substring-matched a lowercase scanfiler in the repo path, which fails on case-sensitive Linux where the checkout is /home/runner/work/Scanfiler/Scanfiler. Assert the returned repo root contains the scanfiler package instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Adds an opt-in self-update feature modeled on actual-ai-categorizer's.
Behavior
When
auto_update.enabled: true, each run (before taking the lock, so a re-exec can't deadlock on it) does:git fetchthe remote, resolve the target: newestvX.Y.Ztag (ref: latest-release, default) or a tracked branch.pyproject.tomlchanged, and re-exec into the new version so this run uses it.--dry-run. Inloopmode it checks each cycle (sentinel env var prevents an update loop).Notes
git clone+pip install -e .), not a wheel.AutoUpdateConfigadded to config.🤖 Generated with Claude Code