codeclimate 0.85.28 → 0.87.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8ca0c15dd4895e2c738f0e08b7ae17c06ef8abeb0640761ab8ed9b35f3cd5bb2
4
- data.tar.gz: 620605f5ffe39ed8b45edab7b38ed161888c25ed1a0875ce70e3e0fdcdbe6143
3
+ metadata.gz: 39b2a1bf8027ab5894a37493d345667a11c3a8c759d8c2612f9dfaa244654c9d
4
+ data.tar.gz: 61e7efec4f68964c400b5b2cb9f88f23116e54d533ebf754d2cfc833fc83638e
5
5
  SHA512:
6
- metadata.gz: d5420f8af6589b01028db9c28edab19582d76866777e3087a99bc7d998212a81fd38f8d718d534123454c981636b3a86b8d54dbd7b2b186ac7677fa714363a11
7
- data.tar.gz: 1b0925cf9eaa9484c0b64e260b6f03e169124832318cee43afa89ccc89a9ba6d0b8a5e70f1a73599eb9e999afe4b294ea6cbef42833dc39c51170d5ffd0e284c
6
+ metadata.gz: eeb564e3981ed3709b9972cc3b05b053582b6264c69f1a3c0cdd7d5cea1ae1bab6e822b70713d1287517760889f1f0ad7222ad172d9d15f1c34149f8ef2686b2
7
+ data.tar.gz: 9fd9e173468007706a41f5dbb4af4003ffad314047077cb33cce63dcb478842aff93ab61f7ab4324bde8837993609be1c460779b8b4ba9e95b0159106c5d3533
data/config/engines.yml CHANGED
@@ -256,6 +256,8 @@ rubocop:
256
256
  rubocop-1-22-2: codeclimate/codeclimate-rubocop:rubocop-1-22-2
257
257
  rubocop-1-22-3: codeclimate/codeclimate-rubocop:rubocop-1-22-3
258
258
  rubocop-1-23-0: codeclimate/codeclimate-rubocop:rubocop-1-23-0
259
+ rubocop-1-30-0: codeclimate/codeclimate-rubocop:rubocop-1-30-0
260
+ rubocop-1-31-0: codeclimate/codeclimate-rubocop:rubocop-1-31-0
259
261
  description: A Ruby static code analyzer, based on the community Ruby style guide.
260
262
  rubymotion:
261
263
  channels:
@@ -286,7 +288,7 @@ shellcheck:
286
288
  sonar-java:
287
289
  channels:
288
290
  stable: codeclimate/codeclimate-sonar-java
289
- beta: codeclimate/codeclimate-sonar-java:sonar-java-5-14
291
+ beta: codeclimate/codeclimate-sonar-java:beta
290
292
  sonar-java-5-14: codeclimate/codeclimate-sonar-java:sonar-java-5-14
291
293
  description: Over 400 checks for bugs, vulnerabilities, and code smells in Java code.
292
294
  minimum_memory_limit: 2_048_000_000
@@ -1,5 +1,5 @@
1
- require "posix/spawn"
2
1
  require "cc/analyzer/container/result"
2
+ require "open3"
3
3
 
4
4
  module CC
5
5
  module Analyzer
@@ -52,19 +52,14 @@ module CC
52
52
 
53
53
  command = docker_run_command(options)
54
54
  Analyzer.logger.debug("docker run: #{command.inspect}")
55
- pid, _, out, err = POSIX::Spawn.popen4(*command)
55
+ _, out, err, @t_wait = Open3.popen3(*command)
56
56
 
57
57
  @t_out = read_stdout(out)
58
58
  @t_err = read_stderr(err)
59
59
  t_timeout = timeout_thread
60
60
 
61
- # blocks until the engine stops. this is put in a thread so that we can
62
- # explicitly abort it as part of #stop. otherwise a run-away container
63
- # could still block here forever if the docker-kill/wait is not
64
- # successful. there may still be stdout in flight if it was being
65
- # produced more quickly than consumed.
66
- @t_wait = Thread.new { _, @status = Process.waitpid2(pid) }
67
- @t_wait.join
61
+ # Calling @t_wait.value waits the termination of the process / engine
62
+ @status = @t_wait.value
68
63
 
