-
Notifications
You must be signed in to change notification settings - Fork 149
Description
Describe the bug
The default config for includes properties that the fileDB implementation doesn't use:
Lines 22 to 24 in 85e418f
| "params": { | |
| "filepath": "./." | |
| }, |
The filePath is never read and the DB files are always created at the same path, e.g.:
git-proxy/src/db/file/pushes.ts
Lines 10 to 14 in 85e418f
| // these don't get coverage in tests as they have already been run once before the test | |
| /* istanbul ignore if */ | |
| if (!fs.existsSync('./.data')) fs.mkdirSync('./.data'); | |
| /* istanbul ignore if */ | |
| if (!fs.existsSync('./.data/db')) fs.mkdirSync('./.data/db'); |
The MongoDB client uses options for additional settings, rather than params. Hence, I believe params is always unused and should be removed from the config schema and from the default config:
Lines 379 to 389 in 85e418f
| "database": { | |
| "type": "object", | |
| "properties": { | |
| "type": { "type": "string" }, | |
| "enabled": { "type": "boolean" }, | |
| "connectionString": { "type": "string" }, | |
| "options": { "type": "object" }, | |
| "params": { "type": "object" } | |
| }, | |
| "required": ["type", "enabled"] | |
| }, |
Were we to introduce a working option for setting the path to the database files, we should use the options element (as the mongo version does) and add details to the JSON schema to govern the settings for the different types correctly. I don't propose to do that at the moment - rather to just cleanup the unused params element.