gitlab-dangerfiles 2.1.4 → 2.3.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/gitlab-dangerfiles.gemspec +2 -1
- data/lib/danger/plugins/helper.rb +4 -2
- data/lib/danger/plugins/roulette.rb +1 -1
- data/lib/danger/rules/commit_messages/Dangerfile +1 -1
- data/lib/gitlab/dangerfiles/spec_helper.rb +1 -1
- data/lib/gitlab/dangerfiles/teammate.rb +1 -1
- data/lib/gitlab/dangerfiles/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9514e55b5f6bd5a29333c3d08cd1cb2b6a0a61dc3f07a363625a60e52708095a
|
4
|
+
data.tar.gz: '05359002275ba7bf06b2aca1d6a9a0acc8f149765ff87970bf12ebcb29b3f796'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6309c8416ef0952e275acce5ec3fe12bbc72658857ad253e6fd92c86acc5d2d6a952cbb87f80b5d32073d6d9c5eb521482417e7ecfcfc1c93502107a11fbfa62
|
7
|
+
data.tar.gz: 99c591108c94959166847f6bc11f2b0f7bcf7a1114c4176d982ecdbbc8c5cd6c3bef6edca889a6cd3dc0d5902077fcaa117835a521e9eb9d4bfd590a16161cbf
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ The goal of this gem is to centralize Danger plugins and rules that to be used b
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem 'gitlab-dangerfiles'
|
10
|
+
gem 'gitlab-dangerfiles', require: false
|
11
11
|
```
|
12
12
|
|
13
13
|
And then execute:
|
@@ -29,6 +29,8 @@ $ gem install gitlab-dangerfiles
|
|
29
29
|
In your project's `Dangerfile`, add the following two line to import the plugins and rules from this gem:
|
30
30
|
|
31
31
|
```ruby
|
32
|
+
require 'gitlab-dangerfiles'
|
33
|
+
|
32
34
|
# Get an instance of Gitlab::Dangerfiles
|
33
35
|
gitlab_dangerfiles = Gitlab::Dangerfiles::Engine.new(self)
|
34
36
|
|
data/gitlab-dangerfiles.gemspec
CHANGED
@@ -27,7 +27,8 @@ 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 "danger-gitlab"
|
30
|
+
spec.add_dependency "danger-gitlab", ">= 8.0.0"
|
31
|
+
spec.add_dependency "danger", ">= 8.3.1"
|
31
32
|
|
32
33
|
spec.add_development_dependency "rspec", "~> 3.0"
|
33
34
|
spec.add_development_dependency "rspec-parameterized"
|
@@ -17,7 +17,9 @@ module Danger
|
|
17
17
|
none: "",
|
18
18
|
qa: "~QA",
|
19
19
|
test: "~test ~Quality for `spec/features/*`",
|
20
|
+
# Deprecated as of 2.3.0 in favor of tooling
|
20
21
|
engineering_productivity: '~"Engineering Productivity" for CI, Danger',
|
22
|
+
tooling: "~tooling for CI, Danger",
|
21
23
|
ci_template: '~"ci::templates"',
|
22
24
|
product_intelligence: '~"product intelligence"',
|
23
25
|
}.freeze
|
@@ -211,7 +213,7 @@ module Danger
|
|
211
213
|
# +filename_regex+ is the regex pattern to match file names. +changes_regex+ is the regex pattern to
|
212
214
|
# match changed lines in files that match +filename_regex+
|
213
215
|
#
|
214
|
-
# @return [Array<Symbol>] the categories a file is in, e.g., +[:frontend]+, +[:backend]+, or +%i[frontend
|
216
|
+
# @return [Array<Symbol>] the categories a file is in, e.g., +[:frontend]+, +[:backend]+, or +%i[frontend tooling]+
|
215
217
|
# using filename regex (+filename_regex+) and specific change regex (+changes_regex+) from the given +categories+ hash.
|
216
218
|
def categories_for_file(filename, categories)
|
217
219
|
_, categories = categories.find do |key, _|
|
@@ -416,7 +418,7 @@ module Danger
|
|
416
418
|
return nil unless ci?
|
417
419
|
return nil if defined?(@force_changes_from_git)
|
418
420
|
|
419
|
-
@changes_from_api ||= gitlab_helper.mr_changes
|
421
|
+
@changes_from_api ||= gitlab_helper.mr_changes
|
420
422
|
rescue
|
421
423
|
# Fallback to the Git strategy in any case
|
422
424
|
@force_changes_from_git = true
|
@@ -58,7 +58,7 @@ module Danger
|
|
58
58
|
# Fetch an already picked backend reviewer, or pick one otherwise
|
59
59
|
spin.reviewer = backend_spin&.reviewer || spin_for_category(project, :backend, timezone_experiment: including_timezone).reviewer
|
60
60
|
end
|
61
|
-
when :engineering_productivity
|
61
|
+
when :tooling, :engineering_productivity # Deprecated as of 2.3.0 in favor of tooling
|
62
62
|
if spin.maintainer.nil?
|
63
63
|
# Fetch an already picked backend maintainer, or pick one otherwise
|
64
64
|
spin.maintainer = backend_spin&.maintainer || spin_for_category(project, :backend, timezone_experiment: including_timezone).maintainer
|
@@ -5,7 +5,7 @@ require_relative "../../../gitlab/dangerfiles/merge_request_linter"
|
|
5
5
|
|
6
6
|
COMMIT_MESSAGE_GUIDELINES = "https://docs.gitlab.com/ee/development/contributing/merge_request_workflow.html#commit-messages-guidelines"
|
7
7
|
MORE_INFO = "For more information, take a look at our [Commit message guidelines](#{COMMIT_MESSAGE_GUIDELINES})."
|
8
|
-
THE_DANGER_JOB_TEXT = "the `%<job_name
|
8
|
+
THE_DANGER_JOB_TEXT = "the `%<job_name>s` job"
|
9
9
|
MAX_COMMITS_COUNT = helper.config.max_commits_count
|
10
10
|
MAX_COMMITS_COUNT_EXCEEDED_MESSAGE = <<~MSG
|
11
11
|
This merge request includes more than %<max_commits_count>d commits. Each commit should meet the following criteria:
|
@@ -104,7 +104,7 @@ RSpec.shared_context "with dangerfile" do
|
|
104
104
|
end
|
105
105
|
|
106
106
|
let(:fake_git) { double("fake-git", added_files: added_files, modified_files: modified_files, deleted_files: deleted_files, renamed_files: renamed_files) }
|
107
|
-
let(:fake_helper) { double("fake-helper", changes: changes, mr_iid: 1234, mr_title: mr_title, mr_labels: mr_labels) }
|
107
|
+
let(:fake_helper) { double("fake-helper", changes: changes, added_files: added_files, modified_files: modified_files, deleted_files: deleted_files, renamed_files: renamed_files, mr_iid: 1234, mr_title: mr_title, mr_labels: mr_labels) }
|
108
108
|
|
109
109
|
before do
|
110
110
|
allow(dangerfile).to receive(:git).and_return(fake_git)
|
@@ -95,7 +95,7 @@ module Gitlab
|
|
95
95
|
area = role[/Software Engineer in Test(?:.*?, (\w+))/, 1]
|
96
96
|
|
97
97
|
area && labels.any?("devops::#{area.downcase}") if kind == :reviewer
|
98
|
-
when :engineering_productivity
|
98
|
+
when :tooling, :engineering_productivity # Deprecated as of 2.3.0 in favor of tooling
|
99
99
|
return false unless role[/Engineering Productivity/]
|
100
100
|
return true if kind == :reviewer
|
101
101
|
return true if capabilities(project).include?("#{kind} engineering_productivity")
|
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: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitLab
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-gitlab
|
@@ -16,14 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
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:
|
26
|
+
version: 8.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: danger
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 8.3.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 8.3.1
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rspec
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|