GitLab CI/CD#

GitLab is a powerful Continuous Integration/Continuous Delivery (CI/CD) tool, which operates on the basis of Git repositories. GitLab lays an administration layer over Git repositories which, among other things, allows repositories to be organized in groups and controls access to the repositories. In addition, there are many possibilities to implement a CI/CD process.

The GitLab-Allegra integration offers

  • Assignment of Git commits to items

  • Assignment of Git branches to items (in progress)

  • Assignment of Git Pull Requests to items (in progress)

  • List of changed files per item

  • List of Git commits in cockpit tile

  • An integrated repository browser

  • Direct links to the GitLab repository browser (in progress)

To link commits and files in your Git repository with Allegra, you must include a reference to affected items in your commit comment in the form “#<item number>”, e.g. “#4711”. To integrate a version control system, an appropriate plug-in must be installed in the directory $ALLEGRA_HOME/plugins. For the respective project or workspace, the function “Version Control” must be activated (Administration > Workspaces > <Workspace> > Version Control). In this view, you can make all necessary settings for connecting to a Git repository.

Configuring GitLab Projects#

Each Allegra workspace can be assigned a GitLab project. If multiple repositories are needed, correspondingly many subordinate Allegra workspaces can be created and then repositories can be assigned to them. The configuration is therefore done via a project and there via the navigation point “Version Control”.

Each GitLab project manages an associated Git repository. Allegra must be able to access the GitLab project and the underlying repository. Therefore, the GitLab project must also be made known in Allegra. The following settings are used for this purpose.

GitLab Server Name and Server Port#

The URL and the Git port to the repository server

GitLab Project ID#

In GitLab, each project has an identification number. The project number uniquely identifies a GitLab project on a GitLab server and is exactly assigned to one Git repository.

../../_images/vcconfig.png

Configuration of the GitLab integration#

Item Number Pattern#

Allegra links those commits that reference Allegra item numbers in their commit message. Branches and Pull Requests can also be marked in this way.

The embedded item numbers are recognized based on the regular expression set here. If workspace-specific item numbers are set, all prefixes followed by a hyphen followed by a number are searched for.

Type

How

Example

Branch

Branches are linked if the item number is contained in the

CDU-9022-Restructuring of the GitLab integration branch name.

Commit

Commits are linked if the item number is contained in the commit message.

Revise GitLab integration (#4711, #3302)

PR

Pull requests are linked if the error key is contained in the title of the pull request or in the name of the source branch.

DSGV-1119 - Redesign of the login screen

Authentication Methods#

The system supports the following authentication methods:

  • Anonymous : Only for direct access via the file protocol

  • Password: You use username and password

  • Public/private key: You use a key pair

  • Token: You use an access token generated by GitLab.

Repository Browser#

The system has an integrated repository browser. You can access it via the cockpit tile “Version Control” and when editing an item by clicking on the commit, branch or Pull Request link.

In addition, you can jump directly to the GitLab browser, which is particularly pleasant when GitLab and Allegra are protected with the same SSO system.

Allegra Update by Git#

Allegra can synchronize its version control data with a GitLab server in two ways:

  1. Via a time-controlled automatic process every x minutes, where x can be adjusted in the file $ALLEGRA_HOME/quartz-jobs.xml.

  2. Via a Rest endpoint. When the system receives a POST request there, it updates all version control data. The URL is: {Allegra Server URL}/rest/vcPlugin/fetchLogs. You can use this endpoint URL in hook scripts of your Git or GitLab server.

Version Control Cockpit Tile#

The version control cockpit tile can display all version control activities in an Allegra project, regardless of the underlying version control system. If you click on the associated link, you will be taken to the version control browser, depending on the configuration, to the internal or an external one.

../../_images/vctile.png

Cockpit tile for version control display#

Version Control in Item View#

In the lower part of the item editing mask, the “Version Control” tab shows all commits, branches, and pull requests assigned to this item. The linking is done as described above using the item numbers as part of the commit text or the name for branches and pull requests.

../../_images/vctab.png

Commits, branches and pull requests assigned to the item#

Integrated Repository Browser#

The internal repository browser is a good alternative to the browser of the GitLab server, especially if there is no single sign-on integration.

../../_images/vcbrowser.png

The internal repository browser#