Multiple Omni models can share the same git repository. If you’re connecting a model to a repository that’s already connected to another model, you only need to complete the Omni-side setup—the repository’s deploy key and webhooks are already configured.
Requirements
To follow the steps in this guide, you’ll need:- Omni Connection Admin permissions for the model you want to connect to git
- An existing repository
- Permissions in that allow you to:
Setup
Retrieve the repository's SSH URL
- In your browser, navigate to the Azure DevOps repository you want to connect to Omni.
- Click the Clone button near the top right corner of the page.
- Click the SSH option to display the repository’s SSH URL.
Connect the repository to Omni
- In Omni, click Develop.
- Click the model you want to connect to git.
- In the model IDE, click Model > Git settings.
- You’ll be prompted to enter connection details for the repository:
- Git Provider - Select from the dropdown.
- SSH URL - Copy and paste the repository’s SSH URL from Step 1.
- Base Branch - Enter the name of the default branch for the repository. Omni will default to
mainunless a different name is specified.
- Click Configure Git.
Add an SSH public key
- Browse to the Azure DevOps web portal (ex:
https://dev.azure.com/<your-org-name>/). - Click the User settings icon next to your avatar in the top right corner of the page.
- Click SSH public keys.
- On the page that displays, click + New Key.
- In the Add New SSH Key panel that displays, fill in the following:
- Name - Enter a descriptive name, such as Omni Snowflake Model
- Public Key Data - Copy and paste the Public key from the Omni Git settings page
- Click Add.
Add repository webhooks
You’ll create three webhook subscriptions for the Azure DevOps repository, one for each of the following event types:
- Pull request created
- Pull request updated
- Repository status updated
Create the webhook subscription
- Navigate to the Azure DevOps project that contains the repository you want to connect to Omni.
- Click Project settings.
- Click Service hooks, located in the General section of the left navigation.
- On the Service Hooks page, click the + icon or Create subscription.
- On the Service screen, click Web Hooks and then Next.
Configure the Trigger
- On the Trigger screen, select one of the following for the Trigger on this type of event field.
- Pull request created
- Pull request updated
- Repository status updated
- Select the Repository you want to connect to Omni.
- If the Target branch field displays, select the main branch.
- When finished, click Next.
Configure the Action
On the Action screen, fill in the fields as follows:
- URL - Copy and paste the Webhook URL from the Omni Git settings page
- Basic auth username -
omni - Basic auth password - Copy and paste the Webhook secret from the Omni Git settings page
- HTTP headers - The value of this field depends on the type of event being configured:
- Pull request created -
x-azuredevops-omni-event:created - Pull request updated -
x-azuredevops-omni-event:update-push - Repository status updated -
x-azuredevops-omni-event:update-status
- Pull request created -