ci_toolkit 1.5.1 → 1.5.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: a76550025b344c5539c79e2002b47c2e622ce90e1f1dd4dcf9710e148a41174f
4
- data.tar.gz: 182d9df1e68adb7f825ba57a1b3ad61e39d42e1b0a42f2011302f0559113e0b9
3
+ metadata.gz: 5cedc7fa6c13bd1256e5724b8c36852f39c1893a99f55ebfef23fe1d7e99ab4a
4
+ data.tar.gz: 0e50375d5c21fcd106dfe9013de91a55f93ce5b805203d9d4867dc16270ad576
5
5
  SHA512:
6
- metadata.gz: bca4a5115ea7fcfbf351d961cd5390c8235068306d1480337d06b6a6177cd6617d4f9132976e980789ef853531ba9d67ba61cc876f2895fdc041796ed105affc
7
- data.tar.gz: 333c32e5bd377d2947f3c705bd8ffb96af4d7a5c5720282eaf6264e5211342fb52e0851dfe5e0fe8bed6e9b341269f5e5509c264b06e1285f635673b5bad7ca3
6
+ metadata.gz: 74cdb925c2a57bcafbc4f5e663b21dd461203117e1e6c1bb71ea4489ad6b92e51cad298de9af2f820bf7bb8b61b14ba3a8d1cd1501cfba3a6c5b85fa88e0702a
7
+ data.tar.gz: 8b739f154a353585d1fdfba66f9d2d277217ab5e65d33923fb72af1632870bfe1bb4baaa49ec98117d43c56cfd3ab9c563ae0b17623e58107342d1a722ab643c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ci_toolkit (1.5.1)
4
+ ci_toolkit (1.5.4)
5
5
  faraday
6
6
  faraday_middleware
7
7
  gitlab
@@ -47,10 +47,9 @@ module CiToolkit
47
47
  private
48
48
 
49
49
  def load_counter
50
- status = @github.get_status(@context)
51
- return if status.nil?
50
+ description = @github.get_status_description(@context)
51
+ return if description.nil?
52
52
 
53
- description = status[:description]
54
53
  build_counter = description[%r{(\d/\d)}] || "0/0"
55
54
  { num_finished: build_counter.split("/")[0].to_i, num_total: build_counter.split("/")[1].to_i }
56
55
  end
@@ -97,5 +97,9 @@ module CiToolkit
97
97
  def realm_module_modified?
98
98
  CiToolkit::DvcsPr.api_not_implemented(self)
99
99
  end
100
+
101
+ def get_status_description(_context)
102
+ CiToolkit::DvcsPr.api_not_implemented(self)
103
+ end
100
104
  end
101
105
  end
@@ -110,6 +110,13 @@ module CiToolkit
110
110
  modified_files.length.positive?
111
111
  end
112
112
 
113
+ def get_status_description(context)
114
+ status = get_status(context)
115
+ return if status.nil?
116
+
117
+ status[:description]
118
+ end
119
+
113
120
  private
114
121
 
115
122
  def client
@@ -66,7 +66,7 @@ module CiToolkit
66
66
  end
67
67
 
68
68
  def files
69
- client.merge_request_changes(@repo_slug, @pr_number)
69
+ client.merge_request_changes(@repo_slug, @pr_number).changes
70
70
  end
71
71
 
72
72
  def create_status(state, context, target_url, description)
@@ -74,7 +74,7 @@ module CiToolkit
74
74
  @repo_slug,
75
75
  @commit_sha,
76
76
  state,
77
- { context: context, target_url: target_url, description: description }
77
+ { name: context, target_url: target_url, description: description }
78
78
  )
79
79
  end
80
80
 
@@ -105,7 +105,7 @@ module CiToolkit
105
105
  end
106
106
 
107
107
  def big?
108
- lines_of_code_changed > 500
108
+ lines_of_code_changed.to_i > 500
109
109
  end
110
110
 
111
111
  def realm_module_modified?
@@ -113,12 +113,17 @@ module CiToolkit
113
113
  modified_files.length.positive?
114
114
  end
115
115
 
116
+ def get_status_description(context)
117
+ status = get_status(context)
118
+ return if status.nil?
119
+
120
+ status.description
121
+ end
122
+
116
123
  private
117
124
 
118
125
  def client
119
126
  @_client = GitLab::Client.new if @_client.nil?
120
- # @_client.access_token = @bot.create_token if @_client.access_token.nil?
121
-
122
127
  @_client
123
128
  end
124
129
  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.5.1
4
+ version: 1.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gero Keller