feat: allow MongoDB backup of all databases when database name is empty#4187
Open
krisvanmelis wants to merge 2 commits intoDokploy:canaryfrom
Open
feat: allow MongoDB backup of all databases when database name is empty#4187krisvanmelis wants to merge 2 commits intoDokploy:canaryfrom
krisvanmelis wants to merge 2 commits intoDokploy:canaryfrom
Conversation
When the database field is left empty for MongoDB backups, mongodump runs without the -d flag, which dumps all databases in the instance. This is useful when users want a full backup without creating separate backup entries for each database. - Modified getMongoBackupCommand to conditionally include -d flag - Relaxed database validation to allow empty string for MongoDB only - Added UI hint for MongoDB: "Leave empty to back up all databases" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ommand - Add superRefine to createSchema rejecting empty database for non-mongo types - Fix double space in mongodump command when database is empty Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
|
Fixed both issues flagged by Greptile: P1 — Server-side databaseType-conditional validation: Added P2 — Double space in mongodump command: Moved the trailing space into |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #4186
mongodumpruns without the-dflag, dumping all databases in the instanceChanges
packages/server/src/utils/backups/utils.ts— Conditionally include-dflag ingetMongoBackupCommandpackages/server/src/db/schema/backups.ts— Relaxeddatabasefield validation frommin(1)to allow empty stringapps/dokploy/components/dashboard/database/backups/handle-backup.tsx— AddedsuperRefineto require non-empty database for non-mongo types; addedFormDescriptionhint for MongoDBTest plan
🤖 Generated with Claude Code
Greptile Summary
This PR adds support for MongoDB "dump all databases" mode by omitting the
-dflag when the database field is empty, with corresponding frontend validation to require a database name only for non-MongoDB types. The frontend changes are clean and correct, but the server-sidecreateSchemainbackups.tswas relaxed globally (all types) without adding a compensating type-conditional refinement — meaning direct API calls can create broken backup configs for Postgres/MySQL/MariaDB/LibSQL with an empty database name that will silently fail at runtime.Confidence Score: 4/5
Safe to merge after adding server-side databaseType-conditional validation to the backup schema.
There is one P1 defect: the server-side schema allows an empty database for all database types without enforcing the same databaseType-conditional rule as the frontend. A direct API call can persist a broken backup config that silently fails at execution time. All other changes (the mongodump flag logic, the UI hint, and the frontend superRefine) are correct.
packages/server/src/db/schema/backups.ts — createSchema needs a superRefine or per-schema refinement to reject empty database for non-mongo types.
Reviews (1): Last reviewed commit: "feat: allow MongoDB backup of all databa..." | Re-trigger Greptile
(2/5) Greptile learns from your feedback when you react with thumbs up/down!