feat: pass custom options to restic backup#101
Conversation
add stack-back.restic.backup.options label to the stack-back container to take `restic backup` options. Defaults to `--verbose` for backward compatibility. Also: - add LABEL_RESTIC_BACKUP_OPTIONS as enum. - feature works for both volumes and database backup. - change backup(), backup_from_stdin() signature to take restic_backup_options as argument. - add --tag test-tag to test compose file and integration_test. - enhance integration_test parsing of snapshots (could use json, but less readable). - improve visibility of logs when integration tests run showing output of restic command in pytest log (with --log-cli-level=DEBUG). - documentation.
There was a problem hiding this comment.
Pull request overview
This PR adds support for passing custom restic backup options through a Docker label stack-back.restic.backup.options. The feature aims to allow users to customize restic backup behavior (e.g., adding tags) while maintaining backward compatibility with the default --verbose flag.
Changes:
- Added
LABEL_RESTIC_BACKUP_OPTIONSconstant to enums - Modified backup function signatures to accept
restic_backup_optionsparameter - Enhanced integration tests with snapshot parsing and tag verification
- Added documentation for the new feature
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/restic_compose_backup/enums.py | Added new label constant for restic backup options |
| src/restic_compose_backup/restic.py | Updated backup functions to accept and pass custom options |
| src/restic_compose_backup/containers.py | Updated base container backup method signature |
| src/restic_compose_backup/containers_db.py | Updated database container backup methods to accept options |
| src/restic_compose_backup/cli.py | Added label parsing logic and option passing |
| src/tests/integration/test_volume_backups.py | Added snapshot parsing helper and tag verification |
| src/tests/integration/conftest.py | Added debug logging for test diagnostics |
| docker-compose.test.yaml | Added test label with --tag option |
| docs/guide/configuration.rst | Documented the new feature |
| README.md | Added note about pytest debug options |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Per lawndoc#101 (comment). It does feel less surprising. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Hi @elmotec thanks for the PR! In addition to your use cases from the discussion, I know this will be handy for people who want to use glacier s3 class and need to pass through additional args for that to work.
Just a few comments for you to review.
Thanks @lawndoc, I addressed your comments. Re-requested review. |
|
Also I am wondering if we should support a |
Not a bad idea, but let's save that for another PR so we can get this one merged first. |
No worry. I updated the doc to make clear the value of the label is appended at the end of the |
add
stack-back.restic.backup.optionslabel to the stack-back container (not the backed up containers because all volumes are backed up with one restic command) to takerestic backupoptions. Defaults to--verbosefor backward compatibility.Also:
LABEL_RESTIC_BACKUP_OPTIONSas enum.backup(),backup_from_stdin()signature to takerestic_backup_optionsas argument.