-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
abstract data interface #43
Conversation
Abstract the interface for data storage from anything mongodb specific, thereby allowing for developers to more easily incorporate other backends such as file storage and tinydb. Basic implementation for file storage with corresponding unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Could you please enable "allow edits from maintainers" for this branch so that I can push add minor changes before merging? (I want to add / restyle docstrings and fix some of the code style warnings reported by https://travis-ci.org/chovanecm/sacredboard/jobs/239662238 in the new code.)
Alternatively, you can do it :-) And I think it's acceptable to ignore warnings for the test files.
sacredboard/bootstrap.py
Outdated
@@ -76,12 +79,20 @@ def run(debug, no_browser, m, mu, mc): | |||
Note: MongoDB must be listening on localhost. | |||
|
|||
""" | |||
add_mongo_config(app, m, mu, mc) | |||
|
|||
if m: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please include the mu
variable too in order for commands like sacredboard -mu mongodb://user:pwd@host/admin?authMechanism=SCRAM-SHA-1 sacred
to work.
If you still have troubles running Also make sure to have both flake8 and pydocstyle installed (I just noticed I forgot to add them in |
Whoops, I guess I should have pulled before I pushed. Should I pull and resolve the changes or leave that to you? The only changes I made to mongodb in this last commit relate to removing whitespace and shortening doc strings as recommended by |
# Conflicts: # sacredboard/app/data/mongodb.py
Conflict fixed. I have also fixed some errors and added reading of the info.json file. Furthermore, I changed the way how the code style check for Python works. |
Now I'd like to ask you to consult the code documentation with Do you plan to add support for filtering, sorting etc? It's quite a lot of work. Otherwise, I'm thinking about extending the Web API to tell the frontend to hide the filtering and similar controls in order not to confuse the users. |
The run "info" is normally stored in an external file. But it was not so in the test run.
…to develop Why is m or mu compared to (None, None)?
"Why is m or mu compared to (None, None)?" - It's not exactly clear, I know. The reason is that the mu parameter defaults to (None, None) and when the parameter is not present on the command line, it is set to that value. So after you added "if m or mu", it was actually always evaluated as True even thought Sacredboard was run with |
Oh ok, sorry about that. I should have tested it more thoroughly. Any other things that this PR is blocked on? |
Not from your side. As soon as I have some time (hopefully already later this week), I'll disable all the sorting and filtering controls for backends that don't support it and I'll merge the PR. |
Abstract the interface for data storage from anything mongodb specific,
thereby allowing for developers to more easily incorporate other
backends such as file storage and tinydb.
Basic implementation for file storage with corresponding unit tests.
For more on this change see #17.