Skip to main content

Show the GitLab tab on a component

Each annotated component gets a GitLab tab and a GitLab releases card on its Overview.

Two steps: turn on the plugin, annotate the component.

What it shows, and to whom​

WhereWhat
GitLab tabThree sub-tabs with their count: Pipelines (Pipeline, Branch, Result, Trigger, Started), Merge requests (open ones: Merge request, Author, Branch, Updated), Branches (the default one marked default, protected ones protected)
GitLab releases card of the OverviewThe project's releases, with their tag and date. No release yet. when there is none.

Anyone who can open the component sees them. Astrolabe reads GitLab with the administrator's token, the same for everyone.

1. πŸ”Œ Turn on the plugin​

  1. In Administration, under PLATFORM, click Plugins.

  2. On the GitLab card, click the switch at the top right of the card. It turns on at once, without confirmation.

If the card says Configure the GitLab integration first, click it: the integration opens in Company connections. Add it (Add the GitLab integration). The plugin turns on by itself when you save the integration: go to step 2.

2. 🏷️ Annotate the component​

In the component's catalog-info.yaml, name its project as <namespace>/<project>, subgroups included (for example my-group/sub-group/shop-api):

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: shop-api
annotations:
gitlab.com/project-slug: my-group/shop-api # <namespace>/<project> on GitLab
spec:
type: service
lifecycle: production
owner: group:default/platform-team
The annotation is the only source

Astrolabe never guesses the project from the address the component was registered from. A component without the annotation has no GitLab tab.

3. πŸ“₯ Put the component in the catalog​

  • One component: in the sidebar, click Catalog, then Register an existing component at the top right. Paste the address of the catalog-info.yaml file on GitLab (for example https://gitlab.com/my-group/shop-api/-/blob/main/catalog-info.yaml), click Analyze, then Import, then View Component.
  • A whole group: use the GitLab catalog provider. See Import your GitLab projects.

βœ… Check​

Open the component. The GitLab tab is after Docs. The Overview shows a GitLab releases card.

βœ… That's it!

Next: Add the GitLab cards to your dashboard.