Class: Pronto::Gitlab
Instance Method Summary
collapse
Methods inherited from Client
#initialize
Constructor Details
This class inherits a constructor from Pronto::Client
Instance Method Details
3
4
5
6
7
8
9
|
# File 'lib/pronto/gitlab.rb', line 3
def (sha)
@comment_cache[sha.to_s] ||= begin
client.(slug, sha).auto_paginate.map do ||
Comment.new(sha, .note, .path, .line)
end
end
end
|
48
49
50
51
52
53
|
# File 'lib/pronto/gitlab.rb', line 48
def ()
@config.logger.log("Creating commit comment on #{.sha}")
client.(slug, .sha, .body,
path: .path, line: .position,
line_type: 'new')
end
|
#create_pull_request_review(comments) ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/pronto/gitlab.rb', line 30
def create_pull_request_review()
return if .empty?
.each do ||
options = {
body: .body,
position: position_sha.dup.merge(
new_path: .path,
position_type: 'text',
new_line: .position,
old_line: nil,
)
}
client.create_merge_request_discussion(slug, pull_id, options)
end
end
|
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/pronto/gitlab.rb', line 11
def (sha)
@comment_cache["#{slug}/#{pull_id}"] ||= begin
arr = []
client.merge_request_discussions(slug, pull_id).auto_paginate.each do ||
.notes.each do |note|
next unless note['position']
arr << Comment.new(
sha,
note['body'],
note['position']['new_path'],
note['position']['new_line']
)
end
end
arr
end
end
|