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 +4 -4
- data/lib/danger/ci_source/gitlab_ci.rb +8 -1
- data/lib/danger/ci_source/support/commits.rb +14 -12
- data/lib/danger/commands/dangerfile/init.rb +1 -1
- data/lib/danger/version.rb +1 -1
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd811a6fad28534b9e0b28ccbed30d0694e4ab3408ad22852a8897a56c55f2ed
|
4
|
+
data.tar.gz: 747e7a6ff6fce272eb7b732ced8f6358602159725e5490a3ce783f7ce06dcc83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
module Danger
|
2
|
+
class Commits
|
3
|
+
def initialize(base_head)
|
4
|
+
@base_head = base_head.strip.split(" ".freeze)
|
5
|
+
end
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
def base
|
8
|
+
base_head.first
|
9
|
+
end
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
def head
|
12
|
+
base_head.last
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
+
private
|
15
16
|
|
16
|
-
|
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
|
7
|
+
self.summary = "Easily create your Dangerfiles."
|
8
8
|
self.command = "dangerfile"
|
9
9
|
|
10
10
|
self.abstract_command = true
|
data/lib/danger/version.rb
CHANGED
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.
|
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-
|
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
|