69
64
  # blocks until all readers are done. they're still governed by the
70
65
  # timeout thread at this point. if we hit the timeout while processing
@@ -97,6 +92,9 @@ module CC
97
92
  def stop(message = nil)
98
93
  reap_running_container(message)
99
94
  kill_reader_threads
95
+ # Manually killing the process otherwise a run-away container
96
+ # could still block here forever if the docker-kill/wait is not
97
+ # successful
100
98
  kill_wait_thread
101
99
  end
102
100
 
@@ -178,9 +176,11 @@ module CC
178
176
 
179
177
  def reap_running_container(message)
180
178
  Analyzer.logger.warn("killing container name=#{@name} message=#{message.inspect}")
181
- POSIX::Spawn::Child.new("docker", "kill", @name, timeout: 2.minutes)
182
- POSIX::Spawn::Child.new("docker", "wait", @name, timeout: 2.minutes)
183
- rescue POSIX::Spawn::TimeoutExceeded
179
+ Timeout.timeout(2.minutes.to_i) do
180
+ Kernel.system("docker", "kill", @name, [:out, :err] => File::NULL)
181
+ Kernel.system("docker", "wait", @name, [:out, :err] => File::NULL)
182
+ end
183
+ rescue Timeout::Error
184
184
  Analyzer.logger.error("unable to kill container name=#{@name} message=#{message.inspect}")
185
185
  Analyzer.statsd.increment("container.zombie")
186
186
  Analyzer.statsd.increment("container.zombie.#{metric_name}") if metric_name
@@ -31,7 +31,7 @@ module CC
31
31
  @data =
32
32
  if File.exist? self.class::FILE_NAME
33
33
  File.open(self.class::FILE_NAME, "r:bom|utf-8") do |f|
34
- YAML.safe_load(f, [Time], [], false, self.class::FILE_NAME) || {}
34
+ YAML.safe_load(f, permitted_classes: [Time], permitted_symbols: [], aliases: false, filename: self.class::FILE_NAME) || {}
35
35
  end
36
36
  else
37
37
  {}
@@ -26,6 +26,7 @@ module CC
26
26
  IPAddr.new("fd00::/8"),
27
27
  IPAddr.new("127.0.0.1"),
28
28
  IPAddr.new("0:0:0:0:0:0:0:1"),
29
+ IPAddr.new("169.254.0.0/16"),
29
30
  ].freeze
30
31
 
31
32
  def run
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeclimate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.85.28
4
+ version: 0.87.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code Climate
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-07 00:00:00.000000000 Z
11
+ date: 2022-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -44,40 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.7'
48
- - - ">="
49
- - !ruby/object:Gem::Version
50
- version: 1.7.2
47
+ version: 2.0.3
51
48
  type: :runtime
52
49
  prerelease: false
53
50
  version_requirements: !ruby/object:Gem::Requirement
54
51
  requirements:
55
52
  - - "~>"
56
53
  - !ruby/object:Gem::Version
57
- version: '1.7'
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: 1.7.2
61
- - !ruby/object:Gem::Dependency
62
- name: posix-spawn
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '0.3'
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- version: 0.3.11
71
- type: :runtime
72
- prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - "~>"
76
- - !ruby/object:Gem::Version
77
- version: '0.3'
78
- - - ">="
79
- - !ruby/object:Gem::Version
80
- version: 0.3.11
54
+ version: 2.0.3
81
55
  - !ruby/object:Gem::Dependency
82
56
  name: pry
83
57
  requirement: !ruby/object:Gem::Requirement
@@ -256,9 +230,12 @@ require_paths:
256
230
  - lib
257
231
  required_ruby_version: !ruby/object:Gem::Requirement
258
232
  requirements:
259
- - - "~>"
233
+ - - ">="
260
234
  - !ruby/object:Gem::Version
261
235
  version: '2.6'
236
+ - - "<="
237
+ - !ruby/object:Gem::Version
238
+ version: 3.1.2
262
239
  required_rubygems_version: !ruby/object:Gem::Requirement
263
240
  requirements:
264
241
  - - ">="