Giter Site home page Giter Site logo

github-to-mysql's Introduction

GitHub to MySQL

Synchronizes GitHub data (issues, labels, ...) to a MySQL database.

Features:

  • synchronize issues and pull requests
    • support multiple pages of results
  • synchronize labels
  • synchronize milestones

Getting started

  • clone the repository or download a stable release and unzip it
  • run composer install
  • copy .env.dist to create a .env file
  • create the DB tables by running ./github-to-mysql db-init --force You can check which DB queries will be run by removing the --force option (the queries will NOT be run if the option is missing).

You can also simply run ./github-to-mysql without arguments and follow the instructions.

The .env file contains the configuration to connect to the MySQL database as well as the GitHub token. Alternatively to using this file you can set up all the environment variables it contains.

Usage

./github-to-mysql sync user/repository

Use cases

With GitHub data in MySQL, you can extract interesting metrics. Here are a few examples:

  • discover labels with the most issues or pull requests

  • follow number of issues planned per milestone

  • ratio of pull requests VS issues

    SELECT count(*) AS count, IF(is_pull_request, 'Pull request', 'Issue') AS is_pull_request
    FROM github_issues
    GROUP BY is_pull_request
    ORDER BY is_pull_request ASC

  • average number of days to merge a pull request over the past weeks

    SELECT
        YEARWEEK(IFNULL(closed_at, NOW())) AS week,
        AVG(TIMESTAMPDIFF(DAY, created_at, IFNULL(closed_at, NOW())))
    FROM github_issues
    WHERE is_pull_request = 1
    GROUP BY week;

  • average number of pull requests open every day

    SELECT
    	DATE(updated_at) AS day,
    	(SELECT COUNT(*) FROM github_issues WHERE is_pull_request = 1 AND created_at < day AND (closed_at >= day OR open = 1)) AS pr_open
    FROM github_issues
    WHERE updated_at IS NOT NULL
    GROUP BY day;

  • total number of issues

Those are just examples to illustrate the possibilities, we hope it will give you some ideas.

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.