gitlab-dangerfiles 3.5.1 → 3.5.2

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: 725c7feec8f29334e0ead741012d5b8d375cd026659853b78647c6508dcc6036
4
- data.tar.gz: 1fc53d98126dee2a149b2ed57261b4652735729da94443371adc1c632a1d7217
3
+ metadata.gz: 7263e8c2ab6ba97b10b3cddc96ff91061cd526aa90992a7bd2df469b37e5e217
4
+ data.tar.gz: e9b2cabb3d6819af138c2080dbca5658f404e6d7f8a71e7f51944bc32e350fde
5
5
  SHA512:
6
- metadata.gz: 60608ce5de5def782566653bfaeb9e036f95ff36d0a9a1fc57a7cbff663a8ca83b7769bc47751ec3a1dcb26ab7daf82ba39274753bf928d0f55708e2cfd65fec
7
- data.tar.gz: 88eaaa34e4594faea4972fb762b1f8ba609a073b6a9940a3bd77ca350022535d3ddb2d20997c87c5283af5f85245e50af56ed744897f304cfed66c575ab95944
6
+ metadata.gz: e28612c099a81ec122a31d475880f121833741375bab94004ee647cb6ae467b074b53c07156ad4a25f361b72e9cfc54bc157b8f64ac8cc42ce4ac0b631efa229
7
+ data.tar.gz: a37e350cfc9bcb13277801fa72a9a7c5a92028004e02293c34a0c69b03e3d51d6a8359480bb9a716fc5ac27f2b17ae6375dcfe239217f66eab14411949f50c0c
@@ -105,14 +105,24 @@ module Danger
105
105
 
106
106
  required_approval_rules = unique_approval_rules(approval_rules)
107
107
  required_approval_rules.filter_map do |rule|
108
- rule["rule_type"] == "code_owner" &&
109
- rule["approvals_required"] > 0 &&
108
+ spin_for_approval_rule?(rule) &&
110
109
  Approval.from_approval_rule(rule, spin_for_approver(rule))
111
110
  end
112
111
  end
113
112
 
114
113
  private
115
114
 
115
+ def spin_for_approval_rule?(rule)
116
+ rule["rule_type"] == "code_owner" &&
117
+ rule["approvals_required"] > 0 &&
118
+ # Exclude generic codeowners rule, which should be covered by others already
119
+ !generic_codeowners_rule?(rule)
120
+ end
121
+
122
+ def generic_codeowners_rule?(rule)
123
+ rule["section"] == "codeowners" && rule["name"] == "*"
124
+ end
125
+
116
126
  # Returns an array containing all unique approval rules, based on on the section and eligible_approvers of the rules
117
127
  #
118
128
  # @param [Array<Hash>] approval rules
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module Dangerfiles
3
- VERSION = "3.5.1"
3
+ VERSION = "3.5.2"
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.1
4
+ version: 3.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-11 00:00:00.000000000 Z
11
+ date: 2022-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake