verdict 0.16.0 → 0.16.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: c8ad702f655cca4734df9f1019f7df665cbe04914468bdcb07ae2a5e9fcc27ca
4
- data.tar.gz: f31057b426bb631a36d99bc9a6f1588078b0009909ad25c2f5daa2180a407d66
3
+ metadata.gz: a6d20d61b4b74ae3cdc111f872f18c6bcedf9165bed983dfc489d826edad4e99
4
+ data.tar.gz: 5a23b9b6b678b0e7c7ccdd8c4df24f6029ee6f5c8a3ba16e9850147974b0a490
5
5
  SHA512:
6
- metadata.gz: 1ac4f9f4cef8e978fc36ea7848cee6b4ab15cb895d57598388f4b42997f141189a51c511f4a4b877f254b8a0d32909a153aa00da8b7e42940dbaed6d7ec9e4ec
7
- data.tar.gz: f03f49ca42347dc3bf54c0ab449df49df32e6b5fc175392e3259b4e238324de03406f64d38a17e8744f662ec9543319a41bebec0df12031f9f0ab03bb05253c2
6
+ metadata.gz: 3c931d20970cb9a75a8f9780d6648493dbf6ca2a5a9eb61f79f35896063b603b36f611cc1e6175710075d0271afad9f73efd795b09eb55c63848dc67def3a68c
7
+ data.tar.gz: '0599822d437c5e7e512a0a75e64312aaf97008d0ae31b75bacab6bdc8361a0750b22f9e14f31d70c7b41df771c20267a2719e883a0394b161e1d4367901252d7'
@@ -0,0 +1,39 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ ruby:
11
+ - 2.5
12
+ - 2.6
13
+ - 2.7
14
+ - head
15
+ - jruby
16
+ services:
17
+ redis:
18
+ image: redis
19
+ options: >-
20
+ --health-cmd "redis-cli ping"
21
+ --health-interval 10s
22
+ --health-timeout 5s
23
+ --health-retries 5
24
+ ports:
25
+ - 6379:6379
26
+ name: Tests Ruby ${{ matrix.ruby }}
27
+ steps:
28
+ - uses: actions/checkout@v1
29
+ - name: Set up Ruby ${{ matrix.ruby }}
30
+ uses: ruby/setup-ruby@v1
31
+ with:
32
+ ruby-version: ${{ matrix.ruby }}
33
+ - name: Run tests
34
+ run: |
35
+ gem install bundler
36
+ bundle install --jobs 4 --retry 3
37
+ bundle exec rake
38
+ env:
39
+ REDIS_HOST: localhost
@@ -1,3 +1,6 @@
1
+ ## v0.16.1
2
+ * Change `RedisStorage` scrub to be iterative to avoid SystemStackError while cleaning big experiments
3
+
1
4
  ## v0.16.0
2
5
  * Allow configuring the `RedisStorage` with a [`ConnectionPool`](https://github.com/mperham/connection_pool) instead of a raw `Redis` connection.
3
6
 
data/Gemfile CHANGED
@@ -2,7 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in experiments.gemspec
4
4
  gemspec
5
- gem "rubysl", platform: :rbx
6
5
  gem "json", platform: :rbx
7
6
 
8
7
  group :development do
data/dev.yml ADDED
@@ -0,0 +1,11 @@
1
+ name: verdict
2
+
3
+ type: ruby
4
+
5
+ up:
6
+ - ruby: 2.7.1
7
+ - bundler
8
+
9
+ commands:
10
+ test:
11
+ run: rake test
@@ -67,15 +67,17 @@ module Verdict
67
67
  end
68
68
 
69
69
  def scrub(scope, cursor: 0)
70
- cursor, results = redis.with do |conn|
71
- conn.hscan(scope_key(scope), cursor, count: PAGE_SIZE)
72
- end
70
+ loop do
71
+ cursor, results = redis.with do |conn|
72
+ conn.hscan(scope_key(scope), cursor, count: PAGE_SIZE)
73
+ end
73
74
 
74
- results.map(&:first).each do |key|
75
- remove(scope, key)
76
- end
75
+ results.map(&:first).each do |key|
76
+ remove(scope, key)
77
+ end
77
78
 
78
- scrub(scope, cursor: cursor) unless cursor.to_i.zero?
79
+ break if cursor.to_i.zero?
80
+ end
79
81
  end
80
82
  end
81
83
  end
@@ -1,3 +1,3 @@
1
1
  module Verdict
2
- VERSION = "0.16.0"
2
+ VERSION = "0.16.1"
3
3
  end
@@ -6,7 +6,9 @@ require 'fake_app'
6
6
  class CookieStorageTest < Minitest::Test
7
7
  def setup
8
8
  @storage = Verdict::Storage::CookieStorage.new.tap do |s|
9
- s.cookies = ActionDispatch::Cookies::CookieJar.new(nil)
9
+ request = mock()
10
+ request.stubs(:cookies_same_site_protection).returns(proc { :none })
11
+ s.cookies = ActionDispatch::Cookies::CookieJar.new(request)
10
12
  end
11
13
  @experiment = Verdict::Experiment.new(:cookie_storage_test) do
12
14
  groups { group :all, 100 }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: verdict
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-22 00:00:00.000000000 Z
11
+ date: 2020-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -117,14 +117,15 @@ extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
119
  - ".github/probots.yml"
120
+ - ".github/workflows/ci.yml"
120
121
  - ".gitignore"
121
- - ".travis.yml"
122
122
  - CHANGELOG.md
123
123
  - CONTRIBUTING.md
124
124
  - Gemfile
125
125
  - LICENSE
126
126
  - README.md
127
127
  - Rakefile
128
+ - dev.yml
128
129
  - docs/concepts.md
129
130
  - lib/verdict.rb
130
131
  - lib/verdict/assignment.rb
@@ -1,16 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- before_install: gem update bundler
4
- script: bundle exec rake
5
- rvm:
6
- - 2.5
7
- - 2.6
8
- - 2.7
9
- - ruby-head
10
- - jruby
11
- matrix:
12
- allow_failures:
13
- - rvm: ruby-head
14
- - rvm: jruby
15
- services:
16
- - redis-server