Add Google Drive backup retention cleanup#279
Conversation
|
If this PR is merged and the 50eur bounty is approved, please send the payout via PayPal to the email in my GitHub profile. Happy to provide Solana wallet as an alternative — just let me know which you prefer. Thanks for reviewing! |
|
Thanks for the contribution and for disclosing that the PR was AI-assisted. The cleanup/retention logic is a useful addition, however the original bounty intent for #12 was the full Google Drive backup implementation itself. Since Google Drive uploads were already implemented previously and the issue accidentally remained open on our side, this PR currently looks more like a partial enhancement than a full completion of the original bounty scope. That said, I’m still open to reviewing and potentially merging this improvement because remote retention cleanup is an important missing piece. Before we can evaluate merge/bounty eligibility though, I’d like to request real end-to-end testing against the actual Google Drive API (not only targeted/unit tests). Since automatic deletion is a sensitive feature, we need confidence that it behaves safely in real-world conditions. Please provide:
It would also help if you could test:
Once that validation is provided, I can better evaluate whether:
The original issue scope was broader, but the implementation + validation effort here would be substantial enough that we’d honor the bounty. |
|
Thank you for honoring the bounty. Give me 2-3 days. I will get to it on the weekend. |
Fixes #12.
This completes the missing Google Drive retention part of the backup flow. The existing uploader already creates the backup zip in Drive; this change now also cleans up old Google Drive backup zips after a successful upload, using the existing
backup.max-dayssetting as the retention window.Changes:
upload.pathis setmax-daysmax-days <= 0, matching the local retention behaviorVerification:
git diff --checkjava --add-modules jdk.compiler com.sun.tools.javac.Main -source 21 -target 21 -cp "$(cat /tmp/autoplug-classpath.txt)" -sourcepath src/main/java:src/test/java -d /tmp/autoplug-compile src/main/java/com/osiris/autoplug/client/tasks/backup/BackupGoogleDrive.java src/test/java/com/osiris/autoplug/client/tasks/backup/BackupGoogleDriveTest.javajava -jar ~/.m2/repository/org/junit/platform/junit-platform-console-standalone/1.9.2/junit-platform-console-standalone-1.9.2.jar --class-path "/tmp/autoplug-compile:$(cat /tmp/autoplug-classpath.txt)" --select-class com.osiris.autoplug.client.tasks.backup.BackupGoogleDriveTestJUnit result: 4 tests successful, 0 failed.
Note: the normal Maven command
mvn -q -Dtest=BackupGoogleDriveTest testcould not run in this container because Maven was not installed and the available Java image cannot compile the project's configured--release 9target (release version 9 not supported). The targeted source/test compile and JUnit run above passed.