gitlab-dangerfiles 3.13.0 → 4.1.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: fae45cdf2a0c840f86b2d1864e521587210e4f365d2d03727be0d73866e4379c
4
- data.tar.gz: a8380520fe8d4d12be578493244570265023db9f850ff374cd879591fb533b02
3
+ metadata.gz: c7a2df8349c1deecf91c154f6d8a8fa3e011217b00edb9078a12ae29e04891e9
4
+ data.tar.gz: 1df827117d0e4012436e5b77e19daa1ee36855e5085581baa29a8e36f4fbd04f
5
5
  SHA512:
6
- metadata.gz: 178104293164685aa9b265505785872372ad621b92b15fca37a590be070e7abbfd4090c339f3869c1c9e4da56281800b479c96c6992fb141e358320944e508ab
7
- data.tar.gz: bb6f9c2b409a904517d7f8e91918ddc7df959de37b41a25cd898398749d227e5b40755669a406e3bd8063df255f8639d5fccdef37c2cd150cad31e6c3d036f11
6
+ metadata.gz: f0f4c1dd6bc142deaa101e4b47b362cfab5955b0d4fa4fd13f495bd9f7ce10f9452c1ed050e452aeb808440ba520b18d67533e52e93efd748e8bfd0a8d9c00c1
7
+ data.tar.gz: 17a595ead4bffa6416632543196f0b4b1f1141ab69f22144a9996f1db0dc76be6a39f3781794fd418333752e6e094042533841b9ea760e6f721c525f868ccf5f
data/.gitlab-ci.yml CHANGED
@@ -57,7 +57,6 @@ test:rufo:
57
57
 
58
58
  include:
59
59
  - template: Security/Dependency-Scanning.gitlab-ci.yml
60
- - template: Security/License-Scanning.gitlab-ci.yml
61
60
  - template: Security/SAST.gitlab-ci.yml
62
61
  - template: Security/Secret-Detection.gitlab-ci.yml
63
62
  - project: 'gitlab-org/quality/pipeline-common'
@@ -78,11 +77,6 @@ gemnasium-dependency_scanning:
78
77
  - if: '$CI_MERGE_REQUEST_IID'
79
78
  - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
80
79
 
81
- license_scanning:
82
- rules:
83
- - if: '$CI_MERGE_REQUEST_IID'
84
- - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
85
-
86
80
  secret_detection:
87
81
  rules:
88
82
  - if: '$CI_MERGE_REQUEST_IID'
data/.rubocop_todo.yml CHANGED
@@ -126,11 +126,6 @@ Lint/IdentityComparison:
126
126
  - 'spec/gitlab/dangerfiles/weightage/maintainers_spec.rb'
127
127
  - 'spec/gitlab/dangerfiles/weightage/reviewers_spec.rb'
128
128
 
129
- # Offense count: 1
130
- Lint/NonLocalExitFromIterator:
131
- Exclude:
132
- - 'lib/danger/rules/subtype_label/Dangerfile'
133
-
134
129
  # Offense count: 1
135
130
  # This cop supports safe autocorrection (--autocorrect).
136
131
  Lint/RedundantCopDisableDirective:
@@ -310,7 +305,6 @@ Style/FrozenStringLiteralComment:
310
305
  # Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
311
306
  Style/GuardClause:
312
307
  Exclude:
313
- - 'lib/danger/rules/subtype_label/Dangerfile'
314
308
  - 'lib/danger/rules/type_label/Dangerfile'
315
309
 
316
310
  # Offense count: 2
@@ -384,7 +378,6 @@ Style/PercentLiteralDelimiters:
384
378
  - 'Guardfile'
385
379
  - 'gitlab-dangerfiles.gemspec'
386
380
  - 'lib/danger/plugins/internal/helper.rb'
387
- - 'lib/danger/rules/subtype_label/Dangerfile'
388
381
  - 'lib/gitlab/dangerfiles/tasks/main.rake'
389
382
  - 'spec/danger/plugins/internal/helper_spec.rb'
390
383
 
@@ -471,7 +464,6 @@ Style/SelectByRegexp:
471
464
  # SupportedStyles: only_raise, only_fail, semantic
472
465
  Style/SignalException:
473
466
  Exclude:
474
- - 'lib/danger/rules/subtype_label/Dangerfile'
475
467
  - 'lib/danger/rules/type_label/Dangerfile'
476
468
 
477
469
  # Offense count: 7
data/README.md CHANGED
@@ -148,19 +148,9 @@ project. To use it in your project, perform the following steps:
148
148
  end
