OpenTreeOfLife / ot-ansible

BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Deploy webhook using ansible #36

Closed jimallman closed 1 year ago

jimallman commented 1 year ago

This should install an appropriate webhook to update otindex when a study is saved in the curation app.

jimallman commented 1 year ago

@snacktavish NB - Regarding the amendments webhook, the old (pre-Pyramid) handler is on branch before-pyr, and of course it's currently failing. More importantly, I don't believe we're currently caching amendments or taxa, so it's moot for now.

I'll comment this out in the Ansible playbook, but keep the main (study) webhook. I believe this is pointing to the correct (new) URL.

jimallman commented 1 year ago

@snacktavish I spoke too soon! It looks like the amendments webhook handler doesn't just clear stale amendments from the cache -- it also does some processing via v3/taxonomy/process_additions. I'll check to see if this method is in the currently deployed code.

EDIT: I found this old method in taxomachine. I'm guessing there's a newer implementation that we should call instead..? Or we need to write one.

snacktavish commented 1 year ago

Yep - we need to put it into otindex. I made an issue here: https://github.com/OpenTreeOfLife/otindex/issues/61

And I pulled the code that was in phylesystem API here: https://github.com/OpenTreeOfLife/otindex/blob/webhook/otindex/views.py#L338

But haven't had a chance to look at the taxon updates yet. Feel free to take a crack at it if you want!

jimallman commented 1 year ago

NB - Managing Github webhooks requires the Ansible user to have a valid personal access token on their local filesystem, at ~/.ssh/opentree/OPENTREEAPI_OAUTH_TOKEN. Or put it anywhere, and update the local_api_token_path variable to match.

jimallman commented 1 year ago

These changes are working now on devtree/devapi. Ready to merge?