kennel 1.20.0 → 1.20.1

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: 80f76f0bd4a86149f2f04a65927a12c951ee2255907fd115e9b5749e7281665d
4
- data.tar.gz: 8fb1fc45590b59fb8eaa4e46e93a0c4688897f27cb3e5f95a2167c53a99c07c5
3
+ metadata.gz: ca4b6718dd57977c3c0f6dc71f2afeb12e15c85f3a03d247b4352dbfc9b1595f
4
+ data.tar.gz: 198eb908a346606cbc8afa98c9acab6a4d514fa6be785dd8c704015b79745584
5
5
  SHA512:
6
- metadata.gz: 996c2a1b250f5a4f1c62122efa8c61abd6e2bfb08c1aecbccda32c412583dcc942a158eebe2ea0922e7626266e09e663eb6f3c3fbaa0612f22cb494ff56cda39
7
- data.tar.gz: 5721558473ac63402c89e963f2a2dce6498f8f9c650daf1db9e15820a37ad58611b756edee04f8af05e270fc4ed51cd93fbf3884184e2c7924b0da725eb9725f
6
+ metadata.gz: e6f5a46f56229a8d1d7dfaa49d4378c2521101af574853073a1cb725ff44468c8d6f1e93543fae84a49f66f5b40fb0640f918482606fb201bceebc6a91866505
7
+ data.tar.gz: 7bd22fb1b7a09847da973357ce2634f0aebf88263e9400212f9d69e98c2918dd565ad4f9c5dabcdb3057b9e1e06e20427aae7dbe52aa0e9e21c949f75b264d9a
@@ -1,6 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
3
  class GithubReporter
4
+ MAX_COMMENT_SIZE = 65536
5
+ TRUNCATED_MSG = "\n```\n... (truncated)" # finish the code block so it look nice
6
+
4
7
  class << self
5
8
  def report(token, &block)
6
9
  return yield unless token
@@ -28,6 +31,11 @@ module Kennel
28
31
 
29
32
  # https://developer.github.com/v3/repos/comments/#create-a-commit-comment
30
33
  def comment(body)
34
+ # truncate to maximum allowed comment size for github to avoid 422
35
+ if body.bytesize > MAX_COMMENT_SIZE
36
+ body = body.byteslice(0, MAX_COMMENT_SIZE - TRUNCATED_MSG.bytesize) + TRUNCATED_MSG
37
+ end
38
+
31
39
  post "commits/#{@git_sha}/comments", body: body
32
40
  end
33
41
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.20.0"
3
+ VERSION = "1.20.1"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kennel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.20.0
4
+ version: 1.20.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-30 00:00:00.000000000 Z
11
+ date: 2018-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday