Skip to content

Commit

Permalink
[#53411] 13.4 Documentation: GitLab integration - review
Browse files Browse the repository at this point in the history
  • Loading branch information
dominic-braeunlein committed Mar 18, 2024
1 parent e62148a commit 0e39d85
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions docs/system-admin-guide/integrations/gitlab-integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ First you will need to create a user in OpenProject that has the permission to m

![GitLab role with required permissions in OpenProject](openproject-system-guide-gitlab-integration-role.png)

This user will then have to be **added to each project** with a role that allows them to see work packages and comment on them.
This user will then have to be **added to each project** with a role that allows them to see work packages and comment on them.

![GitLab user added as member to project with respective role](openproject-system-guide-gitlab-integration-project-member.png)

Expand All @@ -48,11 +48,11 @@ Once the user is created you need to generate an OpenProject API token for this
3. Go to [*Access Tokens*](../../../getting-started/my-account/#access-tokens)
4. Click on **+ API token**

> Make sure you copy the generated key an securely save it, as you will not be able to retrieve it later.
> Make sure you copy the generated key and securely save it, as you will not be able to retrieve it later.
You can then configure the necessary webhook in [GitLab](#gitlab).

Finally you will need to activate the GitLabmodule under [Project settings](../../../user-guide/projects/project-settings/modules/) so that all information pulling through from GitLab will be shown in the work packages.
Finally you will need to activate the GitLab module under [Project settings](../../../user-guide/projects/project-settings/modules/) so that all information pulling through from GitLab will be shown in the work packages.

![Activate a GitLab module in OpenProject](openproject-system-guide-gitlab-integration-project-modules.png)

Expand Down Expand Up @@ -108,6 +108,11 @@ Once you are satisfied with the changes you can create a commit. Within the 'Git

A URL pointing to a work package in the merge request description or a comment will link the two. The link needs to be in the MR and not in a commit, but GitLab will use the first commit message as the proposed branch description (as long as there is only one commit).

!!DO NOT MERGE!!

Should we already mentioned that OP# as a reference in an Issue or MR title works too? When I first read the documentation I missed the part about it later in the text and I thought only linking does work.
!!DO NOT MERGE END!!

![Commit message in a Git client](openproject-system-guide-gitlab-integration-commit-message-in-client.png)

Once the changes are made, you can create your merge request. Title and comment with the link to the respective OpenProject work package will be prefilled, at least if there is only one commit to the branch. Because of this one commit limitation and if the policy is to create a branch as early as possible, there is a third option in the 'Git snippets' menu ('Create branch with empty commit') that will open a branch and add an empty commit to it in one command. Using this option, one can first create the branch quickly and have it linked to the work package right from the beginning. Commits can of course be added to the branch (and PR) after that.
Expand All @@ -118,6 +123,17 @@ The branch description can be amended before a MR is created giving the opportun

Rather than inserting a link to the work package you can also reference it just by adding "OP#388" to the pull request's description where 388 is the ID of the work package

!!DO NOT MERGE!!

Maybe interesting for our docu too?
From https://github.com/btey/openproject-gitlab-integration?tab=readme-ov-file#difference-between-op-and-pp

Difference between OP and PP

If you use OP# as a reference in an Issue or MR title, all comments will be replicated in OpenProject. However, sometimes you may only want to keep information about the status of an Issue/MR in OpenProject, but you don't want your comments to be published. In this case, you can use PP# as a reference. This way the comments will not be published in OpenProject. But if at any time one of your comments in a private Issue/MR is of interest to you to be published in OpenProject you can use OP# directly in that comment. So only that comment will be published in OpenProject. The rest of the comments will remain private and will not be published.

!!DO NOT MERGE END!!

![Open a GitLab merge request](openproject-system-guide-gitlab-integration-create-mr-detail.png)

Click on **Create merge request** and your merge request will be opened.
Expand Down Expand Up @@ -150,4 +166,4 @@ You can either create a new issue in GitLab, or edit an already existing one. En

Once you save your changes or create a GitLab issue, it will become visible under the **GitLab** tab in OpenProject.

![New GitLab issues shown in OpenProject work packages](openproject-system-guide-gitlab-integration-new-issues.png)
![New GitLab issues shown in OpenProject work packages](openproject-system-guide-gitlab-integration-new-issues.png)

0 comments on commit 0e39d85

Please sign in to comment.