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β
| Where | What |
|---|---|
| GitLab tab | Three 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 Overview | The 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β
-
In Administration, under PLATFORM, click Plugins.
-
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
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.yamlfile on GitLab (for examplehttps://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!