Pull Request Review

Pull request reviews are one of the most time-consuming activities and they require a lot of attention to detail. As developers ourselves, we know that Inspecode’s ability to automate pull request reviews is one of the most useful features our software provides.

We’ll start by explaining how to configure the status of a job using thresholds. Next, we’ll show how to save time with Inspecode’s automated pull request review.

How to Configure Job Status Using Thresholds

Inspecode can be configured to automatically set a job status to Failed if the number of issues exceeds a certain threshold. The example below shows how to configure rocro.yml in order to set the status to Failed if the number of issues is greater than 10:

inspecode:
  thresholds:
    num-issues: 10 # Allow up to 10 Issues for the entire job

Furthermore, Inspecode also lets developers set a threshold at the task level. When the threshold is set at the task level, the status of the job will be set to Failed if any of its tasks fails. Here is how to configure rocro.yml in order to set a threshold at the task level:

inspecode:
  rubocop:
    thresholds:
      num-issues: 5 # Allow up to 5 Issues of RuboCop
  misspell:
    thresholds:
      num-issues: 10 # Accept Issue of misspelling with 10 tickets

Inspecode was engineered to allow the highest level of customization. Hence, job level thresholds and task level threshold can be mixed. Below you can find an example:

inspecode:
  thresholds:
    num-issues: 10 # Allow up to 10 Issues in the entire job
  rubocop:
    thresholds:
      num-issues: 5 # Allow up to 5 Issues of RuboCop
  misspell:
    thresholds:
      num-issues: 10 # Accept Issue of misspelling with 10 tickets

Configuring Job Status Using Severity Levels

With Inspecode, developers can set the thresholds with even more granularity. For example, a threshold can be set for the number of issues that have a level of severity greater or equal than a specified value. Check out our blog for more details about how to configure thresholds on severity levels.

How to Use Inspecode’s Automated Pull Request Review

We assume that you are already familiar with GitHub and, as a result, we will not explain in detail how to create a pull request.

Once a pull request is created, Rocro will automatically start to scan your code for issues. Depending on your plan and the complexity of your project, this might take a while. For large projects, we advise you to upgrade to the professional plan by heading to Inspecode’s settings page. For each new pull request, Rocro will immediately update its status on the GitHub page:

pr_update_status

Let’s suppose a few bugs are introduced with the new pull request and the pull request review failed due to a threshold setting. Inspecode will display an error message:

pr_review_failed

Now, click on the 'Details' button and you will be directed to Rocro website where you will be presented with the detailed description of the issue:

pr_detailed_description

Based on this detailed analysis, let’s fix the issue. Once you commit the changes, Rocro will automatically start to analyze them. Again, the status of your pull request will be updated in a matter of seconds:

pr_update_status2

When the checks are finished, Inspecode will update the status accordingly:

pr_success_status

Well done! You learned how to use Inspecode’s automated pull request review to effortlessly identify and fix issues in your code. We hope that Inspecode’s automated pull request review will become a powerful tool for improving your code quality.

Happy coding!

results matching ""

    No results matching ""