Skip to main content
Git v2 is available for GitHub repositories. To have Git v2 turned on for your organization, reach out to Omni support.
With Git v2, Omni checks each pull request that changes a model’s files.

How it works

When a commit arrives on a pull request branch, Omni checks it together with the latest changes on the base branch. The results show what the shared model will be after the pull request merges. Omni runs three checks, in this order:
  1. Build: Confirms that Omni can read the model files.
  2. Sync: Confirms that the pull request and its Omni branch match.
  3. Validation: Counts the validation errors the change introduces.
Omni reports the result on the pull request in GitHub as a commit status and a comment. See What you see on the pull request. You set the severity of each check in a configuration file in the repository. To stop a pull request from merging when a check fails, see Block merges on a failed check. Omni also runs the build and validation checks on each commit to the base branch before it pulls the commit into the shared model. See Checks on base branch commits.

Pull request checks

The build and validation checks need an Omni branch for the pull request. To have Omni create a branch for every pull request, turn on Always create branches. If the pull request has no Omni branch, Omni skips the build and validation checks. See The pull request has no Omni branch.

Build

The build check confirms that Omni can read the model files in the commit. It fails in these cases:
  • A file isn’t valid YAML.
  • A required parameter is missing.
  • A parameter has an invalid value.
  • Two parameters can’t be used together. For example, a view has both query and sql.
If the build check fails, the commit status fails. The comment shows Omni could not read the model files with the error underneath, and Omni skips the sync and validation checks. To fix it, see The build check fails.

Sync

The sync check confirms that the pull request and its Omni branch match. It fails in these cases:
  • Omni couldn’t pull the commit into the branch.
  • The Omni branch has edits that aren’t pushed to the pull request.
  • The Omni branch has edits that conflict with the pull request. See Resolve conflicts.
When the sync check passes, the comment says what Omni did with the commit. For example: These changes are already loaded into Omni, or Omni has not pulled this commit into the branch yet; pull it from the IDE.

Validation

The validation check runs model validation on the pull request. It fails when the pull request introduces a validation error. The comment shows the number of new errors and warnings, and the number of issues that already exist in the shared model. For example: 1 new error, 2 existing issues not counted. The comment also lists up to 15 of the new issues, with the message and YAML location for each.

What you see on the pull request

Commit status

Omni posts one commit status for each model in the repository. The status name is Model: followed by the model path, such as Model: omni/Marketing. In the summary, each check has one of these markers:
  • ✅ - The check passed.
  • ❌ - The check failed.
  • » - Omni skipped the check.
A passing status shows ❌ for a failed check that is set to warn. For example, with the default settings, a commit with validation errors gets a passing status that reads ✅ Build · ✅ Sync · ❌ Validation. The Details link on the status opens Omni’s comment on the pull request.

Comment

Omni posts one comment for each model and updates the same comment on each new commit. The comment shows the result of each check and links to the branch in Omni. For example:
Example comment

Block merges on a failed check

To block a merge on a failed check, set the check’s severity to error and require the commit status in GitHub.
1

Set the check's severity to error

By default, the build check is the one check set to error. To have a failed sync or validation check fail the commit status too, set sync and validation to error in .omni/config.yaml:
.omni/config.yaml
2

Require the status in GitHub

In GitHub, add a branch protection rule for the repository’s base branch that requires status checks to pass before merging. Select the status named Model: <model_path> for each model that must pass, such as Model: omni/Marketing.See GitHub’s documentation on protected branches for the steps.

Next steps