Adds GitHub Commit Status for the corresponding pull request commit and asks for the bundle stats changes review when the check fails.
The review flow allows you to require the review of the RelativeCI report based on a set of conditions specific to the project. Reviewing the bundle changes during the code review process helps to identify regressions easily and fix them before shipping to production.
To enable the GitHub Commit Status review integration, navigate to your Project -> Settings -> Integrations -> GitHub Commit Status review page and add the conditions you want to evaluate for each job. You can base a condition on any metric absolute or relative change. For example, to ask for a review when the Bundle Size increases with more than
10KB, select Bundle Size - Absolute difference metric, Greater than operator, and enter
To quickly set up the check, click the "Add recommended conditions" button to load a set of recommended conditions, update the values to match your needs and save the settings.
When the conditions set evaluates to true, the review will be required, and the GitHub commit status will be set to Pending. To review and approve or reject the changes, click the GitHub commit status "Details" link to navigate to the RelativeCI job review section.
Click on the metric label to navigate to the corresponding section of the report and evaluate the changes.
Based on the user's action(approve or reject), the status of the review will be set to "Success" or "Error".
If the conditions set evaluates to false, the check passes, the GitHub commit status will be set to "Success", and no action will be required:
Require GitHub status check to pass before merging
By default, GitHub enables users to merge a pull request regardless of the check status. You can activate a branch protection rule to block the pull request and require the users to review the RelativeCI bundle stats report. To manage a branch protection rule, navigate to your GitHub project Settings -> Branches -> Protect matching branches and click Add rule or Edit. Activate Require status checks to pass before merging option, search for relative-ci check and select it.
When the branch rule matches and the RelativeCI status check is
pending, the user action will be required to review and approve the RelativeCI bundle stats changes:
After the bundle stats changes are reviewed and approved, the RelativeCI status check is set to
success and GitHub will allow the pull request merge: