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 +4 -4
- data/README.md +3 -1
- data/lib/danger/rules/type_label/Dangerfile +8 -2
- data/lib/gitlab/dangerfiles/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4d0b46a9dcbc098c76a6acb7eda61791470b8a8914e47650532f6fe44158d0f
|
4
|
+
data.tar.gz: f9aa9d41af6ae110acc46de51c9f19457555567ef520aa5b65d91e5fc85eb916
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
|
11
|
-
|
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
|
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.
|
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-
|
11
|
+
date: 2022-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|