fix(backup): put restic exclude flags after the backup subcommand #75

Merged
Breadway merged 1 commit from fix/bset-72-restic-arg-order into main 2026-10-14 11:58:48 +08:00
Owner

Closes BSET-72

What

restic_backup and scheduled_backup built restic --repo R --exclude-caches --exclude node_modules ... backup $HOME. The exclude flags belong to the backup subcommand, so restic stopped with unknown command "node_modules" for "restic". Every manual and scheduled backup failed, and Backup.svelte's first-run init fallback never ran because the error never says "does not exist".

Both paths now share backup_args: --repo R backup <excludes> $HOME.

Tests

  • backup_subcommand_precedes_its_flags: argv order.
  • restic_accepts_backup_args: real restic init, backup and ls latest against a temp repo when restic is installed. It checks that a normal file is backed up and .cache is excluded. Both tests fail on the old order with the exact VM error, and pass now.
  • cargo fmt --check, clippy --all-targets -D warnings, cargo test --locked (146 passed), svelte-check 0/0, npm test.

Capability changes

None. Same excludes, same paths, same password handling.

Closes BSET-72 ## What `restic_backup` and `scheduled_backup` built `restic --repo R --exclude-caches --exclude node_modules ... backup $HOME`. The exclude flags belong to the `backup` subcommand, so restic stopped with `unknown command "node_modules" for "restic"`. Every manual and scheduled backup failed, and Backup.svelte's first-run init fallback never ran because the error never says "does not exist". Both paths now share `backup_args`: `--repo R backup <excludes> $HOME`. ## Tests - `backup_subcommand_precedes_its_flags`: argv order. - `restic_accepts_backup_args`: real `restic init`, `backup` and `ls latest` against a temp repo when restic is installed. It checks that a normal file is backed up and `.cache` is excluded. Both tests fail on the old order with the exact VM error, and pass now. - cargo fmt --check, clippy --all-targets -D warnings, cargo test --locked (146 passed), svelte-check 0/0, npm test. ## Capability changes None. Same excludes, same paths, same password handling.
fix(backup): put restic exclude flags after the backup subcommand
All checks were successful
check / check (push) Successful in 6m27s
5acab56f82
--exclude and --exclude-caches belong to 'restic backup', not to restic
itself. With them in front, restic stopped at 'node_modules' with
'unknown command', so every manual and scheduled backup failed and the
first-run init fallback never triggered. Both paths now share backup_args.

Tests: argv order, and a real restic init + backup + ls against a temp
repo when restic is installed (fails on the old order with the same error
seen in the VM).
Author
Owner

Review of BSET-72 at exact head 5acab56f82 (base main 14d1315872)

Verdict: code accepted, merge BLOCKED pending CI. The required Forgejo check "check / check (push)" on 5acab56 has been "Waiting to run" (queued behind a bread-ecosystem job on the shared self-hosted runner) since 20:41 and was still pending at 21:08 after bounded polling.

Criteria:

  • Back up now uses --repo R backup <excludes...> $HOME: pass. restic_backup calls the new backup_args (src/src/commands/backup.rs:197-202, 215).
  • scheduled_backup uses the same order: pass. It also calls backup_args (backup.rs:552).
  • Unit test asserts argv order: pass. backup_subcommand_precedes_its_flags (backup.rs:494-504).
  • Integration test with real restic init+backup when restic is on PATH: pass. restic_accepts_backup_args (backup.rs:506-545) runs init, backup and ls latest. It asserts note.txt is included and .cache/skip.txt is excluded. Ran locally with restic 0.19.1.
  • No capability regressions: pass. exclude_args is unchanged, so the excludes are identical. HOME source and RESTIC_PASSWORD env are unchanged in both paths.
  • Init fallback: when the repo is missing, the new order gives "Fatal: repository does not exist ... Is there a repository", which matches the Backup.svelte:52 regex. The first-run init path can now run.

Evidence (detached scratch worktree at 5acab56):

  • Old argv reproduced with restic 0.19.1: unknown command "node_modules" for "restic".
  • frontend: npm ci, npm run check (0 errors / 0 warnings), npm test (3 pass), npm run build: OK.
  • src: cargo fmt --check OK. cargo clippy --locked --all-targets -D warnings OK. cargo test --locked: 146 passed, 0 failed.
  • PR: 1 file changed, no review comments or change requests, mergeable=true.

Next action: merge with a merge commit once "check / check (push)" is green on 5acab56 and the head/base are re-confirmed.

Review of BSET-72 at exact head 5acab56f82da9b42d3e2cf374719c6662ca9b33c (base main 14d13158722527ff88f810b5c32f6679cea34833) Verdict: code accepted, merge BLOCKED pending CI. The required Forgejo check "check / check (push)" on 5acab56 has been "Waiting to run" (queued behind a bread-ecosystem job on the shared self-hosted runner) since 20:41 and was still pending at 21:08 after bounded polling. Criteria: - Back up now uses `--repo R backup <excludes...> $HOME`: pass. restic_backup calls the new backup_args (src/src/commands/backup.rs:197-202, 215). - scheduled_backup uses the same order: pass. It also calls backup_args (backup.rs:552). - Unit test asserts argv order: pass. backup_subcommand_precedes_its_flags (backup.rs:494-504). - Integration test with real restic init+backup when restic is on PATH: pass. restic_accepts_backup_args (backup.rs:506-545) runs init, backup and ls latest. It asserts note.txt is included and .cache/skip.txt is excluded. Ran locally with restic 0.19.1. - No capability regressions: pass. exclude_args is unchanged, so the excludes are identical. HOME source and RESTIC_PASSWORD env are unchanged in both paths. - Init fallback: when the repo is missing, the new order gives "Fatal: repository does not exist ... Is there a repository", which matches the Backup.svelte:52 regex. The first-run init path can now run. Evidence (detached scratch worktree at 5acab56): - Old argv reproduced with restic 0.19.1: `unknown command "node_modules" for "restic"`. - frontend: npm ci, npm run check (0 errors / 0 warnings), npm test (3 pass), npm run build: OK. - src: cargo fmt --check OK. cargo clippy --locked --all-targets -D warnings OK. cargo test --locked: 146 passed, 0 failed. - PR: 1 file changed, no review comments or change requests, mergeable=true. Next action: merge with a merge commit once "check / check (push)" is green on 5acab56 and the head/base are re-confirmed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Breadway/bos-settings!75
No description provided.