selective-ruby-core 0.3.1-x86_64-darwin → 0.3.3-x86_64-darwin

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: 7f9daee72b414888e640dd03b187eef94c91bcee2a001c30bf7005bf15524802
4
- data.tar.gz: fdac6353e74029bbf4852a26d40c1361247f8916f403d34adb2585ef6fc7787e
3
+ metadata.gz: 0a73318c6891feb59aa02ffa04e3aa433acdae4adffd9ede87e60dae4d61783c
4
+ data.tar.gz: 9e142f14a9fb813e1751d31f93fd0b5397db2ff33f4ea6bb6d63ca5faaa7c77f
5
5
  SHA512:
6
- metadata.gz: 9e7d2eb87c6d025b777b18676fd47108d86a6738ea02739c23b006741e3cec39c9e3d00f55e0029320bbc502e16927b3bdfc7e1abd80585dfa25aeb64144a9bd
7
- data.tar.gz: 65ce59daaf9ef3da9f9f0777c6b526b5e571799a3eb155a6e059d89c7a4a292eb1db4ab40b896e84b260615347035b4a2e603f6e2c1fdbb35ea851e92eca5314
6
+ metadata.gz: 4b6d9baa2addb26a73437ee84cb302fd55a791a1dc6e6187284a03562ee271d18c0ddf6406f26225a4c1e8fec5eb6ff165ef874ed5e9159981efb60b38fb7bad
7
+ data.tar.gz: e192bce5241a5f09ef937246c8ed94730f78f03c3974ff42e916774c99270999247cba335295b4ac8cbf41fd270f57632b22f1687ff585a5ffded1ebb96341ba
data/lib/bin/transport CHANGED
Binary file
@@ -149,7 +149,38 @@ module Selective
149
149
  end
150
150
 
151
151
  def write(data)
152
- pipe.write JSON.dump(data)
152
+ pipe.write JSON.dump(sanitize_payload(data))
153
+ end
154
+
155
+ # JSON.dump raises Encoding::UndefinedConversionError on bytes that are
156
+ # not valid UTF-8. That exception unwinds out of the test_case_result
157
+ # callback, through run_main_loop, and terminates the whole runner —
158
+ # every result for the run is lost, not just the offending one.
159
+ #
160
+ # Any test that asserts on binary data can produce this: a fixture read
161
+ # with File.binread, a protocol frame, a truncated multibyte sequence.
162
+ # Scrub on the way out so a hostile payload costs at most the fidelity
163
+ # of one failure message.
164
+ #
165
+ # NUL is stripped for a different reason: it survives JSON encoding but
166
+ # Postgres refuses it in a jsonb value (22P05), so it would fail on the
167
+ # server instead.
168
+ def sanitize_payload(value)
169
+ case value
170
+ when String then sanitize_payload_string(value)
171
+ when Array then value.map { |v| sanitize_payload(v) }
172
+ when Hash then value.to_h { |k, v| [sanitize_payload(k), sanitize_payload(v)] }
173
+ else value
174
+ end
175
+ end
176
+
177
+ def sanitize_payload_string(string)
178
+ result = string
179
+ result = result.dup.force_encoding(Encoding::UTF_8) unless result.encoding == Encoding::UTF_8
180
+ result = result.scrub("�") unless result.valid_encoding?
181
+ # Block form: a string replacement would treat backslashes as escapes.
182
+ result = result.gsub("\u0000") { "\\u0000" } if result.include?("\u0000")
183
+ result
153
184
  end
154
185
 
155
186
  def generate_runner_id
@@ -3,7 +3,7 @@
3
3
  module Selective
4
4
  module Ruby
5
5
  module Core
6
- VERSION = "0.3.1"
6
+ VERSION = "0.3.3"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selective-ruby-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: x86_64-darwin
6
6
  authors:
7
7
  - Benjamin Wood
8
8
  - Nate Vick
9
- autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2026-11-14 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: logger
@@ -29,16 +28,22 @@ dependencies:
29
28
  name: zeitwerk
30
29
  requirement: !ruby/object:Gem::Requirement
31
30
  requirements:
32
- - - "~>"
31
+ - - ">="
33
32
  - !ruby/object:Gem::Version
34
33
  version: 2.6.12
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '3'
35
37
  type: :runtime
