Add YAML-based PR Gates to Code Coverage docs#34625
Open
ManuelPalenzuelaDD wants to merge 7 commits intomasterfrom
Open
Add YAML-based PR Gates to Code Coverage docs#34625ManuelPalenzuelaDD wants to merge 7 commits intomasterfrom
ManuelPalenzuelaDD wants to merge 7 commits intomasterfrom
Conversation
Document the new `gates` field in `code-coverage.datadog.yml` that allows users to define PR coverage gates as code in their repository, alongside the existing UI-based configuration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
nikita-tkachenko-datadog
approved these changes
Feb 17, 2026
Contributor
nikita-tkachenko-datadog
left a comment
There was a problem hiding this comment.
The YAML gates work for flags too, right? We should mention this, and maybe add a per-flag gate to the list of examples
…d YAML gates Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
domalessi
reviewed
Feb 17, 2026
Contributor
domalessi
left a comment
There was a problem hiding this comment.
Left a few suggestions, but overall this looks fantastic! Thanks for the PR!
|
|
||
| ## PR Gates | ||
|
|
||
| You can define [PR Gates][2] directly in the configuration file to enforce code coverage thresholds on pull requests. Gates defined in the configuration file work alongside gates configured in the [Datadog UI][2]—both sets of rules are evaluated when a PR is opened or updated. |
Contributor
There was a problem hiding this comment.
Suggested change
| You can define [PR Gates][2] directly in the configuration file to enforce code coverage thresholds on pull requests. Gates defined in the configuration file work alongside gates configured in the [Datadog UI][2]—both sets of rules are evaluated when a PR is opened or updated. | |
| You can define [PR Gates][2] in the configuration file to enforce code coverage thresholds on pull requests. If gates are also configured in the [Datadog UI][2], Datadog evaluates both the configuration file rules and the UI rules when a PR is opened or updated. |
Comment on lines
183
to
189
| - `type` (required): The type of coverage gate. Supported values: | ||
| - `total_coverage_percentage`: Enforces a minimum overall coverage percentage for the repository (or scoped services/code owners). | ||
| - `patch_coverage_percentage`: Enforces a minimum coverage percentage on code changed in the pull request. | ||
| - `config` (required): Gate configuration options. | ||
| - `threshold` (required): The minimum coverage percentage required (0–100). | ||
| - `services`: (optional) List of service name patterns to scope the gate to. Use `*` as a wildcard. When specified, the gate evaluates coverage for matching services independently. | ||
| - `codeowners`: (optional) List of code owner patterns to scope the gate to. Use `*` as a wildcard. When specified, the gate evaluates coverage for matching code owners independently. |
Contributor
There was a problem hiding this comment.
Suggested change
| - `type` (required): The type of coverage gate. Supported values: | |
| - `total_coverage_percentage`: Enforces a minimum overall coverage percentage for the repository (or scoped services/code owners). | |
| - `patch_coverage_percentage`: Enforces a minimum coverage percentage on code changed in the pull request. | |
| - `config` (required): Gate configuration options. | |
| - `threshold` (required): The minimum coverage percentage required (0–100). | |
| - `services`: (optional) List of service name patterns to scope the gate to. Use `*` as a wildcard. When specified, the gate evaluates coverage for matching services independently. | |
| - `codeowners`: (optional) List of code owner patterns to scope the gate to. Use `*` as a wildcard. When specified, the gate evaluates coverage for matching code owners independently. | |
| - `type` (required): The type of coverage gate. Supported values: | |
| - `total_coverage_percentage`: The minimum overall coverage percentage for the repository (or for the scoped services or code owners). | |
| - `patch_coverage_percentage`: The minimum coverage percentage on code changed in the pull request. | |
| - `config` (required): Gate configuration options. Supported values: | |
| - `threshold` (required): The minimum coverage percentage (0-100). | |
| - `services`: (optional) A list of service name patterns to scope the gate to. Use `*` as a wildcard. When set, coverage is evaluated separately for each matching service. | |
| - `codeowners`: (optional) A list of code owner patterns to scope the gate to. Use `*` as a wildcard. When set, coverage is evaluated separately for each matching code owner. |
Co-authored-by: domalessi <111786334+domalessi@users.noreply.github.com>
Co-authored-by: domalessi <111786334+domalessi@users.noreply.github.com>
Co-authored-by: domalessi <111786334+domalessi@users.noreply.github.com>
…d rename example Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gatesfield incode-coverage.datadog.ymlthat allows users to define PR coverage gates as code in their repositoryconfiguration.mdwith full gate syntax reference, field descriptions, and collapsible examples (basic, service-scoped, code owner-scoped)setup.mdPR Gates section to present both UI and YAML configuration optionsmonorepo_support.mdto add a "Using the YAML configuration file" subsection for service/code owner-scoped gatesThis PR shouldn't be merged until we finalize deploying the feature.