danger-dangermattic 1.4.0 → 1.4.2
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 +4 -4
- data/.buildkite/pipeline.yml +2 -3
- data/.buildkite/shared-pipeline-vars +6 -0
- data/.github/workflows/reusable-run-danger.yml +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +16 -0
- data/Gemfile.lock +20 -21
- data/danger-dangermattic.gemspec +0 -1
- data/lib/dangermattic/gem_version.rb +1 -1
- data/lib/dangermattic/plugins/common/github_utils.rb +17 -5
- data/spec/github_utils_spec.rb +15 -6
- metadata +4 -20
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2b4e690fcc9caf3b7a5866caab5ea70379af827f243e538bc258546c537884c8
|
|
4
|
+
data.tar.gz: 0642d421a13ce88ee674e75a29dd95c2783c2bc00d007a86829156c73b881ce6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 45800b6cb035c9a3cdfa5a3e2b7b798e963649d361c85e5f28b30c20b7b29aad0d30fe8f0ca7809ffddf607d35bcb4d444a6c2370256abd709e050ca2a6d708d
|
|
7
|
+
data.tar.gz: 7f446f22343c6afba3c06b1c2535d03109ec5e2800e257152c32ece59cb1ec6983429ae72cf486d2cf65937f62e838bd77eb6c6bd799ca4f0de9204abd585e8e
|
data/.buildkite/pipeline.yml
CHANGED
|
@@ -4,10 +4,9 @@ agents:
|
|
|
4
4
|
# Nodes with values to reuse in the pipeline.
|
|
5
5
|
common_params:
|
|
6
6
|
- &docker_plugin "docker#v5.7.0"
|
|
7
|
-
- &docker_ruby_image "public.ecr.aws/docker/library/ruby:3.2.2"
|
|
8
7
|
- &common_plugins
|
|
9
8
|
- *docker_plugin :
|
|
10
|
-
image:
|
|
9
|
+
image: $DOCKER_RUBY_IMAGE
|
|
11
10
|
|
|
12
11
|
steps:
|
|
13
12
|
#################
|
|
@@ -63,7 +62,7 @@ steps:
|
|
|
63
62
|
command: .buildkite/gem-push.sh
|
|
64
63
|
plugins:
|
|
65
64
|
- *docker_plugin :
|
|
66
|
-
image:
|
|
65
|
+
image: $DOCKER_RUBY_IMAGE
|
|
67
66
|
propagate-environment: true
|
|
68
67
|
environment:
|
|
69
68
|
- "RUBYGEMS_API_KEY"
|
|
@@ -30,7 +30,7 @@ jobs:
|
|
|
30
30
|
with:
|
|
31
31
|
fetch-depth: 100
|
|
32
32
|
- name: 💎 Ruby Setup
|
|
33
|
-
uses: ruby/setup-ruby@
|
|
33
|
+
uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0
|
|
34
34
|
with:
|
|
35
35
|
bundler-cache: true
|
|
36
36
|
- name: ☢️ Danger PR Check
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.4.13
|
data/CHANGELOG.md
CHANGED
|
@@ -20,6 +20,22 @@ _None_
|
|
|
20
20
|
|
|
21
21
|
_None_
|
|
22
22
|
|
|
23
|
+
## 1.4.2
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
- `reusable-run-danger.yml`: bump `ruby/setup-ruby` to 1.343.0, which supports Ruby 3.4.13, so the workflow no longer fails with `Unknown version` in repos whose `.ruby-version` is 3.4.13. [#159]
|
|
28
|
+
|
|
29
|
+
### Internal Changes
|
|
30
|
+
|
|
31
|
+
- Bump Ruby to 3.4.13. [#160]
|
|
32
|
+
|
|
33
|
+
## 1.4.1
|
|
34
|
+
|
|
35
|
+
### Bug Fixes
|
|
36
|
+
|
|
37
|
+
- `github_utils`: `requested_reviewers?` now detects review requests assigned to a GitHub team when Danger runs with a token that cannot see the organization's teams. [#141]
|
|
38
|
+
|
|
23
39
|
## 1.4.0
|
|
24
40
|
|
|
25
41
|
### New Features
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
danger-dangermattic (1.4.
|
|
4
|
+
danger-dangermattic (1.4.2)
|
|
5
5
|
danger (~> 9.5, >= 9.5.3)
|
|
6
6
|
danger-plugin-api (~> 1.0)
|
|
7
7
|
danger-rubocop (~> 0.13)
|
|
@@ -10,7 +10,7 @@ PATH
|
|
|
10
10
|
GEM
|
|
11
11
|
remote: https://rubygems.org/
|
|
12
12
|
specs:
|
|
13
|
-
activesupport (8.1.
|
|
13
|
+
activesupport (8.1.4.1)
|
|
14
14
|
base64
|
|
15
15
|
bigdecimal
|
|
16
16
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
@@ -23,11 +23,11 @@ GEM
|
|
|
23
23
|
securerandom (>= 0.3)
|
|
24
24
|
tzinfo (~> 2.0, >= 2.0.5)
|
|
25
25
|
uri (>= 0.13.1)
|
|
26
|
-
addressable (2.9.
|
|
26
|
+
addressable (2.9.2)
|
|
27
27
|
public_suffix (>= 2.0.2, < 8.0)
|
|
28
28
|
ast (2.4.3)
|
|
29
29
|
base64 (0.3.0)
|
|
30
|
-
bigdecimal (4.
|
|
30
|
+
bigdecimal (4.1.3)
|
|
31
31
|
claide (1.1.0)
|
|
32
32
|
claide-plugins (0.9.2)
|
|
33
33
|
cork
|
|
@@ -35,7 +35,7 @@ GEM
|
|
|
35
35
|
open4 (~> 1.3)
|
|
36
36
|
coderay (1.1.3)
|
|
37
37
|
colored2 (3.1.2)
|
|
38
|
-
concurrent-ruby (1.3.
|
|
38
|
+
concurrent-ruby (1.3.8)
|
|
39
39
|
connection_pool (3.0.2)
|
|
40
40
|
cork (0.3.0)
|
|
41
41
|
colored2 (~> 3.1)
|
|
@@ -92,9 +92,9 @@ GEM
|
|
|
92
92
|
guard (~> 2.1)
|
|
93
93
|
guard-compat (~> 1.1)
|
|
94
94
|
rspec (>= 2.99.0, < 4.0)
|
|
95
|
-
i18n (1.
|
|
95
|
+
i18n (1.15.2)
|
|
96
96
|
concurrent-ruby (~> 1.0)
|
|
97
|
-
json (
|
|
97
|
+
json (3.1.0)
|
|
98
98
|
kramdown (2.5.2)
|
|
99
99
|
rexml (>= 3.4.4)
|
|
100
100
|
kramdown-parser-gfm (1.1.0)
|
|
@@ -107,9 +107,9 @@ GEM
|
|
|
107
107
|
logger (1.7.0)
|
|
108
108
|
lumberjack (1.4.0)
|
|
109
109
|
method_source (1.1.0)
|
|
110
|
-
minitest (6.0
|
|
110
|
+
minitest (6.1.0)
|
|
111
111
|
drb (~> 2.0)
|
|
112
|
-
prism (
|
|
112
|
+
prism (>= 1.5, < 3)
|
|
113
113
|
nap (1.1.0)
|
|
114
114
|
nenv (0.3.0)
|
|
115
115
|
net-http (0.9.1)
|
|
@@ -126,7 +126,7 @@ GEM
|
|
|
126
126
|
parser (3.3.9.0)
|
|
127
127
|
ast (~> 2.4.1)
|
|
128
128
|
racc
|
|
129
|
-
prism (1.
|
|
129
|
+
prism (2.1.0)
|
|
130
130
|
process_executer (1.3.0)
|
|
131
131
|
pry (0.15.2)
|
|
132
132
|
coderay (~> 1.1)
|
|
@@ -140,7 +140,7 @@ GEM
|
|
|
140
140
|
rb-inotify (0.11.1)
|
|
141
141
|
ffi (~> 1.0)
|
|
142
142
|
rchardet (1.10.0)
|
|
143
|
-
regexp_parser (2.
|
|
143
|
+
regexp_parser (2.13.1)
|
|
144
144
|
rexml (3.4.4)
|
|
145
145
|
rspec (3.13.1)
|
|
146
146
|
rspec-core (~> 3.13.0)
|
|
@@ -155,20 +155,20 @@ GEM
|
|
|
155
155
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
156
156
|
rspec-support (~> 3.13.0)
|
|
157
157
|
rspec-support (3.13.4)
|
|
158
|
-
rubocop (1.
|
|
159
|
-
json (
|
|
158
|
+
rubocop (1.92.2)
|
|
159
|
+
json (>= 2.3)
|
|
160
160
|
language_server-protocol (~> 3.17.0.2)
|
|
161
161
|
lint_roller (~> 1.1.0)
|
|
162
|
-
parallel (
|
|
162
|
+
parallel (>= 1.10)
|
|
163
163
|
parser (>= 3.3.0.2)
|
|
164
164
|
rainbow (>= 2.2.2, < 4.0)
|
|
165
|
-
regexp_parser (>= 2.
|
|
166
|
-
rubocop-ast (>= 1.
|
|
165
|
+
regexp_parser (>= 2.11.3, < 3.0)
|
|
166
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
167
167
|
ruby-progressbar (~> 1.7)
|
|
168
168
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
169
|
-
rubocop-ast (1.
|
|
169
|
+
rubocop-ast (1.51.0)
|
|
170
170
|
parser (>= 3.3.7.2)
|
|
171
|
-
prism (
|
|
171
|
+
prism (>= 1.7)
|
|
172
172
|
rubocop-rake (0.7.1)
|
|
173
173
|
lint_roller (~> 1.1)
|
|
174
174
|
rubocop (>= 1.72.1)
|
|
@@ -189,7 +189,7 @@ GEM
|
|
|
189
189
|
unicode-display_width (3.2.0)
|
|
190
190
|
unicode-emoji (~> 4.1)
|
|
191
191
|
unicode-emoji (4.2.0)
|
|
192
|
-
uri (1.1.
|
|
192
|
+
uri (1.1.2)
|
|
193
193
|
yard (0.9.44)
|
|
194
194
|
|
|
195
195
|
PLATFORMS
|
|
@@ -197,7 +197,6 @@ PLATFORMS
|
|
|
197
197
|
ruby
|
|
198
198
|
|
|
199
199
|
DEPENDENCIES
|
|
200
|
-
bundler (~> 2.0)
|
|
201
200
|
danger-dangermattic!
|
|
202
201
|
guard (~> 2.18)
|
|
203
202
|
guard-rspec (~> 4.7)
|
|
@@ -209,4 +208,4 @@ DEPENDENCIES
|
|
|
209
208
|
yard
|
|
210
209
|
|
|
211
210
|
BUNDLED WITH
|
|
212
|
-
|
|
211
|
+
4.0.18
|
data/danger-dangermattic.gemspec
CHANGED
|
@@ -27,17 +27,19 @@ module Danger
|
|
|
27
27
|
#
|
|
28
28
|
# @return [Boolean] True if there are active reviewers, otherwise false.
|
|
29
29
|
def active_reviewers?
|
|
30
|
-
|
|
31
|
-
pr_number = github.pr_json['number']
|
|
32
|
-
|
|
33
|
-
!github.api.pull_request_reviews(repo_name, pr_number).empty?
|
|
30
|
+
!github.api.pull_request_reviews(pr_repo_name, pr_number).empty?
|
|
34
31
|
end
|
|
35
32
|
|
|
36
33
|
# Checks if there are requested teams or reviewers who haven't reacted yet.
|
|
37
34
|
#
|
|
38
35
|
# @return [Boolean] True if there are requested teams or reviewers, otherwise false.
|
|
39
36
|
def requested_reviewers?
|
|
40
|
-
|
|
37
|
+
# GitHub strips `requested_teams` from the pull request payload — and therefore from `pr_json` —
|
|
38
|
+
# for tokens that cannot see the organization's teams, such as a bot account that is only an
|
|
39
|
+
# outside collaborator. The dedicated endpoint reports them regardless.
|
|
40
|
+
review_requests = github.api.pull_request_review_requests(pr_repo_name, pr_number)
|
|
41
|
+
has_requested_reviews = !review_requests['users'].to_a.empty? || !review_requests['teams'].to_a.empty?
|
|
42
|
+
|
|
41
43
|
has_requested_reviews || active_reviewers?
|
|
42
44
|
end
|
|
43
45
|
|
|
@@ -64,5 +66,15 @@ module Danger
|
|
|
64
66
|
|
|
65
67
|
has_wip_label || has_wip_title
|
|
66
68
|
end
|
|
69
|
+
|
|
70
|
+
private
|
|
71
|
+
|
|
72
|
+
def pr_repo_name
|
|
73
|
+
github.pr_json['base']['repo']['full_name']
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def pr_number
|
|
77
|
+
github.pr_json['number']
|
|
78
|
+
end
|
|
67
79
|
end
|
|
68
80
|
end
|
data/spec/github_utils_spec.rb
CHANGED
|
@@ -13,9 +13,7 @@ module Danger
|
|
|
13
13
|
instance_double(Danger::DangerfileGitHubPlugin, {
|
|
14
14
|
pr_json: {
|
|
15
15
|
'base' => { 'repo' => { 'full_name' => 'Automattic/dangermattic' } },
|
|
16
|
-
'number' => 42
|
|
17
|
-
'requested_teams' => [],
|
|
18
|
-
'requested_reviewers' => []
|
|
16
|
+
'number' => 42
|
|
19
17
|
},
|
|
20
18
|
api: instance_double(Octokit::Client),
|
|
21
19
|
branch_for_base: 'main',
|
|
@@ -44,8 +42,20 @@ module Danger
|
|
|
44
42
|
end
|
|
45
43
|
|
|
46
44
|
describe '#requested_reviewers?' do
|
|
47
|
-
|
|
48
|
-
allow(github.
|
|
45
|
+
before do
|
|
46
|
+
allow(github.api).to receive_messages(
|
|
47
|
+
pull_request_review_requests: { 'users' => [], 'teams' => [] },
|
|
48
|
+
pull_request_reviews: []
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
it 'returns true when a user has been requested for review' do
|
|
53
|
+
allow(github.api).to receive(:pull_request_review_requests).and_return({ 'users' => ['user1'], 'teams' => [] })
|
|
54
|
+
expect(@plugin.requested_reviewers?).to be(true)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
it 'returns true when only a team has been requested for review' do
|
|
58
|
+
allow(github.api).to receive(:pull_request_review_requests).and_return({ 'users' => [], 'teams' => ['team1'] })
|
|
49
59
|
expect(@plugin.requested_reviewers?).to be(true)
|
|
50
60
|
end
|
|
51
61
|
|
|
@@ -55,7 +65,6 @@ module Danger
|
|
|
55
65
|
end
|
|
56
66
|
|
|
57
67
|
it 'returns false when there are no requested reviewers or active reviewers' do
|
|
58
|
-
allow(github.api).to receive(:pull_request_reviews).and_return([])
|
|
59
68
|
expect(@plugin.requested_reviewers?).to be(false)
|
|
60
69
|
end
|
|
61
70
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: danger-dangermattic
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.4.
|
|
4
|
+
version: 1.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Automattic
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: danger
|
|
@@ -58,20 +57,6 @@ dependencies:
|
|
|
58
57
|
- - "~>"
|
|
59
58
|
- !ruby/object:Gem::Version
|
|
60
59
|
version: '0.13'
|
|
61
|
-
- !ruby/object:Gem::Dependency
|
|
62
|
-
name: bundler
|
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
|
64
|
-
requirements:
|
|
65
|
-
- - "~>"
|
|
66
|
-
- !ruby/object:Gem::Version
|
|
67
|
-
version: '2.0'
|
|
68
|
-
type: :development
|
|
69
|
-
prerelease: false
|
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
71
|
-
requirements:
|
|
72
|
-
- - "~>"
|
|
73
|
-
- !ruby/object:Gem::Version
|
|
74
|
-
version: '2.0'
|
|
75
60
|
- !ruby/object:Gem::Dependency
|
|
76
61
|
name: rake
|
|
77
62
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -206,6 +191,7 @@ extra_rdoc_files: []
|
|
|
206
191
|
files:
|
|
207
192
|
- ".buildkite/gem-push.sh"
|
|
208
193
|
- ".buildkite/pipeline.yml"
|
|
194
|
+
- ".buildkite/shared-pipeline-vars"
|
|
209
195
|
- ".bundle/config"
|
|
210
196
|
- ".github/CODEOWNERS"
|
|
211
197
|
- ".github/dependabot.yml"
|
|
@@ -303,7 +289,6 @@ homepage: https://github.com/Automattic/dangermattic
|
|
|
303
289
|
licenses:
|
|
304
290
|
- MPL-2.0
|
|
305
291
|
metadata: {}
|
|
306
|
-
post_install_message:
|
|
307
292
|
rdoc_options: []
|
|
308
293
|
require_paths:
|
|
309
294
|
- lib
|
|
@@ -318,8 +303,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
318
303
|
- !ruby/object:Gem::Version
|
|
319
304
|
version: '0'
|
|
320
305
|
requirements: []
|
|
321
|
-
rubygems_version: 3.
|
|
322
|
-
signing_key:
|
|
306
|
+
rubygems_version: 3.6.9
|
|
323
307
|
specification_version: 4
|
|
324
308
|
summary: A shared collection of Danger plugins
|
|
325
309
|
test_files: []
|