-
Notifications
You must be signed in to change notification settings - Fork 44
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
Provider list fallback and list of providers in both servers' /links
-endpoints
#455
Conversation
Order: 1. providers.optimade.org 2. GitHub source code raw content for providers repo 3. Log a warning The list of providers has also been added to the index meta-database implementation's `/links`-endpoint. This required a purging of the MongoMock in-memory collections for the invoke task that updates the OpenAPI JSON files, since the collection names are shared, and the `insert_many` method would fail when importing both applications without using re-initalizing the MongoMock in-memory database and it's collections.
This makes sure we get the list of providers in the `/links`-endpoint, whether it's for the regular or index meta-database server. The "original" data is still inserted with `insert_many`, since it's considered unique to the specific server. Co-authored-by: Shyam Dwaraknath <[email protected]>
Note: This version lost two commits (where I removed the I have left it like this for now, but it should go one way or the other:
Personally, if we're holding on keeping the submodule in, I'd prefer to also then use it. |
Codecov Report
@@ Coverage Diff @@
## master #455 +/- ##
==========================================
+ Coverage 91.26% 91.65% +0.39%
==========================================
Files 60 60
Lines 2815 2828 +13
==========================================
+ Hits 2569 2592 +23
+ Misses 246 236 -10
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
I have implemented option 2. from above now, and also added tests to make sure every possibility reachable is tested and returns/warns what is expected. |
Fixes #450
Fixes #454
We experienced that providers.optimade.org was down for some time, hence this will make sure to use some fallback's to try and retrieve the list of providers.
Another thing is fixed in this PR. Namely that the list of providers was not included for the index meta-database.
There was a good reason why: The same links MongoDB collection was used in-memory when starting both servers within the same environment.
This has been fixed by the use of
replace_one
/replaceOne
thanks to some help from @shyamd.