Skip to main content
By default, every environment with PR Plan enabled reports its own check on a pull request, named env0 / PR-Plan / <environment name> (env0 / MR-Plan / <environment name> on GitLab). To block merges on these checks, branch protection has to require each one by name. The aggregated check is one check per pull request, named env0 / PR-Plan on GitHub and env0 / MR-Plan on GitLab. It passes only when every environment the pull request affects has a passing plan, so you require one check instead of one per environment. The aggregated check works with GitHub, GitHub Enterprise, GitLab, and GitLab Enterprise. On other VCS providers, env zero keeps reporting per-environment checks and ignores both settings. On GitLab, a pull request is a merge request.

Prerequisites

Changing the settings requires the Edit Organization Settings permission.
  • Environments with PR Plan enabled, from templates in a GitHub, GitHub Enterprise, GitLab, or GitLab Enterprise repository.
  • Permission to edit the rules that block merges on env zero checks, such as branch protection rules or rulesets on GitHub.

Settings

Both settings are in Organization Settings > Policies, in the PR Plan section. They apply to every repository in the organization. You can also set them with the Update Policy API. Both settings apply from each pull request’s next push. A plan that is already running keeps the behavior of the push that started it.

Move to the aggregated check

1

Turn on the aggregated check

In Organization Settings > Policies, select Report one aggregated PR Plan check per pull request (GitHub and GitLab) and click Save. Each open pull request gets the aggregated check on its next push, next to the per-environment checks.
2

Require the aggregated check

Update every rule that blocks merges on env zero checks to require the aggregated check instead of the per-environment checks. On GitHub, edit the branch protection rule or ruleset of each base branch: add env0 / PR-Plan as a required status check and remove the env0 / PR-Plan / <environment name> checks.Require it only on base branches that have environments with PR Plan enabled. A pull request into any other branch gets no aggregated check, so a rule that requires it there blocks the merge.A pull request that had no push since the previous step has no aggregated check, so a rule that requires it blocks the merge. Push a new commit to it, or an empty one:
3

Stop the per-environment checks

Select Stop reporting per-environment PR Plan checks and click Save. From each pull request’s next push, env zero reports only the aggregated check for PR Plans, including plans started by an env0 plan comment on the latest commit.
To go back, reverse the order: clear Stop reporting per-environment PR Plan checks, push to each open pull request, move your merge rules back to the per-environment checks, and then clear the aggregated check.

How the check decides

The check covers the environments the push evaluated:
  • Environments whose PR Plan the push started. Only their plan for the pull request’s latest commit counts.
  • Environments that the push did not plan but that were planned earlier in the pull request, still match its changed files, and are not locked. Their latest plan in the pull request counts.
Every other environment counts as not affected. It appears as a number and does not change the result. If more than one row applies, the first one wins. For example, one cancelled plan makes the check cancelled while other plans are still running. A pull request whose base branch has no environments with PR Plan enabled gets no aggregated check.

Read the results

On GitHub, the pull request’s Checks tab shows env0 / PR-Plan with:
  • A title with the counts, failures first. For example, 1 failed, 15 passed, 4 running, 980 not affected.
  • Each environment as its project path and name, linked to its plan in env zero, grouped by Failed, Cancelled, Replaced in the queue before it ran, Running, Not started, and Passed. Passed is collapsed.
  • The number of environments the pull request does not affect.
On GitLab, env0 / MR-Plan shows the counts as its description. On both, the check links to the first failed plan in env zero. Without a failed plan, it links to the env zero docs. env zero writes a change of result after a short delay. On GitHub, it also refreshes the counts at most every 5 minutes. On GitLab, it writes only when the result changes, so the counts can be behind until then. PR comments do not change: each plan still comments on the pull request.

Re-run the check

On GitHub, click Re-run on env0 / PR-Plan to re-plan the failed, cancelled, and replaced plans on the pull request’s latest commit. The check goes back to in progress until they finish. If the pull request has a newer commit than the check, the re-run does nothing. On both GitHub and GitLab, re-running one environment’s plan in env zero, or commenting env0 plan, also updates the check.