Skip to content

Manual mode: Backup Now commits all changes - #54

Merged
saihgupr merged 3 commits into
saihgupr:developfrom
Liquidmasl:fix/manual-backup-add-all
Nov 1, 2026
Merged

saihgupr merged 3 commits into
saihgupr:developfrom
Liquidmasl:fix/manual-backup-add-all

Conversation

@Liquidmasl

Copy link
Copy Markdown
Contributor

Stacked on #53 (develop doesn't start without it). Only the last commit is new; review after #53 is merged.

Problem

Manual mode is meant for a repository the user manages, with "Backup Now" as the way to commit. But Backup Now only stages existing files that match include_extensions / include_storage:

  • Deletions are never committed. A removed automations_old.yaml stays in the repo.
  • Changes to tracked files of other types are never committed (.py, .js, .jinja, .storage/person, ...).
  • If a user had already staged an excluded file (e.g. secrets.yaml from a terminal), it was committed anyway.

Changes

  • Manual mode: Backup Now stages like git add -A. The user's .gitignore decides what is committed. exclude_files / exclude_folders stay a hard gate: they're excluded from staging (:(exclude,literal) pathspecs, same prefix semantics as shouldIgnoreWatchPath) and unstaged if they were staged beforehand.
  • Auto mode: staging is unchanged.
  • Both modes: the "nothing to commit" check now looks at the index instead of the whole working tree, so unstaged leftovers (an excluded file, or an untracked non-config file) no longer make git commit fail.
  • README: one line in the manual mode section.

Tests

New test in tests/manual-mode.test.mjs: modify a tracked .py, delete a tracked YAML, add a .txt, write a file the user's .gitignore ignores, and modify plus pre-stage an excluded secrets.yaml. Then:

  • the commit contains exactly A notes.txt, D automations.yaml, M script.py
  • secrets.yaml stays modified and unstaged
  • nothing is pushed
  • a second Backup Now returns "No changes to commit."

Without this change the test fails: the commit contains only secrets.yaml. All 5 tests pass with it.

🤖 Generated with Claude Code

Liquidmasl and others added 3 commits October 31, 2026 02:01
4233c03 declared assertAutoManaged a second time. server.js is an ES
module, so Node rejects the duplicate and the add-on fails to start on
develop. Keep one definition, carrying statusCode 403, and let the
retention endpoints return it like the reset and flush endpoints do.

Add a CI workflow that syntax-checks the server sources and runs the
manual mode tests on pushes to main/develop and on pull requests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In manual mode the repository belongs to the user, but Backup Now only
staged existing files matching include_extensions/include_storage. Deleted
files and changes to tracked files of other types (.py, .js, ...) were
never committed.

In manual mode Backup Now now stages like `git add -A`, so the user's
.gitignore decides what is committed. exclude_files and exclude_folders
stay a hard gate: they are excluded from staging and unstaged if they
were staged beforehand.

The "nothing to commit" check now looks at the index instead of the
whole working tree, so unstaged leftovers (an excluded file, or in auto
mode an untracked non-config file) no longer make git commit fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@saihgupr
saihgupr merged commit f4accbb into saihgupr:develop Nov 1, 2026
1 check 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.

2 participants