danger 8.2.2 → 8.2.3

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: 251a83485fbb01f15fb71afc1e76bed01879d166f6899407c2bee22416fa5ca7
4
- data.tar.gz: 0fbbc7ce20a833a55e2be4b842e4e89d70a130038c0eec0408396892ceba215c
3
+ metadata.gz: cd811a6fad28534b9e0b28ccbed30d0694e4ab3408ad22852a8897a56c55f2ed
4
+ data.tar.gz: 747e7a6ff6fce272eb7b732ced8f6358602159725e5490a3ce783f7ce06dcc83
5
5
  SHA512:
6
- metadata.gz: 9780c2dfd1a909732b7571c0141e74d35b92cbdcfbcfad48c2b2bc713dc62e062598301b0bca38a6759ef032ea4318a2d04e5b40d8d7fccb441b2f78f4a59862
7
- data.tar.gz: 5f93607907d82ffc36c6f5074796dfdacfd2c6771390e4bda57405c3c0f1f1545506a7f03b95b536fec763313612f24f27f4c20e9b4e4603570e0ab1b7e6f572
6
+ metadata.gz: 54612a3b0e7999fce7289a884febff1548edbfa92af9947a8c8cc4bbef5fa69451ac88b493bc2ba0125e23ef96f7a46846a7a3b1e7adb8ac4d8f98aafa0065ce
7
+ data.tar.gz: 6612a1c511c7fe579c2734f6b4c8b15955dc2a2dd196a4a0277a901d61307b58c2abdd7f000867c1f212d2db065b39c8dfcd9f83c774154b1089a37395f45096
@@ -46,10 +46,17 @@ module Danger
46
46
  base_commit = env["CI_COMMIT_SHA"]
47
47
  client = RequestSources::GitLab.new(nil, env).client
48
48
 
49
- if (Gem::Version.new(client.version.version) >= Gem::Version.new("10.7"))
49
+ client_version = Gem::Version.new(client.version.version)
50
+ if (client_version >= Gem::Version.new("10.7"))
50
51
  #Use the 'list merge requests associated with a commit' API, for speeed
51
52
  # (GET /projects/:id/repository/commits/:sha/merge_requests) available for GitLab >= 10.7
52
53
  merge_request = client.commit_merge_requests(project_path, base_commit, state: :opened).first
54
+ if (client_version >= Gem::Version.new("13.8"))
55
+ # Gitlab 13.8.0 started returning merge requests for merge commits and squashed commits
56
+ # By checking for merge_request.state, we can ensure danger only comments on MRs which are open
57
+ return 0 if merge_request.nil?
58
+ return 0 unless merge_request.state == "opened"
59
+ end
53
60
  else
54
61
  merge_requests = client.merge_requests(project_path, state: :opened)
55
62
  merge_request = merge_requests.auto_paginate.find do |mr|
@@ -1,17 +1,19 @@
1
- class Commits
2
- def initialize(base_head)
3
- @base_head = base_head.strip.split(" ".freeze)
4
- end
1
+ module Danger
2
+ class Commits
3
+ def initialize(base_head)
4
+ @base_head = base_head.strip.split(" ".freeze)
5
+ end
5
6
 
6
- def base
7
- base_head.first
8
- end
7
+ def base
8
+ base_head.first
9
+ end
9
10
 
10
- def head
11
- base_head.last
12
- end
11
+ def head
12
+ base_head.last
13
+ end
13
14
 
14
- private
15
+ private
15
16
 
16
- attr_reader :base_head
17
+ attr_reader :base_head
18
+ end
17
19
  end
@@ -4,7 +4,7 @@ require "danger/danger_core/dangerfile_generator"
4
4
 
5
5
  module Danger
6
6
  class DangerfileCommand < Runner
7
- self.summary = "Easily create you Dangerfiles."
7
+ self.summary = "Easily create your Dangerfiles."
8
8
  self.command = "dangerfile"
9
9
 
10
10
  self.abstract_command = true
@@ -1,4 +1,4 @@
1
1
  module Danger
2
- VERSION = "8.2.2".freeze
2
+ VERSION = "8.2.3".freeze
3
3
  DESCRIPTION = "Like Unit Tests, but for your Team Culture.".freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.2.2
4
+ version: 8.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orta Therox
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-01-19 00:00:00.000000000 Z
12
+ date: 2021-03-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: claide
@@ -147,16 +147,22 @@ dependencies:
147
147
  name: terminal-table
148
148
  requirement: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '1'
153
+ - - "<"
154
+ - !ruby/object:Gem::Version
155
+ version: '4'
153
156
  type: :runtime
154
157
  prerelease: false
155
158
  version_requirements: !ruby/object:Gem::Requirement
156
159
  requirements:
157
- - - "~>"
160
+ - - ">="
158
161
  - !ruby/object:Gem::Version
159
162
  version: '1'
163
+ - - "<"
164
+ - !ruby/object:Gem::Version
165
+ version: '4'
160
166
  - !ruby/object:Gem::Dependency
161
167
  name: cork
162
168
  requirement: !ruby/object:Gem::Requirement