-
Notifications
You must be signed in to change notification settings - Fork 1
glmap: Commits
Commmits works the same way as GitHub Commits.
It works the same way as GitHub Commits but GitLab has a specific event for starting a conversation on a list of code of a commit: CreateCommitReviewComment.
The following table shows the mapping of the events generated by GitLab for commits. A fully detailed mapping can be found below.
| Action | target_type | action | détection |
|---|---|---|---|
PushCommits |
null | pushed to |
push_data.action = pushed |
CreateCommitReviewComment |
DiffNote |
commented on |
note.noteable_type = Commit |
CreateCommitComment |
Note |
commented on |
note.noteable_type = Commit |
CreateCommitThread |
DiscussionNote |
commented on |
note.noteable_type = Commit |
| Activity | Actions | time window |
|---|---|---|
CommentCommits |
- CreateCommitComment - Opt - Rep - CreateCommitThread - Opt - Rep - CreateCommitReviewComment - Opt - Rep
|
300s |
PushCommits |
PushCommits - Rep
|
2s |
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)
Triggered when commits are pushed to a repository. Multiple commits can be pushed at the same time and the number of commits will be stored in push_data.total_commits_count.
Detection:
-
action_name=pushed to -
target_type=null -
push_data.action=pushed
Details:
-
commit.id=push_data.commit_to -
commit.title=push_data.commit_title -
commit.count=push_data.commit_count -
branch.name=push_data.ref
Triggered when a conversation (thread) is started on a part of the code of a commit. This event is not part of the regular review process which has a specific event for that.
Detection:
-
action_name=commented on -
target_type=DiffNote -
note.noteable_type=Commit
Details:
-
commit.title=target_title -
review.file=note.position.new_path -
review.line=note.position.new_line -
commit_review_comment.id=note.id -
commit_review_comment.body=note.body
Triggered when a comment is made on a commit.
Detection:
-
action_name=commented on -
target_type=Note -
note.noteable_type=Commit
Details:
-
commit.title=target_title -
commit_comment.id=note.id -
commit_comment.body=note.body
Triggered when a conversation (thread) is started on a commit.
Detection:
-
action_name=commented on -
target_type=DiscussionNote -
note.noteable_type=Commit
Details:
-
commit.title=target_title -
commit_comment.id=note.id -
commit_comment.body=note.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: 300s
Based on ghmap, we will group all comments made on the commits of the same repository.
Actions:
-
CreateCommitComment- optional - repeatable -
CreateCommitThread- optional - repeatable -
CreateCommitReviewComment- optional - repeatable
time window: 2s
Based on ghmap, we will also group all pushes made consecutively in the same repository.
The use of the command "git push" generates only one action even if multiple commits are pushed at the same time. Grouping with a time window of 2 seconds ensures that we will group pushes made consecutively.
Actions:
-
PushCommits- mandatory - repeatable