danger-reviewer 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/reviewer/gem_version.rb +1 -1
- data/lib/reviewer/plugin.rb +6 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 986550a4967226d9bd65ddde539227323417ebf35e44c6bddb1436793eeed209
|
4
|
+
data.tar.gz: da424356a4e826dc023cd324d33cce31f25d42cb8e7c4db156bbaab0301640ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea68c83a38e6dc365467e1849c95498b4afc23001121d7debbc12cbf1f78d77c00e53d2254b308106dc32f94ecbc4999a81037f0e8f568f09d28bd2ea8f570e0
|
7
|
+
data.tar.gz: bf2aee355857a5fc30bb0a5b2c847f8d4878f5ca0aefd5d9a3edef97b1949dda7ae64b4f422c34047ce5e666a3f7b9a16e6de0926f281a1562295bd139386075
|
data/lib/reviewer/gem_version.rb
CHANGED
data/lib/reviewer/plugin.rb
CHANGED
@@ -9,7 +9,7 @@ module Danger
|
|
9
9
|
current_count = current_reviewers_count
|
10
10
|
|
11
11
|
# Check if we already have enough reviewers
|
12
|
-
return if current_count >= max_reviewers
|
12
|
+
return if current_count >= max_reviewers || current_count == -1
|
13
13
|
|
14
14
|
authors = find_authors
|
15
15
|
members = team_members(team)
|
@@ -42,7 +42,7 @@ module Danger
|
|
42
42
|
|
43
43
|
git.modified_files.each do |file|
|
44
44
|
result = GitHub::Client.query(GitHub::BlameQuery, variables: { repository: repo, owner: owner, ref: branch, file: file })
|
45
|
-
next if result.data.repository.ref.nil?
|
45
|
+
next if result.data.nil? || result.data.repository.ref.nil?
|
46
46
|
result.data.repository.ref.target.blame.ranges.each do |range|
|
47
47
|
lines = (range.ending_line - range.starting_line) + 1
|
48
48
|
users[range.commit.author.user.login] += lines unless range.commit.author.user.nil?
|
@@ -73,12 +73,16 @@ module Danger
|
|
73
73
|
owner, repo = env.ci_source.repo_slug.split('/')
|
74
74
|
|
75
75
|
result = GitHub::Client.query(GitHub::ReviewerQuery, variables: { repo: repo, owner: owner, number: github.pr_json[:number] })
|
76
|
+
return -1 if result.data.nil?
|
77
|
+
|
76
78
|
result.data.repository.pull_request.review_requests.edges.count + result.data.repository.pull_request.reviews.edges.count
|
77
79
|
end
|
78
80
|
|
79
81
|
def team_members(team)
|
80
82
|
owner, repo = env.ci_source.repo_slug.split('/')
|
81
83
|
result = GitHub::Client.query(GitHub::MemberQuery, variables: { organization: owner, team: team})
|
84
|
+
return [] if result.data.nil?
|
85
|
+
|
82
86
|
result.data.organization.team.members.edges.map { |edge| edge.node.login }
|
83
87
|
end
|
84
88
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-reviewer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikko Kokkonen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-plugin-api
|
@@ -208,8 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
208
|
- !ruby/object:Gem::Version
|
209
209
|
version: '0'
|
210
210
|
requirements: []
|
211
|
-
|
212
|
-
rubygems_version: 2.7.3
|
211
|
+
rubygems_version: 3.0.1
|
213
212
|
signing_key:
|
214
213
|
specification_version: 4
|
215
214
|
summary: Danger plugin to automatically request reviews from potential users on pull
|