danger 6.0.3 → 6.0.4

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: 5ed2cdc61eed91524dbc037cc0b4109298a59f79bae857ab9ab4fb91f9f16d17
4
- data.tar.gz: 59ddea79d36ee0dca6664f1ed3ce654e88bebfb70ed9f43ed5948d7bee11349f
3
+ metadata.gz: 0d07cd853986d22b15d4aed8699bd1877b506990221ccfd111dda79f004a4941
4
+ data.tar.gz: a5eff46697b1974fe5356a5276ee2913532732c6de08ab88d98eaedbb0131681
5
5
  SHA512:
6
- metadata.gz: 1ed19550308a3957a370beab7524037eec4760f4c08664c7f4283ca647b2c10a909a9cf7aab934dd65b9ff518cb7f72d2ce51b2c1f4703c2c6b7fd1f061dd1b6
7
- data.tar.gz: 99784fe747487d86ccbe6e65ac320ac5fbdcfab8818128f4c453c1161a7517b738f7611da988e1825e61d7613b96f946d412e8ea0ba71cf80c38cd784adfdac5
6
+ metadata.gz: f61272da6dbafad0f462d30567616125bdb31363ead8421b54c4fe302708848af0f90288a877a9213933b9db53c7eb8c11148da5300024e234983ae924de9d94
7
+ data.tar.gz: eeb94d72d083a0819a30f5af3029c8dbae5cede42fb5b166775f3100230756952e5147f250abed70269a75aaa81b21172fb6b5c325356f810a5b3678fc24fef3
@@ -2,12 +2,10 @@ require "danger/request_sources/github/github"
2
2
 
3
3
  module Danger
4
4
  # ### CI Setup
5
- # You need to edit your `.cirrus.yml` to include `bundle exec danger`.
5
+ # You need to edit your `.cirrus.yml` to include `bundler exec danger`.
6
6
  #
7
7
  # Adding this to your `.cirrus.yml` allows Danger to fail your build, both on the Cirrus CI website and within your Pull Request.
8
- # With that set up, you can edit your job to add `bundle exec danger` at the build action.
9
- #
10
- # ### Token Setup
8
+ # With that set up, you can edit your task to add `bundler exec danger` in any script instruction.
11
9
  class Cirrus < CI
12
10
  def self.validates_as_ci?(env)
13
11
  env.key? "CIRRUS_CI"
@@ -25,7 +23,7 @@ module Danger
25
23
  def initialize(env)
26
24
  self.repo_slug = env["CIRRUS_REPO_FULL_NAME"]
27
25
  if env["CIRRUS_PR"].to_i > 0
28
- self.pull_request_id = env["CIRRUS_BUILD_ID"]
26
+ self.pull_request_id = env["CIRRUS_PR"]
29
27
  end
30
28
  self.repo_url = env["CIRRUS_GIT_CLONE_URL"]
31
29
  end
@@ -39,11 +39,16 @@ module Danger
39
39
  base_commit = env["CI_COMMIT_SHA"]
40
40
  client = RequestSources::GitLab.new(nil, env).client
41
41
 
42
- merge_requests = client.merge_requests(project_path, state: :opened)
43
- merge_request = merge_requests.auto_paginate.find do |mr|
44
- mr.sha == base_commit
42
+ if (Gem::Version.new(client.version.version) >= Gem::Version.new("10.7"))
43
+ #Use the 'list merge requests associated with a commit' API, for speeed
44
+ # (GET /projects/:id/repository/commits/:sha/merge_requests) available for GitLab >= 10.7
45
+ merge_request = client.commit_merge_requests(project_path, base_commit, state: :opened).first
46
+ else
47
+ merge_requests = client.merge_requests(project_path, state: :opened)
48
+ merge_request = merge_requests.auto_paginate.find do |mr|
49
+ mr.sha == base_commit
50
+ end
45
51
  end
46
-
47
52
  merge_request.nil? ? 0 : merge_request.iid
48
53
  end
49
54
 
@@ -1,4 +1,4 @@
1
1
  module Danger
2
- VERSION = "6.0.3".freeze
2
+ VERSION = "6.0.4".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: 6.0.3
4
+ version: 6.0.4
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: 2019-04-05 00:00:00.000000000 Z
12
+ date: 2019-04-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: claide