Skip to content

glmap: Issues

Cyril Moreau edited this page May 22, 2025 · 4 revisions

Issues works like GitHub Issues, but GitLab offers different type of issues. For more information, see the GitLab documentation.

In this case, GitLab does not have an specific event for reopening an issue. It is considered as opening a new issue.

The following table shows the mapping of the events generated by GitLab for Issues. A fully detailed mapping can be found below.

Action target_type action detection
CreateIssue issue opened
CloseIssue issue closed
CreateIssueThread DiscussionNote commented on note.noteable_type = Issue
CreateIssueComment Note commented on note.noteable_type = Issue
Activity Actions time window
CreateIssue - CreateIssue
- CreateIssueComment - Opt
- CreateIssueThread - Opt
3s
CloseIssue - CloseIssue
- CreateIssueComment - opt
- CreateIssueThread - Opt
3s
CommentIssue -CreateIssueComment - Opt - Rep
-CreateIssueThread - Opt - Rep
300s

1 - Actions

  • Detection are the values used to detect what action has been performed.
  • Details are information found in the payload of the event that can be used to group actions to activities. (name_in_action = name_in_payload)

1.1 - CreateIssue

Event triggered when we create a new issue or when we reopen an issue.

Detection:

  • action_name = opened
  • target_type = issue

Details:

  • issue.id = target_id (Id overall)
  • issue.iid = target_iid (Id in the project)
  • issue.title = target_title

1.2 - CloseIssue

Event triggered when we close an issue.

Detection:

  • action_name = closed
  • target_type = issue

Details:

  • issue.id = target_id (Id overall)
  • issue.iid = target_iid (Id in the project)
  • issue.title = target_title

1.3 - CreateIssueComment

Detection:

  • action_name = commented on
  • target_type = Note
  • note.noteable_type = Issue

Details:

  • issue.id = note.noteable_id (IssueID overall)
  • issue.iid = note.noteable_iid (IssueID in the project)
  • issue.title = target_title
  • note.id = target_id (CommentID overall)
  • note.iid = target_iid (CommentID in the project)
  • note.body = target_body

1.4 - CreateIssueThread

We can Create a comment where other comments can be added, creating a thread.

Detection:

  • action_name = commented on
  • target_type = DiscussionNote
  • note.noteable_type = Issue

Details:

  • issue.id = note.noteable_id (IssueID overall)
  • issue.iid = note.noteable_iid (IssueID in the project)
  • issue.title = target_title
  • note.id = target_id (CommentID overall)
  • note.iid = target_iid (CommentID in the project)
  • note.body = target_body

2 - Activities

Each activity is composed of one or more actions. Each action can be repeatable and can be optional. A maximum time window is also defined for each activity and it is used to group actions that are close to each other in time.

For each action, we can define a verification function (validate_with) to make sure that the action is part of the activity. (e.g comments are made on the same issue)

2.1 - CreateIssue

time window = 3s

Normally, only the CreateIssue action is possible. However, since reopening an issue is considered as opening a new issue, we could have a CreateIssueComment or CreateIssueThread action right after the CreateIssue action by reopening an issue with a comment.

Actions:

  • CreateIssue - mandatory - non repeatable
  • CreateIssueComment - optional - non repeatable
    • CreateIssue: issue.id = issue.id
  • CreateIssueThread - optional - non repeatable
    • CreateIssue: issue.id = issue.id

2.2 - CloseIssue

time window = 3s

As in the CreateIssue activity, we could have a CreateIssueComment or CreateIssueThread action right after the CloseIssue action by closing an issue with a comment.

Actions:

  • CloseIssue - mandatory - non repeatable
  • CreateIssueComment - optional - non repeatable
    • CloseIssue: issue.id = issue.id
  • CreateIssueThread - optional - non repeatable
    • CloseIssue: issue.id = issue.id

2.3 - CommentIssue

time window = 300s

Based on ghmap, we group comments made consecutively on the same issue in a time window of 300s. To check if the comments are made on the same issue, we check if the issue.id is the same as other comments.

Actions:

  • CreateIssueComment - optional - repeatable
    • CreateIssueComment: issue.id = issue.id
    • CreateIssueThread: issue.id = issue.id
  • CreateIssueThread - optional - repeatable
    • CreateIssueComment: issue.id = issue.id
    • CreateIssueThread: issue.id = issue.id

Clone this wiki locally