geneontology / noctua

Graph-based modeling environment for biology, including prototype editor and services
http://noctua.geneontology.org/
BSD 3-Clause "New" or "Revised" License
36 stars 13 forks source link

Create example integration between Noctua and GitHub using TBD "Simple Integrations API" #408

Closed kltm closed 7 years ago

kltm commented 7 years ago

This ticket should be closed with either a demonstration, or complete abandonment, of the "simple integrations api".

Notes on simple integrations API, cribbed from the original text for an Apollo idea.

This all really only makes sense with external tools with /real/ REST APIs (likely GitHub, Slack, etc.). A mile high implementation looks like:

So, imagine an example with github as a review tool:

setup:

github get:

github put:

The "get" and "put" above are just two states of the same "widget", that is entirely defined by the logic of the GET request transformation.

kltm commented 7 years ago

While thinking about the best way to actually do this, I decided it would be useful to add the open tickets (up to 100 for now) on the landing page for github items that have a model name in the title. It will be slow until we add the model regexp to the config data (to make scanning a one time thing), but given the number of models we have right now, it's a reasonable demo.

This has been pushed to production for thoughts and review.

kltm commented 7 years ago

In experimenting with the above, I realize that I fell into the trap I was trying to avoid: the landing display should not be the management display--that's the job of GitHub and why I'd be trying to integrate, it is the manager. The only things I want are:

On a model, a button that

The only hiccup here is that the noctua model itself (model annotations), and the external github metadata may not be the same. This could be fixed at the application level by having the application peak inside the widget and update the model accordingly. No more evil than some other things we've done.

kltm commented 7 years ago

The transformations (REST results -> renderable JSON blob) themselves can be language specific sharable libraries. The widgets and the methods to pass configuration and context information to the target URLs are going to be more specific. That said, if using a framework like Vue.js, that can pretty much be shared as a whole as well (embeddable widgets with external configuration). For server-side integrations, that would be more code, but I suspect that a lot of this could be reused across platforms--e.g. a github manager integration for Apollo could largely be reused in Noctua, and vice versa.

I think that the way forward for us here would be using a pattern much like our workbenches; essentially workbenches as embedded buttons and widgets.

kltm commented 7 years ago

A note on this to @cmungall and @dougli1sqrd, as I have mentioned frustration with the GitHub UI API in the past; while undocumented, I discovered that this actually works as one would expect: https://github.com/geneontology/noctua-models/issues/new?title=foo&body=your+body+here So, technically brittle (use of undocumented API, AFAICT), but I'd guess stable and usable.

dougli1sqrd commented 7 years ago

Oh that's actually pretty cool!

kltm commented 7 years ago

It turns out that their REST API pretty much works as expected if you just feed it to the UI form as arguments. Which sounds like it's intentional and unlikely to go away.

kltm commented 7 years ago

Okay, I have a first pass at at GitHub "integration" into Noctua on the graph editor pages, but it falls short of the "integrations" API that I imagined.

Instead of a read YAML that gets mapped to a button with actions, I have this. While that is not as "generic" in some ways, it is obviously a sane framework and a few runtime args away from being reusable generically as a GitHub management integration in any JS app. So less language agnostic genericism and more plug-and-play within JS?

All that said, this is a rather fun little side trip. Naturally, there is more that could be done here with things like labels, "hats", and different working groups, but I think this is actually very useful functionality now that we are funneling people into GitHub.