selective-ruby-core 0.3.0-x86_64-linux → 0.3.2-x86_64-linux

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: 5d18be3e0209122d8f9d3d54d5603e8f13919181e6bb1cbb9b8aecff84a237e7
4
- data.tar.gz: 1db6735a30908f2126f2c0562a701d0b87b8a37fc7cde55797fb047a8ea574bb
3
+ metadata.gz: b224f0022532bfe9cc4fc2f04bad0d7261bf25e5897d04328a045f75c6d55106
4
+ data.tar.gz: 234d9aa16fc35c6cfe7c8035614aca04efd370d83f281165af0a91d209bc1fe1
5
5
  SHA512:
6
- metadata.gz: cbd0982a7c490fa386a5530a3d53e4e0c79afff32859b563fbb9ebcb2693bf67635c5a434b0b05ab3186e3c5e79b63edd5dcaab957b40bdd8869de53bb4ef6bc
7
- data.tar.gz: 375a032a43107adf9907109242721823dc39610ed35dbb7d1e75dd4e353e71d23a7d9981f08532acbbf7040c64dd06248c491562aebb1b388d78b9ce22f8f43f
6
+ metadata.gz: d7acc47b6ee0c55e767f4a6202dd403587660bb8355185e6d3f335c1e59e19e48d1ce131a9deb38b5b45364728a7ffc3d6c1953bd130d0bdc81f5b163449ac7a
7
+ data.tar.gz: 85a653ddb872c54715b9303a0ac80996d24afe61d913ae9e1904b06686ca9c4aa1f3036a3c6159f4c649f6787ace5c048b53f23e28e89bdbb72f7f22c8ffd4b7
data/lib/bin/build_env.sh CHANGED
@@ -44,6 +44,8 @@ if [ -n "$GITHUB_ACTIONS" ]; then
44
44
  if [ -f "$GITHUB_EVENT_PATH" ]; then
45
45
  if command -v jq >/dev/null 2>&1; then
46
46
  base_sha=$(jq -r '.pull_request.base.sha // .before // empty' < "$GITHUB_EVENT_PATH" 2>/dev/null)
47
+ # On pull_request events GITHUB_SHA is GitHub's merge commit; this is the branch's own commit.
48
+ head_sha=$(jq -r '.pull_request.head.sha // empty' < "$GITHUB_EVENT_PATH" 2>/dev/null)
47
49
  else
48
50
  base_sha=$(grep -o '"before"[[:space:]]*:[[:space:]]*"[^"]*"' "$GITHUB_EVENT_PATH" | head -1 | sed -E 's/.*"[^"]*"[[:space:]]*:[[:space:]]*"([^"]*)".*/\1/')
49
51
  fi
@@ -194,6 +196,7 @@ cat <<EOF
194
196
  "actor": "$(escape "${SELECTIVE_ACTOR:-$actor}")",
195
197
  "sha": "$(escape "${SELECTIVE_SHA:-$sha}")",
196
198
  "base_sha": "$(escape "${SELECTIVE_BASE_SHA:-$base_sha}")",
199
+ "head_sha": "$(escape "${SELECTIVE_HEAD_SHA:-${head_sha:-${SELECTIVE_SHA:-$sha}}}")",
197
200
  "run_id": "$(escape "${SELECTIVE_RUN_ID:-$run_id}")",
198
201
  "run_attempt": "$(escape "${SELECTIVE_RUN_ATTEMPT:-$run_attempt}")",
199
202
  "runner_id": "$(escape "${SELECTIVE_RUNNER_ID:-$runner_id}")",
@@ -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.0"
6
+ VERSION = "0.3.2"
7
7
  end
8
8
  end
9
9
  end
@@ -0,0 +1,53 @@
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", "< 3")
53
+ end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selective-ruby-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Benjamin Wood
8
8
  - Nate Vick
9
+ autorequire:
9
10
  bindir: exe
10
11
  cert_chain: []
11
- date: 1980-01-02 00:00:00.000000000 Z
12
+ date: 2026-11-18 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: logger
@@ -28,16 +29,22 @@ dependencies:
28
29
  name: zeitwerk
29
30
  requirement: !ruby/object:Gem::Requirement
30
31
  requirements:
31
- - - "~>"
32
+ - - ">="
32
33
  - !ruby/object:Gem::Version
33
34
  version: 2.6.12
35
+ - - "<"
36
+ - !ruby/object:Gem::Version
37
+ version: '3'
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
37
41
  requirements:
38
- - - "~>"
42
+ - - ">="
39
43
  - !ruby/object:Gem::Version
40
44
  version: 2.6.12
45
+ - - "<"
46
+ - !ruby/object:Gem::Version
47
+ version: '3'
41
48
  description: Selective is an intelligent test runner for your current CI provider.
42
49
  Get real-time test results, intelligent ordering based on code changes, shorter
43
50
  run times, automatic flake detection, the ability to re-enqueue failed tests, and
@@ -70,6 +77,7 @@ files:
70
77
  - lib/selective/ruby/core/test_map/tree.rb
71
78
  - lib/selective/ruby/core/test_map/uploader.rb
72
79
  - lib/selective/ruby/core/version.rb
80
+ - selective-ruby-core.gemspec
73
81
  homepage: https://www.selective.ci
74
82
  licenses:
75
83
  - MIT
@@ -77,6 +85,7 @@ metadata:
77
85
  homepage_uri: https://www.selective.ci
78
86
  source_code_uri: http://github.com/selectiveci/selective-ruby-core
79
87
  changelog_uri: https://github.com/selectiveci/selective-ruby-core/blob/main/CHANGELOG.md
88
+ post_install_message:
80
89
  rdoc_options: []
81
90
  require_paths:
82
91
  - lib
@@ -91,7 +100,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
100
  - !ruby/object:Gem::Version
92
101
  version: '0'
93
102
  requirements: []
94
- rubygems_version: 4.0.20
103
+ rubygems_version: 3.5.22
104
+ signing_key:
95
105
  specification_version: 4
96
106
  summary: Selective Ruby Client Core
97
107
  test_files: []