kblincoe / QualOpt_SE701

2 stars 15 forks source link

Feature Request: Connect to GitHub API using credentials/OAuth to increase hourly API limit #134

Open dylHall opened 6 years ago

dylHall commented 6 years ago

Feature Request Information

40 has been pulled in to master, and has added the ability for researchers to add new participants by sending a request to the GitHub API with optional search terms.

However, the GitHub API imposes rate limits on its API - the current implementation is connected to anonymously, which means there's a limit of 60 API calls per hour. This poses a problem for when a researcher tries to queue up large requests - as constructing a single participant can require multiple API queries.

I suggest that we add the ability for QualOpt to authenticate with the GitHub API, as this would increase the hourly API limit to 5000 per hour.

Additionally, we should add a way of displaying the current API limit if we use an OAuth token across the entire project (current implementation has individual connections, thus the API limit is not shared).

Technical Details

Information regarding rate limiting can be found from these links: https://developer.github.com/v3/rate_limit/ https://developer.github.com/v3/#rate-limiting

To see the rate limit in action, make a request by clicking on the "Send GitHub API Query" button on the Participants page, and then look at the console running the backend. There will be printouts showing the current limit, max limit and when the hourly reset will occur image

The place to make the change will be in the GitHubResource.java file, either passing in some form of authentication from the call at the frontend, or having some set OAuth in the backend.

Work Estimation

The GitHub domain model has methods available for authenticated connections (refer to http://github-api.kohsuke.org/apidocs/index.html for javadocs, specifically on the GitHub object), but because there will be both frontend and backend components to this work, I'd estimate this feature request to be of medium size.

softeng-701 commented 6 years ago

@dylHall APPROVED!