kblincoe / QualOpt_SE701

2 stars 15 forks source link

Connect GitHub API to QualOpt #40

Open softeng-701 opened 6 years ago

softeng-701 commented 6 years ago

Currently, the site has only used mock participant data or no data at all for its database. The site needs to be connected to the GitHub API so that actual GitHub users' emails can be acquired for use in surveys.

NOTE, REALLY IMPORTANT: You must ensure that no emails are sent to actual GitHub users during this project. Make sure that either any emails are sent to fake addresses or that no emails are sent at all.

dylHall commented 6 years ago

Will begin investigating this feature request - this is related to Issue #39, so will work alongside Kalana (Group 5 - Auka).

dylHall commented 6 years ago

After Chamara and I worked on this and had a discussion with Kelly and Latha, I just wanted to write down the high-level workflow that we’ve currently planned for in our implementations of features in #39 and this issue.

Initially, a Researcher will use the tool to establish their Studies in the web app and will check the participants currently present in the database to send email invitations/information to them. If the Researcher doesn’t have access to enough Participants, then can move to the Participants page and press the new “Send GitHub API Query”…

image

…to bring up a form to fill out that will allow them to send a custom user search to the GitHub API

image

This request will be converted to the appropriate API Call to GitHub, and will take the JSON representations of resulting users returned from GitHub into Participants.

This allows the Researchers to have the “initiative” in a sense – they can find the GitHub users they want and then send out emails to them. However, if a GitHub user receives an email and wishes to opt out (#39), then they should be able to log into the service and be taken to a new page to configure the studies they want to receive emails about. Please refer to #39 for some further discussion about our current plan for the logging in and management of users after receiving these emails.

The GitHub API Request is routed from the model backing the front end form, to a resource handler in the backend server – this is because Angular 4.2.6 doesn’t have access to HttpClient and other higher-level connection objects. As a result, I encountered many CORS issues when trying to send a query to the GitHub API. To promote interoperability between different browsers and configurations, I thus developed a backend solution to send this API request (using a GitHub API Maven repository to provide domain objects to the solution). Having this domain model present should help #41 add extra information to Participants, as any information can be acquired for “free” in a sense (just add GHUser#Get…. calls).

Here are a few of my suggested improvements based off of the work started here: (@kblincoe, @softeng-701, are there any of these features that you’d like me to spec and add to the issue list?)

If you’d like any information about the implementation, please refer to the Pull Request for this branch or reach out to me for any specific questions!