Skip to content

TAP GUI - GitLab Integration

TAP GUI is the central component of TAP where people can interact with TAP.

This also makes it a good place to integrate with other tools that are part of the daily software development cycles.

In this guide we look at how you can integrate GitLab with TAP GUI1.

Possible integrations with GitLab:

  1. Authentication
  2. Trust Catalog Items Source
  3. Catalog Items

Authentication

TAP GUI is based on Backstage2. For authentication, TAP GUI relies on the plugins that Backstage supports.

As such, the TAP GUI documentation3 offers nothing but a reference to the Backstage auth docs)4.

One of the plugins that is installed by default, is the GitLab Auth provider. Through it, we can defer authentication to TAP GUI to GitLab5.

Steps To Take

The steps to take, to configure GitLab as the auth provider for TAP GUI are as follows:

  1. Create an OAuth App on GitLab, as described in the Backstage docs5
  2. Add the Provider configuration to the View cluster's Sensitive values

Configuration Example

view-profile-sensitive-values-snippet.yaml
tap_install:
  sensitive_values:
    tap_gui:
      service_type: ClusterIP
      app_config:
        auth:
          environment: development
          providers:
            gitlab:
              development:
                clientId: 9d0ad...........50038
                clientSecret: c9dd6............4e0dee
                audience: https://gitlab.services.mydomain.com/

Once the updated configuration is applied, you can now log in via GitLab.

Trust Catalog Items Source

One of the core features of Backstage is the Sofware Catalog6.

The Backstage Software Catalog is a centralized system that keeps track of ownership and metadata for all the software in your ecosystem (services, websites, libraries, data pipelines, etc). The catalog is built around the concept of metadata YAML files stored together with the code, which are then harvested and visualized in Backstage. 6

To ingest Software Catalog items, Backstage (or TAP GUI) needs to trust the source.

Backstage trusts public sites such as GitHub.com by default. When you self-host GitLab, we need to add the GitLab integration7.

To ensure everything works well, we need the GitLab URL and a Personal Access Token (PAT)8.

I encountered that only specifying my Host and PAT where not enough, so this is the GitLab integration snippet I've used.

tap_install:
  sensitive_values:
    tap_gui:
      app_config:
        integrations:
          gitlab:
            - host: gitlab.services.mydomain.com
              token: glpat-dVnf.....UhvC
              apiBaseUrl: https://gitlab.services.mydomain.com/api/v4
              baseUrl: https://gitlab.services.mydomain.com

Catalog Items

Backstage supports three ways of ingesting Catalog Items:

  1. Upload a YAML file via the GUI
  2. Add a static item to the TAP GUI configuration
  3. Add a Discovery to the TAP GUI configuration

The first is straight forward, you go the the TAP GUI, click Register Entity and paste the URL pointing to a Catalog item.

For the second and third options we update the TAP install values.

You can read more about performing Catalog operations from the Tanzu docs9.

Static Catalog Entry

Adding static entries is straightforward.

The property catalog.locations takes an array of location, which has a type and target property. See an example below:

tap_install:
  sensitive_values:
    tap_gui:
      app_config:
        catalog:
          locations:
            - type: url
              target: https://gitlab.services.my-domain.com/joostvdg/tap-catalog/~/blob/main/catalog/catalog-info.yaml
            - type: url
              target: https://gitlab.services.my-domain.com/joostvdg/tap-hello-world/~/blob/main/catalog/catalog-info.yaml

Automatic Discovery

The Discovery feature lets Backstage scan all repositories in your GitLab instance (to which the PAT has access) to discover catalog items10.

Warning

This plugin in not installed by default (in Backstage):

As this provider is not one of the default providers, you will first need to install the gitlab catalog plugin:

And I haven't tried if TAP GUI does, so you might have to tweak your Backstage.

This is supported starting TAP 1.711.

References


Last update: 2023-11-23 22:47:00