PR comments are automated comments added by Datadog’s source code management integrations to inform developers of issues detected in their code changes and, in certain cases, suggest remediation.
PR comments are not supported in pull requests in public repositories, or on pull requests targeting a destination branch in a different repository from the source branch (that is, forked repositories trying to merge into the main repository).
There is a maximum of 31 unique comments per PR at any time to reduce noise and clutter. These comments include:
- One summary comment is always posted to give a high-level view of all the issues Datadog detected in the PR. This comment is edited by Datadog as new commits pushed to the PR change the results.
- For products that post inline comments, such as Code Security, up to 30 inline comments are posted. Each one appears on the line of code that triggered a violation. If more than 30 violations are introduced in the PR’s diff, the 30 highest severity violations are posted.
- Datadog posts a 👀 reaction on the description of the PR when a product that has PR comments (or PR Gates) enabled is still waiting for results to arrive. After all results have arrived:
- If all results are positive, the reaction is changed to 👍.
- If there is at least one finding, the 👀 reaction is removed because the summary comment includes details on the findings instead.
PR comments for CI Visibility
PR comments are enabled by default when first onboarding to CI Visibility if a source code management integration is installed correctly. Datadog posts a comment summarizing the failed jobs detected in your pull request.
To disable PR comments for CI Visibility:
- Open CI/CD Optimization > Settings > Repositories.
- Choose where to apply the setting:
- Select the Organization tab to disable PR comments for every repository by default.
- Select the Repository-specific tab to disable PR comments for a single repository.
- Under General, toggle PR Comments off.
The PR Comments setting controls PR comments for both CI Visibility and Test Optimization.
PR comments for Code Security
PR comments are enabled by default when first onboarding to Code Security if a source code management integration is installed correctly. Datadog posts two types of comments on your pull requests:
- A single comment summarizing the new violations detected in your pull request.
- Inline comments for each violation detected in your pull request placed directly on the lines of code that triggered the violation in the diff of the pull request.
To disable PR comments for Code Security, go to the Code Security Repository Settings.
PR comments for Test Optimization
PR comments are enabled by default when first onboarding to Test Optimization if a source code management integration is installed correctly. Datadog posts a comment summarizing the failed and flaky tests detected in your pull request.
To disable PR comments for Test Optimization, toggle PR Comments off in CI/CD Optimization > Settings > Repositories, as described in the PR comments for CI Visibility section. This setting also disables PR comments for CI Visibility.
Further reading
Additional helpful documentation, links, and articles: