google-cloud-error_reporting 0.31.1 → 0.31.2

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: 0f4cd7c625059f46ec0bcf6598e4dd6b9ac9714b23e266eb88d2efaa1ca7b02f
4
- data.tar.gz: 53813d23825320611700f5e33f0aee568be3e1c38a5c18da38be43ba5f9bd322
3
+ metadata.gz: b4612ee47375f0a7cccc0a0a1e7a032855993f9111f8f98f835ef518d6f53390
4
+ data.tar.gz: d6baa8f717a81ab71e0b77940beb5873b748af7d920842c2e7645b0b195c8b98
5
5
  SHA512:
6
- metadata.gz: 070f45b8c866a9077129f442beca0c0af363c3891c74274cccffa7ab96a47c06ec8868928143bed3fbe4708ac49a26dcbb1a4dbe8bfdb709dcc4f140504c2fc7
7
- data.tar.gz: 6f2b345ec027cd1db0bedba29c3d45f99002bb7b8992a21f35373007e04cf047af67fcb811b80a2d48c8af3827b9ab8e1dc661134f7f7da67d15f38356773af5
6
+ metadata.gz: 92e08399c8762312dc2e3e7cc1aa1439c575c1ed3d7b97506b20914e6749fa10417a3dbf200960eea17618799c189370e16d5ac2a62e4fe89a04f8804aa3a45e
7
+ data.tar.gz: 2f7ccb7244bbd53245be67e5f9e40174ce40cce5da7f07b2efd7a32a10287bddd53e5303b4b536ea1a0fbafca183002a760584536fbf278d6d7580ad7fbe0dd1
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 0.31.2 / 2019-02-09
4
+
5
+ * Fix conversion code for ErrorEvent and Debugee.
6
+ * Prepare for changes in JSON serialization coming in
7
+ google-protobuf 3.7.
8
+
3
9
  ### 0.31.1 / 2019-02-07
4
10
 
5
11
  * Update concurrent-ruby dependency
@@ -16,7 +22,7 @@
16
22
  This value was added in googleauth 0.7.0.
17
23
  * Loosen googleauth dependency
18
24
  Allow for new releases up to 0.10.
19
- The googleauth devs have committed to maintanining the current API
25
+ The googleauth devs have committed to maintaining the current API
20
26
  and will not make backwards compatible changes before 0.10.
21
27
 
22
28
  ### 0.30.5 / 2018-09-20
@@ -238,74 +238,86 @@ module Google
238
238
  # @return [Devtools::Clouderrorreporting::V1beta1::ReportedErrorEvent]
239
239
  # gRPC struct that represent an ErrorEvent.
240
240
  def to_grpc
241
- error_event_hash = {
242
- event_time: event_time_hash,
243
- message: message,
244
- service_context: service_context_hash,
245
- context: error_context_hash
246
- }.delete_if { |_, v| v.nil? }
247
-
248
- grpc_class =
249
- Devtools::Clouderrorreporting::V1beta1::ReportedErrorEvent
250
- grpc_class.decode_json error_event_hash.to_json
241
+ Devtools::Clouderrorreporting::V1beta1::ReportedErrorEvent.new(
242
+ event_time: event_time_grpc,
243
+ message: message.to_s,
244
+ service_context: service_context_grpc,
245
+ context: error_context_grpc
246
+ )
251
247
  end
252
248
 
253
249
  private
254
250
 
255
251
  ##
256
- # @private Formats the event_time as the hash representation of
257
- # Google::Protobuf::Timestamp struct.
252
+ # @private Formats the event_time as a Google::Protobuf::Timestamp.
258
253
  #
259
- def event_time_hash
254
+ def event_time_grpc
260
255
  return nil if event_time.nil?
261
- {
256
+ Google::Protobuf::Timestamp.new(
262
257
  seconds: event_time.to_i,
263
258
  nanos: event_time.nsec
264
- }
259
+ )
265
260
  end
266
261
 
267
262
  ##
268
- # @private Formats the service_name and service_version as the hash
269
- # representation of
270
- # Google::Devtools::Clouderrorreporting::V1beta1::SourceContext struct.
263
+ # @private Formats the service_name and service_version as a
264
+ # Google::Devtools::Clouderrorreporting::V1beta1::ServiceContext.
271
265
  #
272
- def service_context_hash
266
+ def service_context_grpc
273
267
  return nil if !service_name && !service_version
274
- {
275
- service: service_name,
276
- version: service_version
277
- }.delete_if { |_, v| v.nil? }
268
+ Devtools::Clouderrorreporting::V1beta1::ServiceContext.new(
269
+ service: service_name.to_s,
270
+ version: service_version.to_s
271
+ )
272
+ end
273
+
274
+ # rubocop:disable Metrics/AbcSize
275
+
276
+ ##
277
+ # @private Formats the http request context as a
278
+ # Google::Devtools::Clouderrorreporting::V1beta1::HttpRequestContext
279
+ #
280
+ def http_request_grpc
281
+ return nil if !http_method && !http_url && !http_user_agent &&
282
+ !http_referrer && !http_status && !http_remote_ip
283
+ Devtools::Clouderrorreporting::V1beta1::HttpRequestContext.new(
284
+ method: http_method.to_s,
285
+ url: http_url.to_s,
286
+ user_agent: http_user_agent.to_s,
287
+ referrer: http_referrer.to_s,
288
+ response_status_code: http_status.to_i,
289
+ remote_ip: http_remote_ip.to_s
290
+ )
291
+ end
292
+
293
+ # rubocop:enable Metrics/AbcSize
294
+
295
+ ##
296
+ # @private Formats the source location as a
297
+ # Google::Devtools::Clouderrorreporting::V1beta1::SourceLocation
298
+ #
299
+ def source_location_grpc
300
+ return nil if !file_path && !line_number && !function_name
301
+ Devtools::Clouderrorreporting::V1beta1::SourceLocation.new(
302
+ file_path: file_path.to_s,
303
+ line_number: line_number.to_i,
304
+ function_name: function_name.to_s
305
+ )
278
306
  end
279
307
 
280
308
  ##
281
- # @private Formats the error context info as the hash
282
- # representation of
283
- # Google::Devtools::Clouderrorreporting::V1beta1::ErrorContext struct.
309
+ # @private Formats the error context info as a
310
+ # Google::Devtools::Clouderrorreporting::V1beta1::ErrorContext
284
311
  #
285
- def error_context_hash
286
- http_request_hash = {
287
- method: http_method,
288
- url: http_url,
289
- user_agent: http_user_agent,
290
- referrer: http_referrer,
291
- response_status_code: http_status,
292
- remote_ip: http_remote_ip
293
- }.delete_if { |_, v| v.nil? }
294
-
295
- source_location_hash = {
296
- file_path: file_path,
297
- line_number: line_number,
298
- function_name: function_name
299
- }.delete_if { |_, v| v.nil? }
300
-
301
- result = {
302
- http_request: http_request_hash.empty? ? nil : http_request_hash,
303
- user: user,
304
- report_location:
305
- source_location_hash.empty? ? nil : source_location_hash
306
- }.delete_if { |_, v| v.nil? }
307
-
308
- result.empty? ? nil : result
312
+ def error_context_grpc
313
+ http_request = http_request_grpc
314
+ source_location = source_location_grpc
315
+ return nil if !http_request && !source_location && !user
316
+ Devtools::Clouderrorreporting::V1beta1::ErrorContext.new(
317
+ http_request: http_request,
318
+ user: user.to_s,
319
+ report_location: source_location
320
+ )
309
321
  end
310
322
  end
311
323
  end
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module ErrorReporting
19
- VERSION = "0.31.1".freeze
19
+ VERSION = "0.31.2".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-error_reporting
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.1
4
+ version: 0.31.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-07 00:00:00.000000000 Z
11
+ date: 2019-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-core