gitlab-dangerfiles 4.0.0 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c54d1dcf5be1bc4fb1b1f187ba1b203ddef74f661120b9efe9834ee05e95fee8
4
- data.tar.gz: ac3617187d9bf2d523324b4320619fb361e30690ac2644e00e6a3edbaf78090c
3
+ metadata.gz: cc2be0e2c267852cb18d6fc54f9b9e8927d07b62c4c7968ad178f51fcb7f83eb
4
+ data.tar.gz: 3fe148ac204352fe795280ffe70e8ffabccacdd777156cf21c015c2abcf2cff4
5
5
  SHA512:
6
- metadata.gz: c1b739e770be63ced18c8abd0a6f1be161bf62a98b86673fe88b95db79b589c57a0431174e43f4acf77e884e4bb8dc40272f17a6cb60282925062d1741f1d573
7
- data.tar.gz: e6be44372b6881090c3e9a9d0099405315661c73a84a59ba7848b31f10ed4f72e3e861784fdfff47c985b192d26169ee96378d0d96487494c5d59ddd0e044d18
6
+ metadata.gz: 56c9ec187d98cd64a85d73504127f945063a6506080a53731f472de15630d501cb1b76a103804c59906b57e78f88f4e0f17d8e9ad2a9bab30639f3339151e366
7
+ data.tar.gz: 2a621d373863db75f5412e0ce205f85cbeba733d29a26259a8c466c16b35adf24fa3e58961fb29f7e75e923e682bda5320c78da33db6f1df4d679a973896105c
data/.gitlab-ci.yml CHANGED
@@ -46,15 +46,6 @@ test:rubocop:
46
46
  matrix:
47
47
  - RUBY_VERSION: ['3.0', '3.1', '3.2']
48
48
 
49
- test:rufo:
50
- extends: .default
51
- stage: test
52
- script:
53
- - bundle exec rufo --check .
54
- parallel:
55
- matrix:
56
- - RUBY_VERSION: ['3.0', '3.1', '3.2']
57
-
58
49
  include:
59
50
  - template: Security/Dependency-Scanning.gitlab-ci.yml
60
51
  - template: Security/SAST.gitlab-ci.yml
data/.rubocop.yml CHANGED
@@ -25,6 +25,9 @@ RSpec/MultipleMemoizedHelpers:
25
25
  RSpec/FilePath:
26
26
  Enabled: false
27
27
 
28
+ RSpec/SpecFilePathFormat:
29
+ Enabled: false
30
+
28
31
  Style/HashSyntax:
29
32
  EnforcedStyle: ruby19_no_mixed_keys
30
33
  # Introduced in Ruby 3.1. Disable for now.
data/.rubocop_todo.yml CHANGED
@@ -519,3 +519,8 @@ Style/TrailingCommaInArrayLiteral:
519
519
  - 'spec/gitlab/dangerfiles/title_linting_spec.rb'
520
520
  - 'spec/gitlab/dangerfiles/weightage/maintainers_spec.rb'
521
521
  - 'spec/gitlab/dangerfiles/weightage/reviewers_spec.rb'
522
+
523
+ Style/ArrayIntersect:
524
+ Exclude:
525
+ - 'lib/gitlab/dangerfiles/category.rb'
526
+ - 'lib/danger/plugins/changelog.rb'
data/Gemfile CHANGED
@@ -2,19 +2,3 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in gitlab-dangerfiles.gemspec
4
4
  gemspec
5
-
6
- gem "rake", "~> 12.0"
7
- gem "guard-rspec"
8
- gem "yard"
9
-
10
- group :development do
11
- gem "lefthook", require: false
12
- end
13
-
14
- group :development, :test do
15
- gem "gitlab-styles", "~> 9.0.0", require: false
16
- end
17
-
18
- group :test do
19
- gem "pry-byebug", "~> 3.8", require: false
20
- end
@@ -27,14 +27,21 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
29
 
30
- spec.add_dependency "rake", ">= 0"
31
30
  spec.add_dependency "danger-gitlab", ">= 8.0.0"
32
31
  spec.add_dependency "danger", ">= 9.3.0"
