Connecting Repositories to Software Components (prev. Services)

You can map where all of a component's code and configuration reside by associating repositories to it. OpsLevel supports sophisticated relationships such as monorepos.

Visualize Components

Connecting repositories to your components allows you to keep track of how your services and repositories are related.

There are multiple ways to visualize the connections between your components and repositories. This can be done from the Repositories List Page, Repository Details Page and from a Component Page.

Repositories List Page

From the Repositories List Page you can see which components are connected to each of your repositories from the Connected Components column.

Repositories Connected Services

Repository Details Page

From a Repository Details Page you can see which components are connected to your repository from the Components card.

Repository Connected Services

This page also shows you which paths are being used by which components. This is especially useful when dealing with monorepos.

Repository Connected Services Paths

Component Page

You can also view which repositories are used by a particular component from a Component page.

Navigate to a component's Summary Tab. From there, you can see the repositories and paths are used by your component in the Repositories card.

Service Repositories Card

Connecting Components

Repositories List Page

To connect a component to your repository from the Repositories List Page, hover over a None field in the Connected Components column and click on the pencil icon.

Repositories Connected Service

After clicking the pencil icon, you can select a component from the dropdown menu.

Repositories Connected Services Dropdown

If you have a lot of components, you can use type ahead search to find your component.

Repositories Connected Services Typeahead

If this repository is storing the code for a component that’s not yet tracked in OpsLevel, you can add that component in OpsLevel by clicking + Create Component.

Repositories Create Service

When adding a component to OpsLevel from a repository, the repository to component connection will happen automatically.

Repository Details Page

You can only edit the connected components from a Repository Details Page if the repository does not have any connected components defined. To connect a component to your repository from the Repository page, visit a repository that has no connected components. Press the Select a Component dropdown.

Repository Connected Service

If you have a lot of components, you can type ahead search to find your component.

Repository Service Dropdown

If this repository is storing the code for a component that’s not yet tracked in OpsLevel, you can add that component in OpsLevel by clicking + Create Component.

Repository Service Create

When adding a software component to OpsLevel from a repository, the repository to component connection will happen automatically.

Component Page

To connect or edit repository connections from the Component page, navigate to the component you wish to connect your repository. Once there, navigate to the Summary tab.

Service Show Summary Tab

Click the Edit button on the Repositories card.

Service Show Repo Edit

Then click the ”+ Add Repository”.

Service Show Add Repo

From the Create Repo modal, you can select the repository you wish to connect from the Repository field and click the Create button.

Service Show Repository Select

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 component. This is especially useful if you are using monorepos.

Service Show Repo Directory

You can also choose to sync the repository’s owner with your component by clicking on the Sync Owner checkbox.

Service Show Repo Owner Sync

opslevel.yml

You can also define which repositories are connected to your components 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 components to different paths in your repository.

To specify which path of a repository is connected to your microservice, refer to the Component Page subsection of Connecting Components.

You can see which repository path is connected to your component from the Repositories Card on a component page.

Service Show Connected Paths