GithubHelp home page GithubHelp logo

ntatsumi / github-insights Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 1.18 MB

RESTful service for Github repository insights

License: Other

Shell 43.36% Java 54.50% Scala 1.91% JavaScript 0.23% CSS 0.01%

github-insights's Introduction

Github Insights

Github Insights is a RESTful service that provides insights to your Github repositories.

Build Instructions

Compile and run tests

activator test

Start server

activator run

Routes

GET     /                           controllers.Application.index()

POST    /auth/github                controllers.Application.setGithubAuth()

GET     /:org/repos                 controllers.Application.listRepos(org: String)

GET     /:org/repos/top/:top        controllers.Application.listReposTop(org: String, top: Integer)

Sample Requests

Set Github username and password (Optional to get higher rate limiting allowance)

curl -H "Content-Type: application/json" -d '{ "username": "user","password": "pass" }' localhost:9000/auth/github

List Netflix repositories

curl localhost:9000/Netflix/repos

List the top 5 repositories based on the number of pull requests

curl localhost:9000/Netflix/repos/top/5

Design Considerations

  • Only public repos are included in the insight.
  • Pull requests look ups are asynchronous and non-blocking.
  • HTTP redirection gets followed when provided by Github API.
  • Use Etag and caching to improve performance and minimize the impact from Github API's rate limiting. The number of pull requests can be queried via the Admin Stats API but that's only available to Enterprise site admins. Popular repos will require significant number of page requests to look up all pull requests.
  • For increasing the rate limit allowance, allow authenticating to GitHub.
  • Specify Github API v3 in the header to make sure this service is talking the same language with Github API service.
  • Pagination item size is set to the maximum value of 100 to minimize HTTP round trips.
  • Assume that each org doesn't have above 100 repositories.

Todos

  • Add more tests!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.