33
32
 
34
- spec.add_development_dependency "rspec", "~> 3.0"
33
+ spec.add_development_dependency "climate_control"
34
+ spec.add_development_dependency "gitlab-styles", "~> 10.0"
35
+ spec.add_development_dependency "guard-rspec", "~> 4.7.3"
36
+ spec.add_development_dependency "lefthook", "~> 1.3"
37
+ spec.add_development_dependency "rake", "~> 10.2"
35
38
  spec.add_development_dependency "rspec-parameterized"
39
+ spec.add_development_dependency "rspec", "~> 3.8"
40
+ # we do not commit the bundle lockfile, so this temporary workaround needs to be
41
+ # present until 2.21.3 or 2.22.x is released
42
+ # See https://gitlab.com/gitlab-org/ruby/gems/gitlab-styles/-/issues/63
43
+ spec.add_development_dependency "rubocop-rails", "!= 2.21.2"
36
44
  spec.add_development_dependency "timecop"
37
45
  spec.add_development_dependency "webmock"
38
- spec.add_development_dependency "climate_control"
39
- spec.add_development_dependency "rufo"
46
+ spec.add_development_dependency "yard"
40
47
  end
@@ -280,6 +280,12 @@ module Danger
280
280
  reviewer = spin_for_person(weighted_reviewers)
281
281
  maintainer = spin_for_person(weighted_maintainers)
282
282
 
283
+ # allow projects with small number of reviewers to take from maintainers if possible
284
+ if reviewer.nil? && weighted_maintainers.uniq.size > 1
285
+ weighted_maintainers.delete(maintainer)
286
+ reviewer = spin_for_person(weighted_maintainers)
287
+ end
288
+
283
289
  Spin.new(category, reviewer, maintainer, false)
284
290
  end
285
291
 
@@ -316,9 +322,9 @@ module Danger
316
322
  rsp = Net::HTTP.get_response(URI.parse(url))
317
323
 
318
324
  if rsp.is_a?(Net::HTTPRedirection)
319
- if (uri = URI.parse(rsp.header["location"]))
320
- uri.query = nil
321
- end
325
+ uri = URI.parse(rsp.header["location"])
326
+
327
+ uri.query = nil if uri
322
328
 
323
329
  warnings << "Redirection detected: #{uri}."
324
330
  return nil
@@ -95,9 +95,9 @@ if changes.any?
95
95
 
96
96
  markdown(MESSAGE)
97
97
 
98
- if (warnings = warning_list(roulette))
99
- markdown(format(WARNING_MESSAGE, warnings: warnings))
100
- end
98
+ warnings = warning_list(roulette)
99
+
100
+ markdown(format(WARNING_MESSAGE, warnings: warnings)) if warnings
101
101
 
102
102
  markdown(TABLE_MARKDOWN + table_header + rows.join("\n")) unless rows.empty?
103
103
  end
@@ -6,8 +6,8 @@ return unless helper.ci?
6
6
 
7
7
  def post_labels(labels)
8
8
  gitlab.api.update_merge_request(helper.mr_target_project_id,
9
- helper.mr_iid,
10
- add_labels: labels.join(","))
9
+ helper.mr_iid,
10
+ add_labels: labels.join(","))
11
11
  rescue Gitlab::Error::Forbidden
12
12
  warn("This Merge Request needs to be labelled with #{helper.labels_list(labels)}. Please request a reviewer or maintainer to add them.")
13
13
  end
@@ -6,7 +6,7 @@ module Gitlab
6
6
  module Dangerfiles
7
7
  class Teammate
8
8
  attr_reader :options, :username, :name, :role, :specialty, :projects, :available, :hungry, :reduced_capacity, :tz_offset_hours,
9
- :only_maintainer_reviews
9
+ :only_maintainer_reviews
10
10
 
11
11
  # The options data are produced by https://gitlab.com/gitlab-org/gitlab-roulette/-/blob/main/lib/team_member.rb
12
12
  def initialize(options = {})
@@ -14,7 +14,7 @@ module Gitlab
14
14
  @username = options["username"]
15
15
  @name = options["name"]
