Connecting Repositories to Services
You can map where all of a service's code and configuration reside by associating repositories to it. OpsLevel supports sophisticated relationships such as monorepos.
Visualize Services
Connecting repositories to your services allows you to keep track of how your services and repositories are related.
There are multiple ways to visualize the connections between your services and repositories. This can be done from the Repositories List Page, Repository Details Page and from a Service Page.
Repositories List Page
From the Repositories List Page you can see which services are connected to each of your repositories from the Connected Services column.
Repository Details Page
From a Repository Details Page you can see which services are connected to your repository from the Services card.
This page also shows you which paths are being used by which services. This is especially useful when dealing with monorepos.
Service Page
You can also view which repositories are used by a particular service from a Service page.
Navigate to a service’s Summary Tab. From there, you can see the repositories and paths are used by your service in the Repositories card.
Connecting Services
Repositories List Page
To connect a service to your repository from the Repositories List Page, hover over a None field in the Connected Services column and click on the pencil icon.
After clicking the pencil icon, you can select a service from the dropdown menu.
If you have a lot of services, you can use type ahead search to find your service.
If this repository is storing the code for a service that’s not yet tracked in OpsLevel, you can add that service in OpsLevel by clicking + Create Service.
When adding a service to OpsLevel from a repository, the repository to service connection will happen automatically.
Repository Details Page
You can only edit the connected services from a Repository Details Page if the repository does not have any connected services defined. To connect a service to your repository from the Repository page, visit a repository that has no connected services. Press the Select a Service dropdown.
If you have a lot of services, you can type ahead search to find your service.
If this repository is storing the code for a service that’s not yet tracked in OpsLevel, you can add that service in OpsLevel by clicking + Create Service.
When adding a service to OpsLevel from a repository, the repository to service connection will happen automatically.
Service Page
To connect or edit repository connections from the Service page, navigate to the service you wish to connect your repository. Once there, navigate to the Summary tab.
Click the Edit button on the Repositories card.
Then click the ”+ Add Repository”.
From the Create Repo modal, you can select the repository you wish to connect from the Repository field and click the Create button.
Note: If you have a lot of repositories, you can use type ahead search from this dropdown.
From this modal, you can also choose which Directory in the repository you wish to connect to your service. This is especially useful if you are using monorepos.
You can also choose to sync the repository’s owner with your service by clicking on the Sync Owner checkbox.
opslevel.yml
You can also define which repositories are connected to your services using opslevel.yml
. Refer to the opslevel.yml docs for more information.
Monorepos
A monorepo is a single repository that stores all the code and assets for your project. Some monorepos house many microservices. In this case, it’s important to know how all your microservices are related to your repository. This can be done by connecting services to different paths in your repository.
To specify which path of a repository is connected to your microservice, refer to the Service Page subsection of Connecting Services.
You can see which repository path is connected to your service from the Repositories Card on a service page.
Updated 6 months ago