CodSpeed provides a performance status check to your branches and pull requests. The status of this check is based on the performance change between the current branch and your main branch (and the project's regression threshold).
You can configure the performance check to fail if the performance metrics of a branch or pull request are overshooting your regression threshold. Thus, blocking the pull request from being merged if the performance issue is neither fixed nor acknowledged.
Setup performance checks
Once your project has run at least one benchmark, you can go to your repository's settings on GitHub.
Under the "Code and automation" section open the "Branches" tab.
Add a new branch protection rule or update the one already protecting your main branch.
In branch name pattern enter the name of your main branch (typically
Tick the "Require status checks to pass before merging" checkbox.
Under this section search for "CodSpeed Performance Analysis" and click on the item to enable the check.
Save the changes and you're done! 🎉
Acknowledge regressions or benchmark drops
If you're aware of performance issues that are not yet fixed or were totally intentional, you can acknowledge them to prevent the performance check from failing.
When working with an organization's repository, only the admins are allowed to acknowledge regressions.
Once all the regressions are fixed or acknowledged, the performance check will pass and you can safely merge your pull request while being aware of your performance issues.
Acknowledge a single benchmark
First, head to the CodSpeed report (you can access it from the link in the inline performance report or directly from your CodSpeed Dashboard).
Then, go to the failing benchmark:
Click on the icon or anywhere on the benchmark to expand its content:
Click on the "Acknowledge regression" button and that's it 🎉 :
Acknowledge multiple benchmarks
If you have multiple benchmarks failing, a header will appear at the top of the Failing benchmarks list, and a checkbox will be available for each benchmark to select:
By selecting benchmarks, the Acknowledge selected button will be enabled. Click on it to acknowledge all the selected benchmarks:
Once acknowledged, the benchmarks will move down to the Passing list: