Skip to main content

GitLab Integration

The GitLab integration removes the barrier of manually updating information from GitLab to Hive. With this integration, Hive Actions can be associated with GitLab branches and automatically capture branch activity.

Written by Ellen Kajca

Overview

Your team can quickly view and jump to commits, merge requests, and branches from Hive.

The workflow can also be automated so that an action's status in Hive updates accordingly when a merge request is opened, closed, or merged.


Setting up the integration

Workspace admins can enable the GitLab integration for your workspace from the Hive Apps page:

Step 1: Enable in Hive

1. Navigate to your workspace Apps page

2. Find "GitLab" under Integrations and toggle it on

3. Click the "Open" button to manage the integration

4. Copy the GitLab Payload URL and Secret from Hive

Step 2: Configure the webhook in GitLab

1. Go to the GitLab project you want to connect

2. Navigate to Settings > Webhooks

3. Fill in the webhook fields:

URL: Paste the Payload URL copied from Hive

Secret token: Paste the GitLab Secret copied from Hive

Trigger: Select "Push events", "Merge request events", and any other events you want to track

4. Click "Add webhook"


Associating Hive Actions with GitLab branches

Once enabled, the GitLab integration will show a new section when you open Actions in Hive. If you open an action, you'll see a new button to "Attach branch".

From here, you can enter a branch name you'd like to track. Once added, any branch activity which happens after initial integration setup will appear on the Action.

Once Hive catches activity on the branch, this area will populate with that activity and provide quick links to it. You'll also have quick links to view the branch or merge request on GitLab from here.


Automatically update the status of Hive Actions from GitLab events

One of the primary benefits of the integration is the ability to automatically update Hive Action statuses on events like merge request open, close, and merge.

Example workflow

Let's assume the following setup:

Your project has the following statuses:

Unstarted, In Development, Ready for Review, Completed

Your team's git workflow for a new story:

1. You have a stable branch in GitLab called "main"

2. You check out a new branch called "feature/add-login-screen" off of "main"

3. Changes are committed and pushed on the feature branch

4. A merge request is opened to merge changes from "feature/add-login-screen" into "main"

You can use Hive's GitLab Event Handlers to automatically update the Status of an Action in Hive when a Merge Request in GitLab is opened, merged, or closed.

Configuring an event handler

Go to the GitLab Integration menu and select "Add event handler". From here you can:

1. Select the event to listen to (e.g., "When a merge request is opened")

2. Select the target branch (e.g., "main")

3. Select the status to set the associated action to (e.g., "Ready for Review")

4. Save the event handler

Testing it out

To verify the event handler works:

1. Create an Action in Hive called "Add a new login screen"

2. Open the GitLab integration on that Action and attach the branch name "feature/add-login-screen"

3. In GitLab, check out and push changes to a branch called "feature/add-login-screen"

4. In GitLab, open a new Merge Request to merge changes from "feature/add-login-screen" into "main"

At this point, the Event Handler in Hive should automatically update the Status of the Action to "Ready for Review" (so long as the branch was attached to the Action in Hive).


Add branches from different repositories to a card

For each repository you'd like to make available to your workspace, follow the steps above to set up the GitLab webhooks.

Then, on an action card, simply prefix the branch names with the repository name.

Example

Let's say we have connected two repositories: HiveWeb and HiveDesktop.

1. On an action card, click the GitLab integration icon and add "HiveWeb:feature/branch-name"

2. Click the add icon again to add a branch from the other repository, such as "HiveDesktop:feature/branch-name"

Now both branches are tracked in Hive!

Did this answer your question?