Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a note on new repos needing a commit for resync pickup #1680

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ This page outlines the following steps:
- If you choose the real-time & always-on installation method, a Kubernetes cluster to install the integration on.
- Your Port user role is set to `Admin`.


## Setup

### Create a GitLab group access token
Expand Down Expand Up @@ -162,20 +161,23 @@ By default, if `appHost` is provided, the integration will create group webhooks

#### System Webhooks

To create a system hook there are two options:
To create a system hook in GitLab, you must set `useSystemHook: true` and choose one of these setup methods:
phalbert marked this conversation as resolved.
Show resolved Hide resolved

:::note
In both options you'll need to provide the `useSystemHook` parameter with the value `true`.
:::
1. **Automatic Setup** - Provide a token with admin privileges using the `tokenMapping` parameter
phalbert marked this conversation as resolved.
Show resolved Hide resolved
2. **Manual Setup** - Create the system hook yourself in GitLab:
- Follow GitLab's [system hook setup guide](https://docs.gitlab.com/ee/administration/system_hooks.html#create-a-system-hook)
phalbert marked this conversation as resolved.
Show resolved Hide resolved
- Set the URL to `{appHost}/integration/system/hook` (e.g., `https://my-gitlab-integration.com/integration/system/hook`)
phalbert marked this conversation as resolved.
Show resolved Hide resolved
- Enable the supported triggers: `push` and `merge_request`
phalbert marked this conversation as resolved.
Show resolved Hide resolved

1. Provide a token with admin privileges in GitLab using the `tokenMapping` parameter.
- When choosing this option, the integration will create the system hook in your GitLab account automatically.
2. Create the system hook manually
- Follow the instructions for creating a system hook in GitLab [here](https://docs.gitlab.com/ee/administration/system_hooks.html#create-a-system-hook).
- In the `URL` field, provide the `appHost` parameter value with the path `/integration/system/hook`. e.g. `https://my-gitlab-integration.com/integration/system/hook`.
- From the `Triggers` section, the GitLab integration currently supports the following events:
- `push`
- `merge_request`
:::info Repository Setup and Initial Commit
Due to GitLab webhook limitations, new repositories require special handling:

- A repository will only appear in Port after its first commit
phalbert marked this conversation as resolved.
Show resolved Hide resolved
- This is because GitLab webhooks don't support `project_create` events
- Empty repositories (no commits) will only appear after the next scheduled resync

For more details, see GitLab's [webhook events documentation](https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html).
:::

![GitLab System Hook](/img/integrations/gitlab/GitLabSystemHook.png)

Expand Down Expand Up @@ -495,3 +497,6 @@ pipeline {
</TabItem>

</Tabs>