Blog Post

Introducing Customizable Slack Notifications for Codecov

July 20, 2023 Cassie Gatton

Codecov plus slack logos on purple background.

Code coverage is more than a metric. It’s a tool. While this seems obvious, having tools accessible where work happens makes any job infinitely easier. It’s been no secret you all want actionable coverage data in Slack – where you and your team work.

You already get coverage data in your SCM and in our most recent product update we brought it to your terminal. That said, you’re going to want to install the latest version of our Slack app.

Code Coverage Changes at a Glance

Get automated updates on code coverage changes for your PRs, to quickly identify coverage increases or decreases, and act on areas that need attention immediately. Using the /codecov notify you have full control to customize your notifications and receive targeted updates for the repositories and events that matter to you in any Slack channel.

Now you don’t have to stare impatiently at your browser for coverage to calculate in your PR – you can move on with your work and we’ll notify you of coverage changes as soon someone opens a PR. It couldn’t be easier to pinpoint areas of the code that may be lacking sufficient testing, reducing the risk of undetected bugs and vulnerabilities. Addressing coverage decreases and ensuring comprehensive testing, helps you maintain high code quality, improve maintainability, and minimize the likelihood of introducing issues hitting production, – do this all while in Slack.

Comprehensive PR List

In addition to rich notifications, you can pull a list of PRs and a summarized view of coverage changes with a simple slash command.

Compare Result Screenshot

Get all the context around changes in your code base to see how they impact fluctuation in code coverage. Isolate the root cause of shifts in test coverage to new code, modified existing code, or simply if tests were removed.

The best part is that this isn’t limited to just a PR list, you can also pull a list of flags, components, commits, and branches all in – you guessed it… right in Slack.

Efficiently Compare Commits

Say you want to see if there was a decrease in coverage over time. This could hint at a regression that implies a decrease in test coverage… Run /codecov compare and it’ll return a comparison of two commits helping you figure out what really happened and if you need to do anything about it… or if you need to bug someone else – you do have the commit data after all.

Not to mention, you could also track improvements. Not everyone on your team can be writing terrible code ;). But an increase in coverage between commits could mean that someone is making sure your codebase is high quality and your team is following solid testing practices.

How to get started with Codecov for Slack

  1. Install the Slack app to your workspace: https://notifications.codecov.io/slack/install
  2. Mention @Codecov to invite the bot to your channel (If you’re adding a private repo you may need to authenticate using /codecov login.)
  3. Enter/codecov notify repository=<name_of_repo> service=<provider_name> username=<repo_owner_name> to enable notifications for specific repos. To add multiple repositories to a channel just run the /codecov notify command again.
  4. Use /codecov help to view the library of commands to customize your experience. Check out the docs for more customization settings.

With these updates to our Slack integration, you can stay informed and explore Codecov details directly within your Slack workspace.

Try out the Codecov for Slack integration today and let us know what you think. If you’re new to Codecov you can try it for free today or request a demo to get started.

Before we redirect you to GitHub...
In order to use Codecov an admin must approve your org.