Cortex connects to many third-party vendors whose system interfaces frequently change. As a result, integration behavior or configuration steps may shift without notice. If you encounter unexpected issues, check with your system administrator or refer to the vendor’s documentation for the most current information. Additionally, integration sync times vary and are subject to scheduling overrides and timing variance.
- View code coverage details for entities directly in Cortex
- Create Scorecards that track progress and drive alignment on projects involving your Codecov code coverage metrics
How to configure Codecov with Cortex
Prerequisites
Before getting started:- Create a Codecov access token.
Configure the integration in Cortex
- In Cortex, navigate to the Codecov settings page.
- Click Integrations from the main nav. Search for and select Codecov.
- Click Add configuration.
- Configure the Codecov integration form:
- API token: Enter your Codecov access token.
- Host: If you’re using a custom Codecov instance, enter your host URL.
- Make sure to enter the URL without the API path (e.g.,
https://codecov.getcortexapp.com).
- Make sure to enter the URL without the API path (e.g.,
- Click Save.
How to connect Cortex entities to Codecov
Auto discovery of Codecov projects
Cortex will use the GitHub, GitLab, Bitbucket, or Azure DevOps repository as the “best guess” for the corresponding Codecov project, since Codecov projects are connected to repositories. For example, if the GitHub repo associated with your Codecov instance ismy-org/repo, then the entities in Cortex should also be associated with my-org/repo.
The YAML examples on this page show only the
x-cortex-* block. When you add one to an entity descriptor, nest it inside the info section. Blocks at the root level of the file are ignored without an error. For a full example, see Defining entities with YAML.Editing the entity descriptor
The value for
repo should be the full repository because Codecov maps projects by repo.
Flags
Codecov’s flags are used to categorize coverage reports for various features and tests in a given project. Flags allow you to set different statistics for different areas of your code base. For example, if you have a monorepo with multiple unique projects, you can use Codecov flags to evaluate each project with different test coverage metrics.
To pull flags into Cortex, define the flag line in the entity descriptor block.
Using the Codecov integration
Entity pages
With the Codecov integration, you can find code coverage details on an entity’s details page as long as that entity is associated with a repo linked to your Codecov instance. Click Code & security in the entity’s sidebar to see the code coverage for that entity.Scorecards and CQL
With the Codecov integration, you can create Scorecard rules and write CQL queries based on Codecov code coverage metrics. See more examples in the CQL Explorer in Cortex.Code coverage
Code coverage
Code coverage for an entity’s Git repository (out of 100)Definition: Set a threshold that is both challenging and realistic so there’s an incentive for developers to improve.
codecov.codeCoverage()ExampleFor a Scorecard focused on development maturity, you can set a rule to make sure code coverage for a given entity is at least 95%:Setting up a rule based on code coverage can serve as a secondary check to confirm an entity is synced with Codecov and reporting frequently.
View integration logs
This feature is available in Cortex cloud.

Still need help?
The following options are available to get assistance from the Cortex Customer Engineering team:- Email: help@cortex.io, or open a support ticket in the in app Resource Center
- Slack: Users with a connected Slack channel will have a workflow added to their account. From here, you can either @CortexTechnicalSupport or add a
:ticket:reaction to a question in Slack, and the team will respond directly.