Fixes#1776. Now the indicator is red for unhealthy files.
* src/vorta/views/extract_dialog.py (ExtractTree.data): Set red instead of green colour for unhealthy files.
Move existing tests into subfolder `tests/unit`. Write integration tests that actually run the installed borg executable. Those tests can be found in `tests/integration`. Those pytest fixtures that are the same for both kinds of tests remain in `tests/conftest.py`. The others can be found in `tests/integration/conftest.py` or `tests/unit/conftest.py`. This adds nox to the project and configures it to run the tests with different borg versions. This also updates the ci workflow to run the integration tests using nox.
* noxfile.py : Run pytest with a matrix of borg versions OR a specific borg version
* Makefile : Run using nox. Add phonies `test-unit` and `test-integration`.
* tests/conftest.py : Move some fixtures/functions to `tests/unit/conftest.py`.
* tests/test_*.py --> tests/unit/ : Move unittests and assets into subfolder
* tests/integration/ : Write integration tests.
* requirements.d/dev.txt: Add `nox` and `pkgconfig`. The latter is needed for installing new borg versions.
* .github/actions/setup/action.yml : Update to install pre-commit and nox when needed. The action now no longer installs Vorta.
* .github/actions/install-dependencies/action.yml : Install system deps of borg with this new composite action.
* .github/workflows/test.yml : Rename `test` ci to `test-unit` and update it for the new test setup.
Implement `test-integration` ci.
Signed-off-by: Chirag Aggarwal <thechiragaggarwal@gmail.com>
Move existing code for password input widgets into common classes to increase maintainability and reusability alongside reducing redundancy. This implements a `PasswordLineEdit` that can show a red border when an invalid password is entered. It also features a button for showing/hiding the password entered. When combining two of these entries for setting a new password `PasswordInput` can be used from now on. It combines a form for entering and confirming a password with a label to show a message when there is an issue with the password. It also checks the entered password against some rules regarding its length. This PR replaces existing widgets for entering passwords with these two new widgets.
* src/vorta/views/partials/password_input.py : Implement common input widgets/classes
* src/vorta/views/repo_add_dialog.py : Use new widgets.
* src/vorta/assets/UI/repoadd.ui : ^^^
In a similar fashion like #1637 the commit adds the profile name to the error notification.
* src/vorta/scheduler.py
Co-authored-by: herrwusel <herrwusel@noreply.github.com>
Allows vorta to be called with the command-line flag `--development` or `-D` that will make it use a directory in the project tree to store all the settings, logs, and cache. This default directory will be called `.dev_config` and placed in the projects root.
Also allows for a custom directory path allowing for multiple "configuration" folders at once.
This can be used to prevent the vorta instance that a developer is working on from accessing the configuration files that they have set up for their personal backups.
* .gitignore : Add `.dev_config`.
* src/vorta/utils.py (parse_args): Add `--development` flag. The default will be `DEFAULT_DIR_FLAG`.
* src/vorta/utils.py : Add `DEFAULT_DIR_FLAG`.
* src/vorta/config.py : Add methods for populating the config directories exposed by this module.
* src/vorta/__main__.py (main): Handle `--development` flag and update config directories if its specified.
* Access config constants through the `config` module instead of importing them directly with `from .config import`.
---------
Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
Fix phonies in Makefile and run pre-commit for lint target.
Instead of running black, flake8 and ruff the lint phony now runs pre-commit which has these tools configured as hooks.
* Makefile
Define common composite action for setting up pre-commit and python.
* .github/actions/setup/action.yml
* .github/workflows/test.yml
Update codecov/codecov-action used in test ci to v3.
* .github/workflows/test.yml
Currently the label `logText` is not cleared after a borg command finished. When creating a backup the label will show the path of the last backuped file even after backup completion.
This changes that and clears `logText` after the backup.
* src/vorta/borg/create.py (BorgCreateJob.process_result)
---------
Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
This puts Vorta on PyQt6 and starts a new main branch 0.9.
---------
Co-authored-by: real-yfprojects <real-yfprojects@users.noreply.github.com>
Co-authored-by: Manu <3916435+m3nu@users.noreply.github.com>
Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
* feat: add a setting for files list views
* separate logic from data class
* make mode optional
* rename display mode methods
* refactor
* move code above connect signals comment
* reorder code
---------
Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
Co-authored-by: Manu <3916435+m3nu@users.noreply.github.com>
Borg v1.2.4 added new change types called `mtime` and `ctime` for the modification and the creation time of a file.
Our diff json parser doesn't support these changes yet.
The plain text parser doesn't need to be updated since it is only used for earlier versions of borg.
This also extends the tooltip in the diff view to show changes in `ctime` or `mtime` in a localised manner.
* src/vorta/views/diff_result.py (ChangeType): Add `CTIME` and `MTIME` linking to `MODIFIED`.
* src/vorta/views/diff_result.py (DiffData): Add fields `ctime_change` and `mtime_change`.
* src/vorta/views/diff_result.py (parse_diff_json): Parse the new change types.
* src/vorta/views/diff_result.py (DiffTree.data): Add time changes to tooltip in a human readable format.
* tests/test_diff.py : Update test data to include new change types. Add additional test cases for unittesting the new change types.