Skip to content

Add Google Drive backup retention cleanup#279

Open
JustABiologist wants to merge 2 commits into
Osiris-Team:masterfrom
JustABiologist:bounty/google-drive-remote-retention-12
Open

Add Google Drive backup retention cleanup#279
JustABiologist wants to merge 2 commits into
Osiris-Team:masterfrom
JustABiologist:bounty/google-drive-remote-retention-12

Conversation

@JustABiologist
Copy link
Copy Markdown

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-days setting as the retention window.

Changes:

  • list app-visible Google Drive files matching AutoPlug backup zip names
  • scope cleanup to the configured Drive folder when upload.path is set
  • delete remote backups older than the configured max-days
  • skip remote cleanup when max-days <= 0, matching the local retention behavior
  • add unit coverage for Drive query construction and escaping

Verification:

  • git diff --check
  • Manual compile of touched source/test files using Maven-resolved dependency classpath:
    java --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.java
  • JUnit Console on the compiled test:
    java -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.BackupGoogleDriveTest

JUnit result: 4 tests successful, 0 failed.

Note: the normal Maven command mvn -q -Dtest=BackupGoogleDriveTest test could not run in this container because Maven was not installed and the available Java image cannot compile the project's configured --release 9 target (release version 9 not supported). The targeted source/test compile and JUnit run above passed.

@JustABiologist JustABiologist mentioned this pull request May 12, 2026
@JustABiologist
Copy link
Copy Markdown
Author

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!

@Osiris-Team
Copy link
Copy Markdown
Owner

@JustABiologist

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:

  • Screenshots or recordings from an actual Google Drive test folder
  • Evidence that uploads and deletions work correctly through the live API
  • Verification that only AutoPlug-created backup ZIPs are affected
  • Verification that files outside the configured Drive folder are never deleted
  • Verification that backup.max-days <= 0 correctly disables remote cleanup
  • Verification that mixed file types/non-backup files are ignored safely
  • A short test matrix describing scenarios tested and expected outcomes

It would also help if you could test:

  • multiple backups across different dates,
  • folder-scoped cleanup,
  • filenames containing special characters,
  • and failure handling when the Drive API partially fails or rate-limits requests.

Once that validation is provided, I can better evaluate whether:

  1. the PR is safe to merge, and
  2. whether a partial or full bounty payout would be appropriate given the original issue scope.

The original issue scope was broader, but the implementation + validation effort here would be substantial enough that we’d honor the bounty.

@JustABiologist
Copy link
Copy Markdown
Author

Thank you for honoring the bounty. Give me 2-3 days. I will get to it on the weekend.

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.

GDrive backups

2 participants