16
16
  @markdown_name = options["markdown_name"] ||
17
- default_markdown_name(*options.values_at("username", "name"))
17
+ default_markdown_name(options["username"])
18
18
  @role = options["role"]
19
19
  @specialty = options["specialty"]
20
20
  @projects = process_projects(options["projects"])
@@ -89,8 +89,8 @@ module Gitlab
89
89
 
90
90
  private
91
91
 
92
- def default_markdown_name(username, name)
93
- "[#{name}](https://gitlab.com/#{username}) (`@#{username}`)"
92
+ def default_markdown_name(username)
93
+ "[`#{username}`](https://gitlab.com/#{username})"
94
94
  end
95
95
 
96
96
  def process_projects(projects)
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module Dangerfiles
3
- VERSION = "4.0.0"
3
+ VERSION = "4.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,71 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-dangerfiles
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-13 00:00:00.000000000 Z
11
+ date: 2023-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rake
14
+ name: danger-gitlab
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 8.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 8.0.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: danger-gitlab
28
+ name: danger
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 8.0.0
33
+ version: 9.3.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 8.0.0
40
+ version: 9.3.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: danger
42
+ name: climate_control
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 9.3.0
48
- type: :runtime
47
+ version: '0'
48
+ type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 9.3.0
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rspec
56
+ name: gitlab-styles
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: guard-rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 4.7.3
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 4.7.3
83
+ - !ruby/object:Gem::Dependency
84
+ name: lefthook
57
85
  requirement: !ruby/object:Gem::Requirement
58
86
  requirements:
59
87
  - - "~>"
60
88
  - !ruby/object:Gem::Version
61
- version: '3.0'
89
+ version: '1.3'
62
90
  type: :development
63
91
  prerelease: false
64
92
  version_requirements: !ruby/object:Gem::Requirement
65
93
  requirements:
66
94
  - - "~>"
67
95
  - !ruby/object:Gem::Version
68
- version: '3.0'
96
+ version: '1.3'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '10.2'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '10.2'
69
111
  - !ruby/object:Gem::Dependency
70
112
  name: rspec-parameterized
71
113
  requirement: !ruby/object:Gem::Requirement
@@ -81,21 +123,35 @@ dependencies:
81
123
  - !ruby/object:Gem::Version
82
124
  version: '0'
83
125
  - !ruby/object:Gem::Dependency
84
- name: timecop
126
+ name: rspec
85
127
  requirement: !ruby/object:Gem::Requirement
86
128
  requirements:
87
- - - ">="
129
+ - - "~>"
88
130
  - !ruby/object:Gem::Version
89
- version: '0'
131
+ version: '3.8'
90
132
  type: :development
91
133
  prerelease: false
92
134
  version_requirements: !ruby/object:Gem::Requirement
93
135
  requirements:
94
- - - ">="
136
+ - - "~>"
95
137
  - !ruby/object:Gem::Version
96
- version: '0'
138
+ version: '3.8'
97
139
  - !ruby/object:Gem::Dependency
98
- name: webmock
140
+ name: rubocop-rails
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "!="
144
+ - !ruby/object:Gem::Version
145
+ version: 2.21.2
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "!="
151
+ - !ruby/object:Gem::Version
152
+ version: 2.21.2
153
+ - !ruby/object:Gem::Dependency
154
+ name: timecop
99
155
  requirement: !ruby/object:Gem::Requirement
100
156
  requirements:
101
157
  - - ">="
@@ -109,7 +165,7 @@ dependencies:
109
165
  - !ruby/object:Gem::Version
110
166
  version: '0'
111
167
  - !ruby/object:Gem::Dependency
112
- name: climate_control
168
+ name: webmock
113
169
  requirement: !ruby/object:Gem::Requirement
114
170
  requirements:
115
171
  - - ">="
@@ -123,7 +179,7 @@ dependencies:
123
179
  - !ruby/object:Gem::Version
124
180
  version: '0'
125
181
  - !ruby/object:Gem::Dependency
126
- name: rufo
182
+ name: yard
127
183
  requirement: !ruby/object:Gem::Requirement
128
184
  requirements:
129
185
  - - ">="