Custom command options for MongoDB hook #837 #1041
Reference in New Issue
Block a user
Delete Branch "gautamaggarwal2810/borgmatic:main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #837.Successfully ran unit tests locally.Please review and suggest changes.
Looking good! Mostly minor comments.
@@ -684,0 +715,4 @@dry_run=False,) == [process]def test_build_dump_command_prevents_shell_injection():Do you think it's worth having a test like this for the restore command as well?
@@ -684,0 +717,4 @@def test_build_dump_command_prevents_shell_injection():database = {'name': 'testdb; rm -rf /', # Malicious inputIt's not a concern here, but generally I try not to include real malicious commands even in tests—on the off chance that something is broken and they actually get executed!
@@ -684,0 +729,4 @@dump_filename = '/path/to/dump'dump_format = 'archive'from borgmatic.hooks.data_source.mongodb import build_dump_command, build_restore_command # Import the functionsYou shouldn't need to do this here (or at all) if you instead use
module.build_dump_command()andmodule.build_restore_command().Thank you for the feedback! I’ve applied all the suggested changes in the latest commit, including:
Please let me know if there’s anything else I should adjust or improve.
All unit tests ran successfully.
As far as I'm concerned, this looks set to merge! Please take off the "WIP" prefix when you are ready.
WIP: Custom command options for MongoDB hook #837to Custom command options for MongoDB hook #837Thanks!!