PR Gates

Join the Preview!

PR Gates is in Preview.

PR Gates is not available in the selected site () at this time.

Overview

PR Gates allow you to control software quality by configuring rules to block substandard code from deployment. You have control over what is merged into the default branch and deployed to production, and can ensure that the code running in production adheres to high quality standards, reducing incidents and minimizing unwanted behaviors.

An SCA rule that triggers a failure if any library vulnerabilities with critical or high severity are detected in the repository.

Use PR Gates to:

  • Create rules that block workflows using data in Datadog, ensuring that only code that meets your standards end up in production.
  • Give your organization the ability to decide what code makes it to production, enhancing your deployment discipline and mitigating potential issues in live environments.
  • Continually improve code quality and system performance with precise enforcement and customizable rules.

You can configure PR Gates rules for the following categories:

Test Optimization


- New flaky tests
- Code coverage

Static Analysis


- Code vulnerability violations
- Code quality violations

Software Composition Analysis


- Vulnerabilities
- Detected licenses

By integrating PR Gates into your CI/CD pipelines or allowing the Datadog GitHub integration to create status checks on your Pull Requests automatically (currently available for SCA rules only), you can create a robust framework for maintaining and improving software quality that aligns with your organization’s operational goals and business objectives.

Setup

PR Gates offers the following rule types:

You can create rules to block code from being merged that introduces new flaky tests or that decreases code coverage.

A PR Gate rule that blocks when one or more flaky tests occur

You can create rules to block code from being merged when your repository has a certain number of code quality or code vulnerability violations.

A PR Gate rule that fails when one or more new code quality violations of error-level severity are contained in the repository

You can create rules to block code from being merged when your repository has a certain number of library vulnerabilities or forbidden licenses.

A PR Gate rule that fails when one or more critical or high severity library vulnerabilities are contained in the repository

To create a PR Gate rule, see the Setup documentation.

Search rules

You can evaluate and update quality control processes by accessing PR Gates rules on the PR Gates Rules page. Improve your deployment practices based on your project requirements and desired performance outcomes.

List of PR Gate rules in Datadog

To search for PR Gate rules, see the Search and Manage documentation.

Analyze executions in the PR Gates Explorer

You can search and filter for PR gates or rule executions, create visualizations, and export saved views of your search query on the PR Gates Executions page.

PR Gate results in the PR Gates Explorer
PR Gate rule execution results in the PR Gates Explorer

For more information, see the PR Gates Explorer documentation.

Track changes in rules

You can view information about who created, modified, and deleted PR Gates rules in Audit Trail.

A PR Gates event in Datadog Audit Trail

For more information, see the Audit Trail documentation.

Further Reading

PREVIEWING: joepeeples/10684-pr-gates