Package: github-metrics
github-metricsAboutA script for getting your team PRs metrics.RunningThe run command takes the following arguments:--metric: The reference for the metric you'd like to calculate. If no metric is provided, it will calculate all metrics available.--start-date: The metric start date. Date in format YYYY-mm-dd--end-date: The metric cutoff date. Date in format YYYY-mm-dd--exclude-authors: Will exclude all PRs created by the listed authors. This argument must list usernames separated by a comma. Example:--exclude_authors=pantoja,github_username,other_username--filter-authors: Will take into consideration only the PRs created by the authors in this list. This argument must list usernames separated by a comma. Example:--exclude_authors=pantoja,github_username,other_username--include-hotfixes: Will include all hotfixes in the metric calculation. By default, this value is false.--exclude-weekends: Will exclude weekend time from time metrics (time to merge, time to open, time to review).[All]github_metrics --start-date=2021-03-22 --end-date=2021-03-24Time To Mergegithub_metrics --metric=ttm --start-date=2021-03-22 --end-date=2021-03-24Time to Reviewgithub_metrics --metric=ttr --start-date=2020-11-10 --end-date=2020-11-18Time to Opengithub_metrics --metric=tto --start-date=2020-11-10 --end-date=2020-11-18Open to Merge Timegithub_metrics --metric=otm --start-date=2020-11-10 --end-date=2020-11-18Merge Rategithub_metrics --metric=mr --start-date=2021-03-22 --end-date=2021-03-24Pull Request Sizegithub_metrics --metric=pr_size --start-date=2020-11-10 --end-date=2020-11-18Hotfixes countgithub_metrics --metric=hotfixes_count --start-date=2020-11-10 --end-date=2020-11-18Metrics availableTime To Merge (ttm):The Time to Merge metric calculates time between the first commit of a given branch, and the merge action of it's pull request.Time To Review (ttr):It calculates the time a PR waited for, or has been waiting for the first review since the PR opened.Time To Open (tto):The time elapsed between a user's first commit to a branch and opening a pull request for that branch.Open To Merge Time (otm):Returns statistics related to the time between opening and merging a pull request.Merge Rate (mr):It measures the total number of merged pull requests to the total number of developers active in this time period (number of merged PRS / dev). A value closer to 1 indicates that each developer is merging a PR. a higher number indicates more merged PRs than devs, and vice versa.Pull Request Size (pr_size):It generates metrics related to the number of lines added and deleted in a PR. The output will generate metrics related to the sum of different lines in a pr (lines added + lines deleted), and the addition rate metric (lines addes / lines deleted). In the latter case, a higher the rate number means more lines are being added than deleted.Hotfixes Count (hotfixes_count):The number of hotfixes in the period.Installing the projectInstall usingpip install github-metricsSetup settings variable by runninggithub_metrics --setup. You'll be asked to give following information:Github username: Your github account loginEnter a github token: An access token generated with your github account.  More information accessible throughthis guide. The lib requires full repo access for it to workName of the organization: The name of the organization where the repository is locatedRepository name: The repository name of the project of your choiceNOTE:Running the--setupflag will overwrite the existing enviroment settings.Project setupDependencies setupCreate a virtual enviromentvirtualenv venvInstall dependencies withpip install --editable .Setup with dockerRun the command withdocker-compose run app {}. e.g.docker-compose run app github_metrics --metric=ttm --start-date=2021-03-22 --end-date=2021-03-24Project variables setupCreate a .env file by copying from .env.example withcp .env.example .envFill settings variables:REPOSITORY_NAME: The name of the repositoryORG_NAME: The name of the organizationGITHUB_LOGIN: Your github account usernameGITHUB_TOKEN: The access token generated with your github account.Release ProcessFor maintainers only:Runbump2version <minor|major|patch>to update the version number (pick one of the options)Version number ongithub_metrics/__init__.pyandsetup.pywill be updated automaticallyYou can specify the--new_versionflag in case you wish to manually set the newest version (if not provided, it will be done automatically based on the chosen option)