gitlab-dangerfiles 3.5.0 → 3.5.1

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: d29ef356c65c4a2ceec87eccbe6d723ee26ae1175176b788d13c146b508ec9fb
4
- data.tar.gz: fd15845d7c87873c15a8f144fa1bbca3801f0f45dc8e7363585110df07cbb11e
3
+ metadata.gz: 725c7feec8f29334e0ead741012d5b8d375cd026659853b78647c6508dcc6036
4
+ data.tar.gz: 1fc53d98126dee2a149b2ed57261b4652735729da94443371adc1c632a1d7217
5
5
  SHA512:
6
- metadata.gz: e14eb3849ed8da68ac7a716347ff89b4a2df7fbd47b014663807c913632fa6f6d363de94b94aa2df868335e6e5d5af0362f477c07b5d3519b5bd46219623150f
7
- data.tar.gz: 6f233f7f4b679dcca8ab438f54fd0ff4a400e8527614d675562421b818ad1dfe505874259cfc7e718dbba665c6dde02551520168b71630b39ad2680949db2b1c
6
+ metadata.gz: 60608ce5de5def782566653bfaeb9e036f95ff36d0a9a1fc57a7cbff663a8ca83b7769bc47751ec3a1dcb26ab7daf82ba39274753bf928d0f55708e2cfd65fec
7
+ data.tar.gz: 88eaaa34e4594faea4972fb762b1f8ba609a073b6a9940a3bd77ca350022535d3ddb2d20997c87c5283af5f85245e50af56ed744897f304cfed66c575ab95944
@@ -43,7 +43,7 @@ module Danger
43
43
  #
44
44
  # @return [Array<Spin>]
45
45
  def spin(project = nil, categories = [nil], timezone_experiment: false)
46
- project = (project || helper.config.project_name).downcase
46
+ project = (project || config_project_name).downcase
47
47
  categories = categories.map { |category| category&.downcase }
48
48
  categories.reject! { |category| integrations_reject_category?(category, project) }
49
49
 
@@ -187,11 +187,8 @@ module Danger
187
187
  #
188
188
  # @return [Gitlab::Dangerfiles::Teammate]
189
189
  def spin_for_approver(rule)
190
- # This will filter out approvers who are not even reviewers who
191
- # don't show up in roulette data we're relying on.
192
- # That's why `filter_map` is used.
193
190
  approvers = rule["eligible_approvers"].filter_map do |approver|
194
- find_member(approver["username"])
191
+ find_member(approver["username"], project: config_project_name.downcase)
195
192
  end
196
193
 
197
194
  spin_for_person(approvers) || spin_for_approver_fallback(rule)
@@ -269,8 +266,22 @@ module Danger
269
266
  end
270
267
  end
271
268
 
272
- def find_member(username)
273
- company_members.find { |person| person.username == username }
269
+ def find_member(username, project: nil)
270
+ company_members.find do |member|
271
+ member.username == username &&
272
+ if project
273
+ member.in_project?(project)
274
+ else
275
+ true
276
+ end
277
+ end
278
+ end
279
+
280
+ # Return the configured project name
281
+ #
282
+ # @return [String]
283
+ def config_project_name
284
+ helper.config.project_name
274
285
  end
275
286
 
276
287
  # Like +team+, but only returns teammates in the current project, based on
@@ -54,7 +54,7 @@ def lint_commit(commit)
54
54
  return linter if linter.fixup? && helper.squash_mr?
55
55
 
56
56
  if linter.fixup?
57
- msg = "Squash or fixup commits must be squashed before merge, or enable squash merge option and re-run #{danger_job_link}."
57
+ msg = "Squash or fixup commits must be squashed before merge, or **edit** the merge request, enable **Squash commits when merge request is accepted** and re-run #{danger_job_link}."
58
58
  if helper.draft_mr? || helper.squash_mr?
59
59
  warn_commit(commit, msg, more_info: false)
60
60
  else
@@ -68,7 +68,7 @@ def lint_commit(commit)
68
68
  # Fail if a suggestion commit is used and squash is not enabled
69
69
  if linter.suggestion?
70
70
  unless helper.squash_mr?
71
- fail_commit(commit, "If you are applying suggestions, enable squash in the merge request and re-run #{danger_job_link}.", more_info: false)
71
+ fail_commit(commit, "If you are applying suggestions, **edit** the merge request, enable **Squash commits when merge request is accepted** and re-run #{danger_job_link}.", more_info: false)
72
72
  end
73
73
 
74
74
  return linter
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module Dangerfiles
3
- VERSION = "3.5.0"
3
+ VERSION = "3.5.1"
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.5.0
4
+ version: 3.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-25 00:00:00.000000000 Z
11
+ date: 2022-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake