WIP: Custom command options for MongoDB hook #837 #1029
Reference in New Issue
Block a user
Delete Branch "(deleted):modified_branch"
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.Will add unit tests soon.
Looking good!
@@ -131,0 +131,4 @@dump_command = tuple(shlex.quote(part)for part in shlex.split(database.get('mongodump_command') or 'mongodump'))This'll happen as part of running tests, but make sure to look at any
blackcode formatting errors that you get. Andtox -e blackcan do the reformatting for you.f4b584c381to33dd66e3e1Added unit tests.All of them were successful.Please review and suggest any changes to be made.
@@ -15,0 +20,4 @@if value is None:return value# Remove dangerous characters and sequencesreturn re.sub(r'[;&|><]', '', value).strip()Why is this necessary if you're using
shlex.quote()? And by removing characters outright instead of quoting them, won't this break some legitimate use cases? For instance, I think this approach would break many legitimate passwords that contain special characters.I used this because unit tests were failing without running this.I will try once more without using this function though.
I'm not sure why they'd fail, but I'd be happy to help with test failures if I can.
Pull request closed