Class: LabClient::MergeRequest
Overview
Inspect Helper rubocop:disable Metrics/ClassLength
Instance Attribute Summary
Attributes inherited from Klass
#client, #response
Attributes inherited from LabStruct
#response
Instance Method Summary
collapse
#has?, #keys, #raw
Methods inherited from Klass
#api_methods, #collect_project_id, #collect_release_id, #collect_repository_id, date_time_attrs, #format_time?, #group_name, #help, #initialize, #klass, #success?, #to_json, #update_self, user_attrs, #valid_group_project_levels, #verbose
Methods included from Docs
#demo, #desc, #doc, docs, #example, #group_name, #help, json, #markdown, #navigation, #option, #result, #subtitle, #title
Methods included from CurlHelper
#curl
Methods inherited from LabStruct
#as_json, #client, #keys, #slice, #success?
Instance Method Details
#accept(query = {}) ⇒ Object
54
55
56
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 54
def accept(query = {})
client.merge_requests.accept(project_id, iid, query)
end
|
#add_spent_time(duration) ⇒ Object
70
71
72
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 70
def add_spent_time(duration)
client.merge_requests.add_spent_time(project_id, iid, duration)
end
|
#approvals ⇒ Object
132
133
134
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 132
def approvals
client.approvals.merge_request.show(project_id, iid)
end
|
#approvals_rule_create(query = {}) ⇒ Object
144
145
146
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 144
def approvals_rule_create(query = {})
client.approvals.merge_request.create_rule(project_id, iid, query)
end
|
#approvals_rule_delete(approval_rule_id) ⇒ Object
152
153
154
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 152
def approvals_rule_delete(approval_rule_id)
client.approvals.merge_request.delete_rule(project_id, iid, approval_rule_id)
end
|
#approvals_rule_update(approval_rule_id, query = {}) ⇒ Object
148
149
150
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 148
def approvals_rule_update(approval_rule_id, query = {})
client.approvals.merge_request.update_rule(project_id, iid, approval_rule_id, query)
end
|
#approvals_rules ⇒ Object
140
141
142
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 140
def approvals_rules
client.approvals.merge_request.rules(project_id, iid)
end
|
#approvals_update(approvals_required) ⇒ Object
136
137
138
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 136
def approvals_update(approvals_required)
client.approvals.merge_request.update(project_id, iid, approvals_required)
end
|
#approve(query = {}) ⇒ Object
156
157
158
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 156
def approve(query = {})
client.approvals.merge_request.approve(project_id, iid, query)
end
|
#assignees ⇒ Object
22
23
24
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 22
def assignees
@table[:assignees].map { |x| User.new(x, response, client) } if has? :assignees
end
|
#cancel_auto_merge ⇒ Object
62
63
64
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 62
def cancel_auto_merge
client.merge_requests.cancel_auto_merge(project_id, iid)
end
|
#changes ⇒ Object
30
31
32
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 30
def changes
client.merge_requests.changes(project_id, iid)
end
|
#closes_issues ⇒ Object
86
87
88
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 86
def closes_issues
client.merge_requests.closes_issues(project_id, iid)
end
|
#commits ⇒ Object
34
35
36
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 34
def commits
client.merge_requests.commits(project_id, iid)
end
|
#create_pipeline ⇒ Object
42
43
44
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 42
def create_pipeline
client.merge_requests.create_pipeline(project_id, iid)
end
|
#delete ⇒ Object
50
51
52
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 50
def delete
client.merge_requests.delete(project_id, iid)
end
|
#diff_versions ⇒ Object
114
115
116
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 114
def diff_versions
client.merge_requests.diff_versions(project_id, iid)
end
|
#inspect ⇒ Object
9
10
11
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 9
def inspect
"#<MergeRequest id: #{id}, title: #{title}, state: #{state}>"
end
|
#merge_ref ⇒ Object
58
59
60
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 58
def merge_ref
client.merge_requests.merge_ref(project_id, iid)
end
|
#note_create(query) ⇒ Object
102
103
104
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 102
def note_create(query)
client.notes.merge_requests.create(project_id, iid, query)
end
|
#notes ⇒ Object
98
99
100
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 98
def notes
client.notes.merge_requests.list(project_id, iid)
end
|
#participants ⇒ Object
26
27
28
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 26
def participants
client.merge_requests.participants(project_id, iid)
end
|
#pipelines ⇒ Object
38
39
40
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 38
def pipelines
client.merge_requests.pipelines(project_id, iid)
end
|
#project ⇒ Object
Default to Source Project
119
120
121
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 119
def project
client.projects.show(source_project_id)
end
|
#rebase(skip_ci = false) ⇒ Object
66
67
68
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 66
def rebase(skip_ci = false)
client.merge_requests.rebase(project_id, iid, skip_ci)
end
|
#reload ⇒ Object
174
175
176
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 174
def reload
update_self client.merge_requests.show(project_id, iid)
end
|
#reset_spent_time ⇒ Object
82
83
84
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 82
def reset_spent_time
client.merge_requests.reset_spent_time(project_id, iid)
end
|
#reset_time_estimate ⇒ Object
78
79
80
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 78
def reset_time_estimate
client.merge_requests.reset_time_estimate(project_id, iid)
end
|
#resource_label(resource_event_id) ⇒ Object
169
170
171
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 169
def resource_label(resource_event_id)
client.resource_labels.merge_requests.show(project_id, iid, resource_event_id)
end
|
#resource_labels ⇒ Object
165
166
167
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 165
def resource_labels
client.resource_labels.merge_requests.list(project_id, iid)
end
|
#source_project ⇒ Object
123
124
125
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 123
def source_project
client.projects.show(source_project_id)
end
|
#subscribe ⇒ Object
90
91
92
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 90
def subscribe
client.merge_requests.subscribe(project_id, iid)
end
|
#target_project ⇒ Object
127
128
129
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 127
def target_project
client.projects.show(target_project_id)
end
|
#time_estimate(duration) ⇒ Object
74
75
76
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 74
def time_estimate(duration)
client.merge_requests.time_estimate(project_id, iid, duration)
end
|
#time_stats ⇒ Object
110
111
112
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 110
def time_stats
client.merge_requests.time_stats(project_id, iid)
end
|
#todo ⇒ Object
106
107
108
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 106
def todo
client.merge_requests.todo(project_id, iid)
end
|
#unapprove ⇒ Object
160
161
162
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 160
def unapprove
client.approvals.merge_request.unapprove(project_id, iid)
end
|
#unsubscribe ⇒ Object
94
95
96
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 94
def unsubscribe
client.merge_requests.unsubscribe(project_id, iid)
end
|
#update(query) ⇒ Object
46
47
48
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 46
def update(query)
update_self client.merge_requests.update(project_id, iid, query)
end
|
#wait_for_merge_status(total_time = 300, sleep_time = 15) ⇒ Object
Wait for Import / Set a Hard Limit
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
|
# File 'lib/labclient/merge_requests/merge_request.rb', line 179
def wait_for_merge_status(total_time = 300, sleep_time = 15)
Timeout.timeout(total_time) do
loop do
reload
puts "Waiting for Merge Status: #{merge_status}"
break if %w[can_be_merged unchecked].include? merge_status
raise "Cannot be merged! #{import_error}" if %w[cannot_be_merged cannot_be_merged_recheck].include? merge_status
sleep sleep_time
end
end
end
|