gitlab-dangerfiles 2.4.0 → 2.5.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: 635a5f7c76e99281a75a956cc045c25b11e0ba243dca544dfeff4c53c6665826
4
- data.tar.gz: baf2cd3b0d5bc499f980ac031c816dbdfe656e099af9db4520ad0a282788b1c8
3
+ metadata.gz: 93e497ecb88959ef6d916e995491d4a17644b2875b765a87d1b8dbf2a2e245cd
4
+ data.tar.gz: 2060f3bb306e1abf440eb4d2eead9f4a97dd5999d28a691fe119260fcf338b45
5
5
  SHA512:
6
- metadata.gz: 8db37fdb8728b021e63c60cf612255894d353224274010ae5ccaf7b110968c5735fbc8ec7bf936c320d6b1c0c5413ab5bd9eb925571035b824d06b6c95cd3a0f
7
- data.tar.gz: 1c3a3d119b6be0a19d2648740038d33e1dcba3ed0821dec6c4b4be988983a8d7a45818b33c3510168a924b47950151fc0906f10887f6ac1f21388fad62bd43cb
6
+ metadata.gz: 01a447e73d6550265ddf775674190816341bd07f484be816b7583fc3b70427bcfb2b1a0c9aa86b651486bed62953a8e97838c58527eee11af4c169f2633d7d2f
7
+ data.tar.gz: f85733f1b015c3170cafc990b0cf84c773ed8532f11e3978b59d21477ad592d8095ff6b46b4a673da98f956c1368ed4a6501e3ae26b62c1d1c534022bbc4b88b
@@ -0,0 +1 @@
1
+ * @gl-quality/eng-prod
data/.gitlab-ci.yml CHANGED
@@ -28,6 +28,12 @@ workflow:
28
28
  - Gemfile.lock
29
29
  policy: pull
30
30
 
31
+ danger-review:
32
+ extends: .default
33
+ stage: test
34
+ script:
35
+ - bundle exec danger --fail-on-errors=true --verbose
36
+
31
37
  test:rspec:
32
38
  extends: .default
33
39
  stage: test
data/Dangerfile ADDED
@@ -0,0 +1,10 @@
1
+ require_relative "lib/gitlab-dangerfiles"
2
+
3
+ # Get an instance of Gitlab::Dangerfiles
4
+ gitlab_dangerfiles = Gitlab::Dangerfiles::Engine.new(self)
5
+
6
+ # Import all plugins from the gem
7
+ gitlab_dangerfiles.import_plugins
8
+
9
+ # Import all rules from the gem
10
+ gitlab_dangerfiles.import_dangerfiles
data/Gemfile CHANGED
@@ -6,3 +6,7 @@ gemspec
6
6
  gem "rake", "~> 12.0"
7
7
  gem "guard-rspec"
8
8
  gem "yard"
9
+
10
+ group :test do
11
+ gem "pry-byebug", "~> 3.8", require: false
12
+ end
@@ -16,6 +16,7 @@ module Danger
16
16
  docs: "~documentation", # Docs are reviewed along DevOps stages, so don't need roulette for now.
17
17
  none: "",
18
18
  qa: "~QA",
19
+ ux: "~UX",
19
20
  test: "~test ~Quality for `spec/features/*`",
20
21
  # Deprecated as of 2.3.0 in favor of tooling
21
22
  engineering_productivity: '~"Engineering Productivity" for CI, Danger',
@@ -34,6 +34,9 @@ module Danger
34
34
  #
35
35
  # @return [Array<Spin>]
36
36
  def spin(project, categories = [nil], timezone_experiment: false)
37
+ project = project.downcase
38
+ categories = categories.map { |category| category&.downcase }
39
+
37
40
  spins = categories.sort_by(&:to_s).map do |category|
38
41
  including_timezone = INCLUDE_TIMEZONE_FOR_CATEGORY.fetch(category, timezone_experiment)
39
42
 
@@ -82,7 +82,7 @@ module Gitlab
82
82
  return false if subject.empty?
83
83
  return false if ("A".."Z").cover?(subject[0])
84
84
 
85
- first_char = subject.sub(/\A(\[.+\]|\w+:)\s/, "")[0]
85
+ first_char = subject.sub(/\A(\[[^\]]+\]|[^:\s]+:)\s/, "")[0]
86
86
  first_char_downcased = first_char.downcase
87
87
  return true unless ("a".."z").cover?(first_char_downcased)
88
88
 
@@ -12,7 +12,7 @@ module Gitlab
12
12
  @name = options["name"]
13
13
  @markdown_name = options["markdown_name"]
14
14
  @role = options["role"]
15
- @projects = options["projects"]
15
+ @projects = process_projects(options["projects"])
16
16
  @available = options["available"]
17
17
  @hungry = options["hungry"]
18
18
  @reduced_capacity = options["reduced_capacity"]
@@ -79,6 +79,14 @@ module Gitlab
79
79
 
80
80
  private
81
81
 
82
+ def process_projects(projects)
83
+ return nil unless projects
84
+
85
+ projects.each_with_object({}) do |(project, capabilities), all|
86
+ all[project.downcase] = Array(capabilities).map(&:downcase)
87
+ end
88
+ end
89
+
82
90
  def utc_offset_text(author = nil)
83
91
  offset_text = if floored_offset_hours >= 0
84
92
  "UTC+#{floored_offset_hours}"
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module Dangerfiles
3
- VERSION = "2.4.0"
3
+ VERSION = "2.5.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: 2.4.0
4
+ version: 2.5.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-11-02 00:00:00.000000000 Z
11
+ date: 2021-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-gitlab
@@ -131,10 +131,12 @@ extra_rdoc_files: []
131
131
  files:
132
132
  - ".gitignore"
133
133
  - ".gitlab-ci.yml"
134
+ - ".gitlab/CODEOWNERS"
134
135
  - ".gitlab/merge_request_templates/Release.md"
135
136
  - ".rspec"
136
137
  - ".yardopts"
137
138
  - CODE_OF_CONDUCT.md
139
+ - Dangerfile
138
140
  - Gemfile
139
141
  - Guardfile
140
142
  - LICENSE.txt