gitlab-dangerfiles 3.0.0 → 3.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: 1bcd8631096b4c3a5c7c6df1c8a1c49fda0a4b4936c9f815996ca7702be99f3e
4
- data.tar.gz: ce6a7cc2c2b69e49a262882eddba550d4245c578bfc235be594a27cd0d04d737
3
+ metadata.gz: f4d0b46a9dcbc098c76a6acb7eda61791470b8a8914e47650532f6fe44158d0f
4
+ data.tar.gz: f9aa9d41af6ae110acc46de51c9f19457555567ef520aa5b65d91e5fc85eb916
5
5
  SHA512:
6
- metadata.gz: 60b36a45528577103064018e02315f365f729c4842f77ef794001fe4697760f2baf60ecaf29a19c5a1c0be25c239832b5d93908a4d6ddb5df7dc22380968f317
7
- data.tar.gz: f1591f53f037986f147f9549bfe98faeecee825c20d916e4370d9f76d562a18456fe8ac993e507987013bdaa52b95845776bac3c66fe6ab844d2f74b13084339
6
+ metadata.gz: 778edd2df54298a54b37218e6479b6566016248aed13f68a58d1fd43df6ac3bf4e0aee4d47494e0771899be984e5b0cfa667cfb99033f0c9cefde5c4cbe29aa9
7
+ data.tar.gz: 740003a2197153bcfb8431329e6eb3653707f34276a3cd34afb9cba1b60e6e8b08fe6884a46a14abb70869b957a2f5510ddc765bf5018885021fba571f1e0890
data/README.md CHANGED
@@ -135,7 +135,9 @@ project. To use it in your project, perform the following steps:
135
135
 
136
136
  #### `type_label`
137
137
 
138
- This rule ensures the merge request has a proper [type label](https://about.gitlab.com/handbook/engineering/metrics/#work-type-classification) set.
138
+ This rule warns when the merge request is missing a [type label](https://about.gitlab.com/handbook/engineering/metrics/#work-type-classification).
139
+
140
+ If the `DANGER_ERROR_WHEN_TYPE_LABEL_IS_MISSING` environment variable evaluates to `true`, Danger will error when a type label is missing.
139
141
 
140
142
  If the `changelog` plugin is available, it also tries to infer a type label from the `Changelog` trailer of the MR.
141
143
 
@@ -1,5 +1,7 @@
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
+
3
5
  require_relative "../../../gitlab/dangerfiles/type_label_guesser"
4
6
 
5
7
  if respond_to?(:changelog) && !helper.has_scoped_label_with_scope?("type")
@@ -7,6 +9,10 @@ if respond_to?(:changelog) && !helper.has_scoped_label_with_scope?("type")
7
9
  helper.labels_to_add.concat(type_label_guesser.labels_from_changelog_categories(changelog.categories))
8
10
  end
9
11
 
10
- unless helper.has_scoped_label_with_scope?("type")
11
- warn "Please add a [merge request type](https://about.gitlab.com/handbook/engineering/metrics/#work-type-classification) to this merge request."
12
+ return if helper.has_scoped_label_with_scope?("type")
13
+
14
+ if ENV["DANGER_ERROR_WHEN_TYPE_LABEL_IS_MISSING"]
15
+ fail TYPE_LABEL_MISSING_MESSAGE
16
+ else
17
+ warn TYPE_LABEL_MISSING_MESSAGE
12
18
  end
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module Dangerfiles
3
- VERSION = "3.0.0"
3
+ VERSION = "3.1.0"
4
4
  end
5
5
  end
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.0.0
4
+ version: 3.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: 2022-03-22 00:00:00.000000000 Z
11
+ date: 2022-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake