ontodev / droid

DROID Reminds us that Ordinary Individuals can be Developers
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

Move easily from GitHub to DROID #101

Closed jamesaoverton closed 3 years ago

jamesaoverton commented 3 years ago

We've built various links from DROID back to GitHub repos, branches, and PRs. But how should users navigate from GitHub to DROID? Say they're looking at a PR on GitHub and want to check out and test that PR in DROID.

  1. links in PR comments: When DROID creates a PR it could add a link to the message. We could also do this for commit messages. I kind of hate this though. It seems noisy and distracting.
  2. webextension: On Zoom I often see people who must have a browser web extension install that adds tabs and links and stuff to GitHub. That's very powerful. But I think it's still really hard to make a single cross-browser extension, and developing an extension for every browser would be a pain. Worse, we'd have to get users to install the extension. As a user I would hate that.
  3. DROID URL "interpreter" and bookmarklet: We could add a GET route and HTML form to DROID that will read a URL like https://github.com/obi-ontology/obi/pull/1337 and then do smart stuff such as redirecting to an existing branch page, offering to check out the branch (for a PR), or start a new branch (for an issue), or create a new project (for a repo). If you're on a GitHub page, a tiny bit of JavaScript in a bookmarklet could read the current GitHub URL and open a new tab for this DROID URL, like https://droid.ontodev.com/?remote=https://github.com/obi-ontology/obi/pull/1337.

I think 3 strikes a good balance. Any suggestions or alternatives?

lmcmicu commented 3 years ago

I agree that (1) is a bit noisy but I think that if I were a user I would prefer it (keeping in mind, of course, that I am not an end user and don't pretend to fully understand their needs). I guess my problem with (2) and (3) is that they sound a bit too complicated; if I were a user I would not want to figure out how to configure a web extension or how to navigate DROID forms and write bookmarklets (which I had never heard of until a few minutes ago). Then again if I was already familiar with bookmarklets and had a great need for this capability I might spend some time entering a DROID form.

Again, as I mentioned, I'm not an end user of DROID and can't pretend to understand all their needs. But that said I think as a user I would find (1) to be most preferable.

jamesaoverton commented 3 years ago

I still think this is a good idea. DROID should redirect the following input GitHub URLs to these DROID URLs:

case input redirect comment
1 https://github.com/IEDB/ONTIE https://droid.ontodev.com/ONTIE GitHub repo to DROID project
2 https://github.com/IEDB/ONTIE/tree/site https://droid.ontodev.com/ONTIE/branches/site GitHub branch to DROID branch
3 https://github.com/IEDB/ONTIE/issues/123 https://droid.ontodev.com/ONTIE?create=1 GitHub issue to DROID branch creation
4 https://github.com/IEDB/ONTIE/pull/47 https://droid.ontodev.com/ONTIE/branches/site GitHub PR to DROID branch

For 2 DROID might also be able to handle URLs for specific files on the branch. For 3 DROID should suggest a branch name that includes the issue number, e.g. fix-123. For 4 DROID should redirect to the branch if it is already checked out, or checkout branch if it is not. I think 4 will require a call to the GitHub API to get the branch associated with the PR.

In other works, DROID should accept URLs like https://droid.ontodev.com/?url=https://github.com/IEDB/ONTIE and redirect to https://droid.ontodev.com/ONTIE. I would also like a form on the DROID homepage with a text field for inputting a URL.