36
38
  prerelease: false
37
39
  version_requirements: !ruby/object:Gem::Requirement
38
40
  requirements:
39
- - - "~>"
41
+ - - ">="
40
42
  - !ruby/object:Gem::Version
41
43
  version: 2.6.12
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '3'
42
47
  description: Selective is an intelligent test runner for your current CI provider.
43
48
  Get real-time test results, intelligent ordering based on code changes, shorter
44
49
  run times, automatic flake detection, the ability to re-enqueue failed tests, and
@@ -71,7 +76,6 @@ files:
71
76
  - lib/selective/ruby/core/test_map/tree.rb
72
77
  - lib/selective/ruby/core/test_map/uploader.rb
73
78
  - lib/selective/ruby/core/version.rb
74
- - selective-ruby-core.gemspec
75
79
  homepage: https://www.selective.ci
76
80
  licenses:
77
81
  - MIT
@@ -79,7 +83,6 @@ metadata:
79
83
  homepage_uri: https://www.selective.ci
80
84
  source_code_uri: http://github.com/selectiveci/selective-ruby-core
81
85
  changelog_uri: https://github.com/selectiveci/selective-ruby-core/blob/main/CHANGELOG.md
82
- post_install_message:
83
86
  rdoc_options: []
84
87
  require_paths:
85
88
  - lib
@@ -94,8 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
97
  - !ruby/object:Gem::Version
95
98
  version: '0'
96
99
  requirements: []
97
- rubygems_version: 3.5.22
98
- signing_key:
100
+ rubygems_version: 4.0.20
99
101
  specification_version: 4
100
102
  summary: Selective Ruby Client Core
101
103
  test_files: []
@@ -1,53 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/selective/ruby/core/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "selective-ruby-core"
7
- spec.version = Selective::Ruby::Core::VERSION
8
- spec.authors = ["Benjamin Wood", "Nate Vick"]
9
- spec.email = ["ben@hint.io", "nate@hint.io"]
10
- spec.license = "MIT"
11
-
12
- # Currently supported release platforms are:
13
- # Linux: x86_64-linux, aarch64-linux
14
- # MacOS: x86_64-darwin, arm64-darwin
15
- if (platform = ENV["RELEASE_PLATFORM"])
16
- spec.platform = platform
17
- end
18
-
19
- spec.summary = "Selective Ruby Client Core"
20
- spec.description = "Selective is an intelligent test runner for your current CI provider. Get real-time test results, intelligent ordering based on code changes, shorter run times, automatic flake detection, the ability to re-enqueue failed tests, and more."
21
- spec.homepage = "https://www.selective.ci"
22
- spec.required_ruby_version = ">= 2.7.0"
23
-
24
- spec.metadata["homepage_uri"] = spec.homepage
25
- spec.metadata["source_code_uri"] = "http://github.com/selectiveci/selective-ruby-core"
26
- spec.metadata["changelog_uri"] = "https://github.com/selectiveci/selective-ruby-core/blob/main/CHANGELOG.md"
27
-
28
- # Specify which files should be added to the gem when it is released.
29
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
- spec.files = Dir.chdir(__dir__) do
31
- `git ls-files -z`.split("\x0").reject do |f|
32
- (File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ docs/ rubocop/ simplicity/ test/ spec/ features/ log/ .git .circleci appveyor .rspec .ruby-version .standard.yml .rubocop-simplicity.yml README.md CHANGELOG.md CODE_OF_CONDUCT.md AGENTS.md Gemfile])
33
- end
34
- end
35
-
36
- # Add the transport binary
37
- unless ENV["RELEASE_PLATFORM"].nil?
38
- spec.files << "lib/bin/transport"
39
- end
40
-
41
- # The optional test map tracer. extconf.rb writes a no-op Makefile when it
42
- # can't build (no compiler, unsupported Ruby), so installation never fails
43
- # because of it; the runner then reports it can't record.
44
- spec.extensions = ["ext/selective_tracer/extconf.rb"]
45
-
46
- spec.bindir = "exe"
47
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
48
- spec.require_paths = ["lib"]
49
-
50
- # Uncomment to register a new dependency of your gem
51
- spec.add_dependency("logger", "~> 1.6")
52
- spec.add_dependency("zeitwerk", "~> 2.6.12")
53
- end