Skip to content

Self-update: check for and apply newer releases before each run - #3

Merged
ridaken merged 2 commits into
mainfrom
self-update
Jun 27, 2026
Merged

Self-update: check for and apply newer releases before each run#3
ridaken merged 2 commits into
mainfrom
self-update

Conversation

@ridaken

@ridaken ridaken commented Jun 27, 2026

Copy link
Copy Markdown
Owner

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 fetch the remote, resolve the target: newest vX.Y.Z tag (ref: latest-release, default) or a tracked branch.
  • If newer and the working tree is clean: optionally verify the commit signature (fail-closed), check it out, reinstall when pyproject.toml changed, and re-exec into the new version so this run uses it.
  • Fully fail-safe: any problem (offline, dirty tree, install failure) logs and continues on the current version; a failed install rolls the checkout back.
  • Skipped off a git clone, on a dirty tree, and on --dry-run. In loop mode it checks each cycle (sentinel env var prevents an update loop).

Notes

  • Requires the deploy to be a git working tree (git clone + pip install -e .), not a wheel.
  • Dependency-injected (run/reexec/env/log) so it's unit-tested without real git/network — 21 new tests, overall coverage 96%.
  • Docs added to README + config templates; AutoUpdateConfig added to config.

🤖 Generated with Claude Code

Tom and others added 2 commits June 26, 2026 23:51
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>
@ridaken
ridaken merged commit e7a631d into main Jun 27, 2026
4 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