Release of a tool for the analysis of pull requests and the code review process

Release of a tool for the analysis of pull requests and the code review process

At the end of the year, it was possible to finalize the main features of the pull request analytics action. Now is the time to take stock in teams – and this tool can very easily, free and safely collect analytics on github and display it in tables and graphs.

Metrics

  1. The time of passage of PR from opening to roaring, approving and pouring

  2. The amount of work performed is expressed in the number of PRs injected, lines changed and code reviews conducted.

  3. The quality of open PRs, expressed in the number of open discussions, requested changes and received comments

  4. Involvement in the review process, based on the number of reviews, open discussions.

All this data is displayed both by the team as a whole and by individual developers. You can also compare indicators from month to month.

An example of the schedule of PRa passing in the stages

An example of a table with an analysis of the received review

A full sample report can be viewed here

Settings

All you need is to add a github action to the project. To do this, you need to add a folder to the root of the project .github/workflows and create a yml file there.

Example file (only token and analytics repositories need to be added):

name: "PR Analytics"
on:
  workflow_dispatch:
    inputs:
      report_date_start:
        description: "Report date start(d/MM/yyyy)"
        required: false
      report_date_end:
        description: "Report date end(d/MM/yyyy)"
        required: false
jobs:
  create-report:
    name: "Create report"
    runs-on: ubuntu-latest
    steps:
      - name: "Run script for analytics"
        uses: AlexSim93/pull-request-analytics-action@master
        with:
          GITHUB_TOKEN: ${{ secrets.TOKEN }}
          LABELS: "Report"
          GITHUB_REPO_FOR_ISSUE: "repo"
          GITHUB_OWNER_FOR_ISSUE: "owner"
          GITHUB_OWNERS_REPOS: "owner-1/repo-1"
          CORE_HOURS_START: "9:00"
          CORE_HOURS_END: "19:00"
          TIMEZONE: "Europe/Moscow"
          REPORT_DATE_START: ${{ inputs.report_date_start }}
          REPORT_DATE_END: ${{ inputs.report_date_end }}

The file must be merged into the main branch, and then the action will appear in the list available for launch. Select the created action in the list on the left and click run workflow. In order to compile a report from the beginning of the year in the field Report date start must be specified 01/01/2023. The report will be available at issues the specified repository.

Conclusion

The tool can be useful not only for summarizing, but also for quality control, identifying problematic or strong points in processes in the future. Like any statistic, it doesn’t take into account all the nuances, but it can complement other metrics or opinions. The list of options for setting is large, to study it in more detail, you can go to the action page.

Related posts