danger 5.5.2 → 5.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/danger/request_sources/vsts.rb +13 -3
- data/lib/danger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d75a6731cebfdb3a94769a4b7feeb516a03b6d6
|
4
|
+
data.tar.gz: b376cef50c81d7d0b6c79faab79c913b28b49543
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f61c8acf0c455cf6aa64b3d99beade05a612c1793b9c0fde6bb44926e9cc748c6604b068b3c73bc3524aa6cf12c0bb2aedfb03fcabbe352fb3d916b34f70a988
|
7
|
+
data.tar.gz: f14d5fad53e755eef0e0474882db237be1609486a4f89435138a236fb1f420fce8fb7bf80860a7ddb1682bd240a01432859e4fd54adbf9556ebaaa4cf683113e
|
@@ -87,21 +87,31 @@ module Danger
|
|
87
87
|
danger_id: danger_id,
|
88
88
|
template: "vsts")
|
89
89
|
if new_comment
|
90
|
-
|
90
|
+
post_new_comment(comment)
|
91
91
|
else
|
92
92
|
update_old_comment(comment, danger_id: danger_id)
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
|
+
def post_new_comment(comment)
|
97
|
+
@api.post_comment(comment)
|
98
|
+
end
|
99
|
+
|
96
100
|
def update_old_comment(new_comment, danger_id: "danger")
|
101
|
+
comment_updated = false
|
97
102
|
@api.fetch_last_comments.each do |c|
|
98
103
|
thread_id = c[:id]
|
99
104
|
comment = c[:comments].first
|
100
105
|
comment_id = comment[:id]
|
101
106
|
comment_content = comment[:content].nil? ? "" : comment[:content]
|
102
|
-
|
103
|
-
|
107
|
+
# Skip the comment if it wasn't posted by danger
|
108
|
+
next unless comment_content.include?("generated_by_#{danger_id}")
|
109
|
+
# Updated the danger posted comment
|
110
|
+
@api.update_comment(thread_id, comment_id, new_comment)
|
111
|
+
comment_updated = true
|
104
112
|
end
|
113
|
+
# If no comment was updated, post a new one
|
114
|
+
post_new_comment(new_comment) unless comment_updated
|
105
115
|
end
|
106
116
|
end
|
107
117
|
end
|
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: 5.5.
|
4
|
+
version: 5.5.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: 2017-10-
|
12
|
+
date: 2017-10-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: claide
|