danger 9.4.2 → 9.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 235adb876d4329ef24664c6139ed7266298db3f672415e83cf78d1b9dfb87af9
|
4
|
+
data.tar.gz: 359771a09da8778f29d3d6d0fa26d803474813ae8d4a154fdef66489f7b3919b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee8c64ffa617f2dc8e4c9dd00861dfac8243c6898cd4b10f2185358b95bbe3278ab6d3265db375cd6cb7fc33d1b5e6c7499db879a735f8e22e46737e5fc8a2da
|
7
|
+
data.tar.gz: 82bc4ac05e20fda0f0fc0936ed14eeadb8446effd43f65c673edbdcb6af364c3c0c22106bf8e3d667e1efba1e11ee9e9d9d83b7f13818b85779159f9bcbed9ad
|
@@ -252,14 +252,16 @@ module Danger
|
|
252
252
|
end
|
253
253
|
|
254
254
|
def submit_inline_comments!(warnings: [], errors: [], messages: [], markdowns: [], previous_violations: [], danger_id: "danger")
|
255
|
-
# Avoid doing any fetchs if there's no inline comments
|
256
|
-
return {} if (warnings + errors + messages + markdowns).select(&:inline?).empty?
|
257
|
-
|
258
|
-
diff_lines = self.pr_diff.lines
|
259
255
|
pr_comments = client.pull_request_comments(ci_source.repo_slug, ci_source.pull_request_id)
|
260
256
|
danger_comments = pr_comments.select { |comment| Comment.from_github(comment).generated_by_danger?(danger_id) }
|
261
257
|
non_danger_comments = pr_comments - danger_comments
|
262
258
|
|
259
|
+
if (warnings + errors + messages + markdowns).select(&:inline?).empty?
|
260
|
+
delete_old_inline_violations(danger_comments: danger_comments, non_danger_comments: non_danger_comments)
|
261
|
+
return {}
|
262
|
+
end
|
263
|
+
|
264
|
+
diff_lines = self.pr_diff.lines
|
263
265
|
warnings = submit_inline_comments_for_kind!(:warning, warnings, diff_lines, danger_comments, previous_violations["warning"], danger_id: danger_id)
|
264
266
|
errors = submit_inline_comments_for_kind!(:error, errors, diff_lines, danger_comments, previous_violations["error"], danger_id: danger_id)
|
265
267
|
messages = submit_inline_comments_for_kind!(:message, messages, diff_lines, danger_comments, previous_violations["message"], danger_id: danger_id)
|
@@ -267,6 +269,17 @@ module Danger
|
|
267
269
|
|
268
270
|
# submit removes from the array all comments that are still in force
|
269
271
|
# so we strike out all remaining ones
|
272
|
+
delete_old_inline_violations(danger_comments: danger_comments, non_danger_comments: non_danger_comments)
|
273
|
+
|
274
|
+
{
|
275
|
+
warnings: warnings,
|
276
|
+
errors: errors,
|
277
|
+
messages: messages,
|
278
|
+
markdowns: markdowns
|
279
|
+
}
|
280
|
+
end
|
281
|
+
|
282
|
+
def delete_old_inline_violations(danger_comments: [], non_danger_comments: [])
|
270
283
|
danger_comments.each do |comment|
|
271
284
|
violation = violations_from_table(comment["body"]).first
|
272
285
|
if !violation.nil? && violation.sticky
|
@@ -285,13 +298,6 @@ module Danger
|
|
285
298
|
client.delete_pull_request_comment(ci_source.repo_slug, comment["id"]) if replies.empty?
|
286
299
|
end
|
287
300
|
end
|
288
|
-
|
289
|
-
{
|
290
|
-
warnings: warnings,
|
291
|
-
errors: errors,
|
292
|
-
messages: messages,
|
293
|
-
markdowns: markdowns
|
294
|
-
}
|
295
301
|
end
|
296
302
|
|
297
303
|
def messages_are_equivalent(m1, m2)
|
@@ -343,8 +349,10 @@ module Danger
|
|
343
349
|
|
344
350
|
if matching_comments.empty?
|
345
351
|
begin
|
352
|
+
# Since Octokit v8, the signature of create_pull_request_comment has been changed.
|
353
|
+
# See https://github.com/danger/danger/issues/1475 for detailed information.
|
346
354
|
client.create_pull_request_comment(ci_source.repo_slug, ci_source.pull_request_id,
|
347
|
-
body, head_ref, m.file, position)
|
355
|
+
body, head_ref, m.file, (Octokit::MAJOR >= 8 ? m.line : position))
|
348
356
|
rescue Octokit::UnprocessableEntity => e
|
349
357
|
# Show more detail for UnprocessableEntity error
|
350
358
|
message = [e, "body: #{body}", "head_ref: #{head_ref}", "filename: #{m.file}", "position: #{position}"].join("\n")
|
data/lib/danger/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.4.
|
4
|
+
version: 9.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Orta Therox
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-02-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: claide
|
@@ -344,7 +344,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
344
344
|
- !ruby/object:Gem::Version
|
345
345
|
version: '0'
|
346
346
|
requirements: []
|
347
|
-
rubygems_version: 3.3.
|
347
|
+
rubygems_version: 3.3.7
|
348
348
|
signing_key:
|
349
349
|
specification_version: 4
|
350
350
|
summary: Like Unit Tests, but for your Team Culture.
|