Capturing commit discussions in GitLab

You can capture entire commit discussions in IBM® Engineering Workflow Management (Engineering Workflow Management) work items that are referenced in a Git commit message. For example, if the Git commit message is Fix for defect 320 and a discussion occurs about this commit in GitLab, then each discussion comment is captured in defect 320.

Before you begin

Make sure that you have completed the tasks described in Configuring the basic integration with GitLab.

A shared user base, such as a common LDAP, between Engineering Workflow Management and the GitLab/GitLab Enterprise server is optional. It is recommended to add an Engineering Workflow Management functional user ID to the webhook configuration. Ensure that the functional user is authorized for Git requests.

About this task

In the commit message, these keywords are recognized as work item references: work item, workitem, rtcwi, bug, task, defect, and #.

Note: While performing a commit operation where # is used, and discussion occurs about the commit, then that discussion is not captured in the work item. For example, if the Git commit message is Fix for #320, and the discussions occur about this commit, then the discussion comment is not captured in the work item 320.

You must configure a webhook for each GitLab Enterprise repository to commit discussions in work items.

Procedure

  1. In the web client, log on to the Change and Configuration Management. For example, go to https://host_name:9443/ccm/web.
  2. Click Source Control > Work with Git.
  3. Click Browse Registered Git Repositories.
  4. Select the repository that you registered.
  5. Expand the Host Server Configuration section.
  6. Ensure that the Hosting Server field is set to GitLab.
  7. In the Secret Key Authorization field, enter a secret. This secret is provided when you configure the webhook in GitLab.
  8. Optional: If GitLab and Engineering Workflow Management do not share a user base, then a functional user is required. To use a functional user ID for a webhook URL, click Insert Functional User. Select the user and click OK.
  9. Click Save to persist the changes to the Git Repository Registration page in Engineering Workflow Management.
  10. Copy the web hook URL.
  11. To add the webhook URL to the GitLab repository, follow the instructions in Web hooks.
  12. Under Trigger select Comments and Issues.
  13. In the Secret Token field, enter the value that you entered in the Secret Key Authorization field.
  14. Click Save to save the webhook configuration in GitLab.
  15. Optional: To disable replication of the commit discussion in work items:
    1. In the web client, log on to Change and Configuration Management. For example, go to https://host_name:9443/ccm/web.
    2. On the CCM project page, click Source Control > Work with Git.
    3. Click Browse Registered Git Repositories.
    4. Select the repository that you registered.
    5. Expand the GitHub/GitLab Configuration section.
    6. Clear Replicate comments from commit or issue discussion.
    7. Click Save.