-
Notifications
You must be signed in to change notification settings - Fork 1
glmap: Issues
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 |
Detectionare the values used to detect what action has been performed.Detailsare information found in the payload of the event that can be used to group actions to activities. (name_in_action=name_in_payload)
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
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
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
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
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)
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
-
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
-
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
-