149
149
  ```
150
150
 
151
- #### `subtype_label`
152
-
153
- This rule warns when the merge request is missing a [subtype label](https://about.gitlab.com/handbook/engineering/metrics/#work-type-classification).
154
-
155
- If the `DANGER_ERROR_WHEN_SUBTYPE_LABEL_IS_MISSING` environment variable evaluates to `true`, Danger will error instead of warning when a subtype label is missing.
156
-
157
151
  #### `type_label`
158
152
 
159
- This rule warns when the merge request is missing a [type label](https://about.gitlab.com/handbook/engineering/metrics/#work-type-classification).
160
-
161
- If the `DANGER_ERROR_WHEN_TYPE_LABEL_IS_MISSING` environment variable evaluates to `true`, Danger will error instead of warning when a type label is missing.
162
-
163
- If the `changelog` plugin is available, it also tries to infer a type label from the `Changelog` trailer of the MR.
153
+ If the `changelog` plugin is available, it tries to infer a type label from the `Changelog` trailer of the MR.
164
154
 
165
155
  #### `z_add_labels`
166
156
 
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  spec.add_dependency "rake", ">= 0"
31
31
  spec.add_dependency "danger-gitlab", ">= 8.0.0"
32
- spec.add_dependency "danger", ">= 8.4.5"
32
+ spec.add_dependency "danger", ">= 9.3.0"
33
33
 
34
34
  spec.add_development_dependency "rspec", "~> 3.0"
35
35
  spec.add_development_dependency "rspec-parameterized"
@@ -24,9 +24,7 @@ module Danger
24
24
  OPTIONAL_CHANGELOG_MESSAGE = {
25
25
  local: "If this merge request [doesn't need a CHANGELOG entry](https://docs.gitlab.com/ee/development/changelog.html#what-warrants-a-changelog-entry), feel free to ignore this message.",
26
26
  ci: <<~MSG,
27
- If you want to create a changelog entry for GitLab FOSS, add the `Changelog` trailer to the commit message you want to add to the changelog.
28
-
29
- If you want to create a changelog entry for GitLab EE, also [add the `EE: true` trailer](https://docs.gitlab.com/ee/development/changelog.html#gitlab-enterprise-changes) to your commit message.
27
+ If this merge request needs a changelog entry, add the `Changelog` trailer to the commit message you want to add to the changelog.
30
28
 
31
29
  If this merge request [doesn't need a CHANGELOG entry](https://docs.gitlab.com/ee/development/changelog.html#what-warrants-a-changelog-entry), feel free to ignore this message.
32
30
  MSG
@@ -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
 
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- TYPE_LABEL_MISSING_MESSAGE = "Please add a [merge request type](https://about.gitlab.com/handbook/engineering/metrics/#work-type-classification) to this merge request."
4
-
5
3
  require_relative "../../../gitlab/dangerfiles/type_label_guesser"
6
4
 
7
5
  return if helper.has_scoped_label_with_scope?("type")
@@ -10,9 +8,3 @@ if respond_to?(:changelog)
10
8
  type_label_guesser = Gitlab::Dangerfiles::TypeLabelGuesser.new
11
9
  helper.labels_to_add.concat(type_label_guesser.labels_from_changelog_categories(changelog.categories))
12
10
  end
13
-
14
- if ENV['DANGER_ERROR_WHEN_TYPE_LABEL_IS_MISSING'] == 'true'
15
- fail TYPE_LABEL_MISSING_MESSAGE
16
- else
17
- warn TYPE_LABEL_MISSING_MESSAGE
18
- end
@@ -8,8 +8,8 @@ module Gitlab
8
8
  security: %w[type::bug bug::vulnerability],
9
9
  performance: %w[type::bug bug::performance],
10
10
  added: %w[type::feature feature::addition],
11
- deprecated: %w[type::feature feature::removal],
12
- removed: %w[type::feature feature::removal],
11
+ deprecated: %w[type::maintenance maintenance::removal],
12
+ removed: %w[type::maintenance maintenance::removal],
13
13
  }.freeze
14
14
 
15
15
  def labels_from_changelog_categories(categories)
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module Dangerfiles
3
- VERSION = "3.13.0"
3
+ VERSION = "4.1.0"
4
4
  end
5
5
  end
@@ -8,7 +8,6 @@ module Gitlab
8
8
  metadata
9
9
  simple_roulette
10
10
  type_label
11
- subtype_label
12
11
  z_add_labels
13
12
  z_retry_link
14
13
  ].freeze
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-dangerfiles
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.13.0
4
+ version: 4.1.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-08-02 00:00:00.000000000 Z
11
+ date: 2023-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 8.4.5
47
+ version: 9.3.0
48
48
  type: :runtime
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: 8.4.5
54
+ version: 9.3.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -176,7 +176,6 @@ files:
176
176
  - lib/danger/rules/commits_counter/Dangerfile
177
177
  - lib/danger/rules/metadata/Dangerfile
178
178
  - lib/danger/rules/simple_roulette/Dangerfile
179
- - lib/danger/rules/subtype_label/Dangerfile
180
179
  - lib/danger/rules/type_label/Dangerfile
181
180
  - lib/danger/rules/z_add_labels/Dangerfile
182
181
  - lib/danger/rules/z_retry_link/Dangerfile
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- SUBTYPE_LABEL_MISSING_MESSAGE = "Please add a [merge request subtype](https://about.gitlab.com/handbook/engineering/metrics/#work-type-classification) to this merge request."
4
-
5
- types = %w(bug feature maintenance)
6
- types.each do |type|
7
- return if helper.has_scoped_label_with_scope?(type)
8
- end
9
-
10
- if ENV['DANGER_ERROR_WHEN_SUBTYPE_LABEL_IS_MISSING'] == 'true'
11
- fail SUBTYPE_LABEL_MISSING_MESSAGE
12
- else
13
- warn SUBTYPE_LABEL_MISSING_MESSAGE
14
- end