ci_toolkit 1.4.4 → 1.4.9

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: b7e1d3b62ad2c50c4919413c8a8773348447a20600260994868297e69763829d
4
- data.tar.gz: be65e3582551c88dd43571a637bd8ee0fde57579eb9f1beee2298e4712a29979
3
+ metadata.gz: df7f5bba49c6c9e1161a6c7d5169173557d6a9f26e42936f92fcde54033563d1
4
+ data.tar.gz: a56c807056f491f5b08502ad54c5cc70139733be8119ad3bedd8f50fe795a3b7
5
5
  SHA512:
6
- metadata.gz: c49efe0f49779d519d69f2bd530b09243adcc394c06cd27021e0e92b879da6548ee5cb4ba2984181b9e2fcd92bd676ab3979e07ba2cea1fd12dd1ea17f29f881
7
- data.tar.gz: ea0691106684ae13c7538d215be2dc472de967929fc84d8f899f3cc0918f08ad47f7c042f6d22b07477a5325d8f7bc1c41454e0515ad64d87807a64dd6c9a076
6
+ metadata.gz: b3f63b8e2454b4f9af57a82f99ae6c7c2bb62e39ae87d60246f5d9ad1d1163671af6d975437cacdeef62a788128c910890e77eb27725388f926a608a416c0da4
7
+ data.tar.gz: 84b8beecd8f3bf472aace619789500d10b0116b1b4b6b11b05039a0ee410ba9cc44cd34f9d9eab8863fc80117bd5e3bf4409a61d77d879d6a52e2d61b02ac8a1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ci_toolkit (1.4.4)
4
+ ci_toolkit (1.4.9)
5
5
  faraday
6
6
  faraday_middleware
7
7
  jwt
@@ -46,7 +46,7 @@ GEM
46
46
  octokit (4.21.0)
47
47
  faraday (>= 0.9)
48
48
  sawyer (~> 0.8.0, >= 0.5.3)
49
- openssl (2.1.2)
49
+ openssl (2.2.1)
50
50
  ipaddr
51
51
  parallel (1.21.0)
52
52
  parser (3.0.2.0)
@@ -49,7 +49,7 @@ module CiToolkit
49
49
  })
50
50
  end
51
51
 
52
- def abort_pull_request_builds(pull_request, branch, commit)
52
+ def abort_pull_request_builds(pull_request, branch, commit = nil)
53
53
  find_pull_request_builds(pull_request, branch, commit).each do |build|
54
54
  @connection.post("/#{API_VERSION}/apps/#{@app_slug}/builds/#{build["slug"]}/abort", {
55
55
  abort_reason: "Aborting due to other build failed for pull request #{pull_request}"
@@ -57,14 +57,15 @@ module CiToolkit
57
57
  end
58
58
  end
59
59
 
60
- def find_pull_request_builds(pull_request, branch, commit)
60
+ def find_pull_request_builds(pull_request, branch, commit = nil)
61
61
  response = @connection.get("/#{API_VERSION}/apps/#{@app_slug}/builds", {
62
62
  branch: branch,
63
63
  pull_request_id: pull_request.to_i,
64
64
  status: 0 # status: 0 == not finished
65
65
  })
66
- builds = response.body["data"]
67
- filter_builds_by_commit(builds, commit)
66
+ builds = response.body["data"] || []
67
+ builds = filter_builds_by_commit(builds, commit) unless commit.nil?
68
+ builds
68
69
  end
69
70
 
70
71
  def filter_builds_by_commit(builds, commit)
@@ -36,6 +36,10 @@ module CiToolkit
36
36
  @github.create_status(state, @context, @env.app_url, "Finished building #{num_finished}/#{num_total}")
37
37
  end
38
38
 
39
+ def error
40
+ @github.create_status("error", @context, @env.app_url, "Building failed")
41
+ end
42
+
39
43
  private
40
44
 
41
45
  def load_counter
@@ -84,8 +84,8 @@ module CiToolkit
84
84
  def build_types
85
85
  types = []
86
86
  @build_types.each do |type|
87
- if comments.include?("#{type} build") || labels.include?("#{type} build")
88
- comments.include?(type) || labels.include?(type)
87
+ if comments.include?("#{type} build") || labels.include?("#{type} build") ||
88
+ comments.include?(type) || labels.include?(type)
89
89
  types.push(type)
90
90
  end
91
91
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ci_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gero Keller