riptide 0.1.0 → 0.1.1

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: ba0fc3b9bed3ed751407638932d2837116cf6e22e60fb0af48a1264d48436ab8
4
- data.tar.gz: fedcb8f7af65998fd82f9310f7b0cd9bf59f6e9c462d775ee871c537397b28bb
3
+ metadata.gz: 4a947805ecb7172ad0027b1038e7f0d98d856dddf7e2606df1489c637dd21808
4
+ data.tar.gz: 133eb45f92218e6776182e4e6cc58f2d281d057b825192bc679dbc4f02998137
5
5
  SHA512:
6
- metadata.gz: 1d3e6be891fba1e4a1d1a93f975af5adc8ad26d409288141d866bdd7d3ac0a18ed026c254869f826339582f9aef3b220cac121373ba4906b3ef4ed27b88c8e0b
7
- data.tar.gz: 7c52dda70342567a5b89c58f1b1819ad0303b0a2883d226958744f89dc829a3c7ea2ea80b08cceb523f3f390d3648d5905ea016152873c586e9a2be6ca6869b7
6
+ metadata.gz: f7e5a9e5ab4c3aa490757b599aae3d1be8146d44e0c07a58ce467a43396d75d9ac986e9d207884a4154f47f92fad5d3604f7a8cf1035f4c6978ade6fab1c2a01
7
+ data.tar.gz: 18137a6557ea637fe7bee482203940ed85f5445ed299813aa107cac1d8082e26c5448dd2d9eb9671dac164b6b9b7034fd2ae428a77e7c098cac6add274ca3a9b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.1](https://github.com/nallenscott/riptide/compare/v0.1.0...v0.1.1) (2026-11-19)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * let runs recorded after a top-level change hold ([6510159](https://github.com/nallenscott/riptide/commit/6510159da4508a1c5da50e4676b402310d87a330))
9
+
3
10
  ## 0.1.0 (2026-11-18)
4
11
 
5
12
 
@@ -61,10 +61,6 @@ module Riptide
61
61
  { "test" => entry[:test], "reason" => entry[:reason], "change" => KINDS.fetch(entry[:kind]), "through" => entry[:via] && VIA.fetch(entry[:via]) }.compact
62
62
  end }
63
63
  end
64
-
65
- def self.full(tests, cause)
66
- new(mode: :full, total: tests.size, selected: tests.map { |test| { test: test, reason: cause.reason, kind: cause.kind, via: cause.via } })
67
- end
68
64
  end
69
65
 
70
66
  # +indexes+ hold the recorded runs and open failures, from every unit
@@ -79,7 +75,7 @@ module Riptide
79
75
  @tests = tests
80
76
  @pseudo = pseudo
81
77
  @current = {}
82
- @suite_cause = nil
78
+ @top_level = {}
83
79
  end
84
80
 
85
81
  # { index => { run id => Cause } } for the runs that don't hold here,
@@ -88,10 +84,7 @@ module Riptide
88
84
 
89
85
  def select
90
86
  @hits = @indexes.to_h { |index| [index, hits_in(index)] }
91
- if @suite_cause
92
- @hits = @indexes.to_h { |index| [index, index.run_ids.to_h { |id| [id, @suite_cause] }] }
93
- return Decision.full(@tests, @suite_cause) unless @tests.empty?
94
- end
87
+ @top_level.each { |path, cause| hit_all_but_current(path, cause) }
95
88
 
96
89
  selected = @tests.filter_map do |test|
97
90
  cause = cause_to_run(test)
@@ -131,7 +124,6 @@ module Riptide
131
124
  changed(index, path, version, current) do |reason, kind, reached|
132
125
  reached.each { |id, via| hits[id] ||= Cause.new(reason, kind, via) }
133
126
  end
134
- return hits if @suite_cause
135
127
  end
136
128
  end
137
129
  hits
@@ -153,7 +145,10 @@ module Riptide
153
145
  change = @analyzer.change(path, version)
154
146
  return yield("#{path} changed, and the recorded version isn't in this repository", :deleted, recorded.call) if change.nil?
155
147
  return if change.empty?
156
- return suite(Cause.new("#{path} changed top-level code", :boot)) if change.suite?
148
+ if change.suite?
149
+ @top_level[path] ||= Cause.new("#{path} changed top-level code", :boot)
150
+ return yield(@top_level[path].reason, :boot, recorded.call)
151
+ end
157
152
  return yield("#{path} changed as a whole", ruby?(path) ? :code : whole_kind(path), recorded.call) if change.whole?
158
153
 
159
154
  runs = nil
@@ -194,8 +189,16 @@ module Riptide
194
189
  @shared_names ||= @tests.tally.filter_map { |test, count| test if count > 1 }.to_set
195
190
  end
196
191
 
197
- def suite(cause)
198
- @suite_cause ||= cause
192
+ # Top-level code runs at boot, so a change to it reaches every test, even
193
+ # one whose run never recorded the file. A run recorded against the file
194
+ # as it is now saw that code, so it still holds unless it also recorded
195
+ # an older version.
196
+ def hit_all_but_current(path, cause)
197
+ current = current_sha(path)
198
+ @indexes.each do |index|
199
+ saw = index.manifest.fetch(path, []).include?(current) ? index.reach(index.postings(path, current)["all"]) : {}
200
+ index.run_ids.each { |id| @hits[index][id] ||= cause unless saw.key?(id) }
201
+ end
199
202
  end
200
203
 
201
204
  def current_sha(path)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Riptide
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
 
6
6
  # The Ruby minors whose VM the tracer is written for. riptide installs on
7
7
  # any other and stays off there, until someone checks the new VM.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riptide
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Allen