Class: Gitlab::HookData::MergeRequestBuilder
Constant Summary
Constants inherited
from BaseBuilder
BaseBuilder::MARKDOWN_SIMPLE_IMAGE
Instance Attribute Summary
Attributes inherited from BaseBuilder
#object
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from BaseBuilder
#initialize
Class Method Details
.safe_hook_attributes ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/gitlab/hook_data/merge_request_builder.rb', line 6
def self.safe_hook_attributes
%i[
assignee_id
author_id
blocking_discussions_resolved
created_at
description
draft
head_pipeline_id
id
iid
last_edited_at
last_edited_by_id
merge_commit_sha
merge_error
merge_params
merge_status
merge_user_id
merge_when_pipeline_succeeds
milestone_id
reviewer_ids
source_branch
source_project_id
state_id
system
target_branch
target_project_id
time_estimate
title
updated_at
updated_by_id
prepared_at
].freeze
end
|
.safe_hook_relations ⇒ Object
41
42
43
44
45
46
47
48
49
|
# File 'lib/gitlab/hook_data/merge_request_builder.rb', line 41
def self.safe_hook_relations
%i[
assignees
labels
reviewers
total_time_spent
time_change
].freeze
end
|
Instance Method Details
#build ⇒ Object
52
53
54
55
|
# File 'lib/gitlab/hook_data/merge_request_builder.rb', line 52
def build
merge_request.attributes.with_indifferent_access.slice(*self.class.safe_hook_attributes)
.merge!(additional_attributes)
end
|