Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drive Backup 2.0 #6

Merged
merged 153 commits into from
Sep 27, 2024
Merged

Drive Backup 2.0 #6

merged 153 commits into from
Sep 27, 2024

Conversation

dunkmann00
Copy link
Owner

There are a bunch of changes I've been working on for 2.0. This should really improve all aspects of Drive Backup. I'll add a list of the noteworthy improvements in this PR's description.

dunkmann00 and others added 30 commits February 19, 2024 15:30
This commit refactors the code needed to interface with Drive Backup
through a cli. A big part of this is adding in the rich library. This
enables much nicer terminal styling, formatting, and progress tracking.
This replaces pync with my own swift macOS app, Drive Backup
Notifications, for making notifications on macOS.
Sanitizes the file and directory names from items downloaded from Google
Drive. Also, validate the backup name when a custom name is given. If
the custom backup name is invalid, fail with a critical error.
This adds a workflow to build a Github Pages site on release and when
initiated manually. For now, the items that will be included in the
Pages build are each line item in 'github-pages-items.txt'.
This adds a macOS and Windows project to handle showing notifications.
It seems the best way to show a notification for each OS is to do so
natively (or close to it in the case of Windows). The macOS project is
native swift done with Xcode and the Windows is in C++ done with Visual
Studio.

I ultimately felt it was easier to control how the notifications worked
by doing it like this. Now Drive backup is using the most modern
APIs to send notifications and can take advantage of this if it is
useful. Since the notifications that are sent from Drive Backup are so
simple, the code in each native app that handles this is also very very
simple.

I'm checking in the Xcode project for macOS into the project's repo
because I am not interested, at this time, in trying to get the bundle
built and signed with GitHub Actions. It seems a lot easier to do
locally with Xcode. In the future I may revisit this, but for now, this
will do. Building the Windows executable is simpler to handle with
GitHub Actions so that I will setup.
Each time a backup is run this will store the config in a file. This
file can also be included as a flag to future backups to set the config
to match the previous backup.

This also adds the option to provide a path to where the log file should
be stored.

The flags that dealt with 'logging_' had their names changed to start
with 'log_' to make them shorter.
Originally I was thinking the notification would be just something done
via the cli (and not a potential gui in the future). But since it seems
to now be working so well, I think it would be appropriate to use
regardless the interface.

The other benefit in doing this is it makes it easy to show a
notification on a failure as well.
This improves the handling of the client credential. Some of the code
for this handling has been moved into it's own module and the parts that
remain in 'drivebackup.py' now have improved error handling.

This also adds the ability to specify the path to the credentials file
in the config (it can be passed in as a command line argument).
The main change here is to move the credential handling code into its
own module. On top of this there is also some other refactoring taking
place and the notifications module was moved into core.
Rather than checking if we should potentially run the poetry plugins in
the 'activate' function, check in the dispatched function. When
'poetry.pyproject' is queried, if the pyproject.toml doesn't exist, it
exits, and does nothing. This will happen for *all* functions. Even for
'init' and 'new'. This is obviously problematic. By checking in the
dispatched function, *after* we check if the corresponding command was
run (i.e. build or install), we avoid this problem. We won't ever ask
when functions are run where not having a pyproject.toml is okay. We
only ask for build and install, where you already need the
pyproject.toml.
The previous icon was denied by Google when I tried to get the OAuth
verification for the app. This one, hopefully, will be acceptable.
Since I am not going to be able to have the app verified at this time, I
added a lot of information around what that means so users can be well
informed.
- It should be okay if the directory exists in the Application Support
directory.

- The notification authorization command was missing a hyphen.
@dunkmann00 dunkmann00 marked this pull request as ready for review September 27, 2024 19:46
@dunkmann00
Copy link
Owner Author

I think this is all good, finally ready for a merge! 😄

@dunkmann00 dunkmann00 merged commit 19e1188 into main Sep 27, 2024
7 checks passed
@dunkmann00 dunkmann00 deleted the update branch October 30, 2024 17:28
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