The study index needs to be updated upon changes to the data store (phylesytem)
The current (as of August 2016) procedure:
- User adds / updates / deletes a study using the curator app
- The modifications get saved as commits to the phylesystem-1 repo
- a GitHub commit hook calls
https://api.opentreeoflife.org/phylesystem/search/nudgeStudyIndexOnUpdates
. The payload includes the details of the commit. - that call is handled by phylesystem-api, specifically the nudgeStudyIndexOnUpdates method, which bundles of up the list(s) of added, deleted, and modified study IDs, and calls OTI.
- the OTI method indexNexsons handles the call for additions and modifications and unindexNexsons handles deletions, both modifying the database as needed
Sample call from phylesystem-api to oti:
curl -X POST -d '{"urls": ["https://raw.github.com/OpenTreeOfLife/phylesystem/master/study/10/10.json", "https://raw.github.com/OpenTreeOfLife/phylesystem/master/study/9/9.json"]}' -H "Content-type: application/json" http://ec2-54-203-194-13.us-west-2.compute.amazonaws.com/oti/ext/IndexServices/graphdb/indexNexsons
- The phylesystem-api config contains a OTI_BASE_URL variable that points to the OTI to update
- The value of OTI_BASE_URL is defined in the deployed_systems config files for development and production
- germinator's push.sh script reads the config and passes the value of OTI_BASE_URL is passed to install_api.sh as a command line argument
- Write a generic nudgeIndex method that can handle changes to studies, collections, amendments, or other data types
- The web application will not need to change.
- two possible approaches to triggering:
- the webhook stays the same, and phylesystem-api calls otindex rather than oti, and the payload specifies that the changes apply to studies (new top-level
studies
key). - the webhook calls otindex directly, eliminating phylesystem-api from the loop
- the webhook stays the same, and phylesystem-api calls otindex rather than oti, and the payload specifies that the changes apply to studies (new top-level
- otindex updates the database as needed
- replace json blob for study and tree
- update curator and study-curator tables, if needed
- update otu and tree-otu tables, if needed