pwwka 0.24.0 → 1.0.0.RC1

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: 91b93a22ea33ffd0151667910c29af13adaf2872c28327ae5af4aff03e9beb64
4
- data.tar.gz: 7c8bc1db3fcb3045caafbba21d8ca94838756c347951418535543a7045162ade
3
+ metadata.gz: bbe20aa33393b941e9a8dfc21eff7c787ca7c1beb7daa8fa81a1e7846717ede9
4
+ data.tar.gz: edaa4a73e2a920241ebb3ffd9598fca93a1fd8c3b975dc11c2035cc059e90905
5
5
  SHA512:
6
- metadata.gz: ac5525cd3bdf5a162d0979b58b5f750a3bdd59074d703997bfb5b574f864491430148dd9ba84afe95cd13607ed14244e792f22582004122020411cb6498fb047
7
- data.tar.gz: ccdd3938884c1f0d247176baa8c919257154e9126d347e0541703d5b2f860b39d425d8ddc96dfe2fd2fd3a18787a425942bfe7f97daa6e5d48e037188f9507fd
6
+ metadata.gz: 669be067f88ac9a7138134cdde10d8ca2888319633d108317f61bf4ea64fb5fc85de2a731273fa88281c85b8444d2ee2033a8513e8ee0926a18eb0b8eb6201af
7
+ data.tar.gz: 87775761df6856f4396e0f1900d794dcf91bfb4a264395cd900f7e485324796644ae7d4223daa87c3120b1f0ebf990abdce32b3a2f80e9213bd5cd93a4cb6a26
data/.circleci/config.yml CHANGED
@@ -1,15 +1,39 @@
1
- # DO NOT MODIFY - this is managed by Git Reduce in goro
1
+ # DO NOT MODIFY - this is managed by Git Reduce in goro and generated from build-matrix.json
2
2
  #
3
3
  ---
4
4
  version: 2
5
5
  jobs:
6
+ generate-and-push-docs:
7
+ docker:
8
+ - image: cimg/ruby:3.0.3
9
+ auth:
10
+ username: "$DOCKERHUB_USERNAME"
11
+ password: "$DOCKERHUB_PASSWORD"
12
+ steps:
13
+ - checkout
14
+ - run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN
15
+ - run: bundle install
16
+ - run:
17
+ name: Generate documentation
18
+ command: ' if [[ $(bundle exec rake -T docs:generate:custom) ]]; then echo
19
+ "Generating docs using rake task docs:generate:custom" ; bundle exec rake
20
+ docs:generate:custom ; elif [[ $(bundle exec rake -T docs:generate) ]];
21
+ then echo "Generating docs using rake task docs:generate" ; bundle exec
22
+ rake docs:generate ; else echo "Skipping doc generation" ; exit 0 ; fi '
23
+ - run:
24
+ name: Push documentation to Unwritten
25
+ command: if [[ $(bundle exec rake -T docs:push) ]]; then bundle exec rake
26
+ docs:push; fi
6
27
  release:
7
28
  docker:
8
- - image: circleci/ruby:2.7.1
29
+ - image: cimg/ruby:3.0.3
30
+ auth:
31
+ username: "$DOCKERHUB_USERNAME"
32
+ password: "$DOCKERHUB_PASSWORD"
9
33
  steps:
10
34
  - checkout
11
35
  - run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN
12
- - run: bundle install --full-index
36
+ - run: bundle install
13
37
  - run:
14
38
  name: Artifactory login
15
39
  command: mkdir -p ~/.gem && curl -u$ARTIFACTORY_USER:$ARTIFACTORY_TOKEN https://stitchfix01.jfrog.io/stitchfix01/api/gems/eng-gems/api/v1/api_key.yaml
@@ -17,23 +41,32 @@ jobs:
17
41
  - run:
18
42
  name: Build/release gem to artifactory
19
43
  command: bundle exec rake push_artifactory
20
- ruby-2.7.1-rails-6.0:
44
+ ruby-3.0.3-rails-7.0:
21
45
  docker:
22
- - image: circleci/ruby:2.7.1
46
+ - image: cimg/ruby:3.0.3
47
+ auth:
48
+ username: "$DOCKERHUB_USERNAME"
49
+ password: "$DOCKERHUB_PASSWORD"
23
50
  environment:
24
- BUNDLE_GEMFILE: Gemfile.rails-6.0
51
+ BUNDLE_GEMFILE: Gemfile.rails-7.0
25
52
  - image: redis:2.8.12
53
+ auth:
54
+ username: "$DOCKERHUB_USERNAME"
55
+ password: "$DOCKERHUB_PASSWORD"
26
56
  - image: rabbitmq:3.5.6
57
+ auth:
58
+ username: "$DOCKERHUB_USERNAME"
59
+ password: "$DOCKERHUB_PASSWORD"
27
60
  working_directory: "~/pwwka"
28
61
  steps:
29
62
  - checkout
30
63
  - run:
31
64
  name: Check for Gemfile.lock presence
32
65
  command: ' if (test -f Gemfile.lock) then echo "Dont commit Gemfile.lock (see
33
- https://github.com/stitchfix/eng-wiki/blob/master/architecture-decisions/0009-rubygem-dependencies-will-be-managed-more-explicitly.md)"
66
+ https://github.com/stitchfix/eng-wiki/blob/main/architecture-decisions/0009-rubygem-dependencies-will-be-managed-more-explicitly.md)"
34
67
  1>&2 ; exit 1 ; else exit 0 ; fi '
35
68
  - run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN
36
- - run: bundle install --full-index
69
+ - run: bundle install
37
70
  - run: bundle exec rspec --format RspecJunitFormatter --out /tmp/test-results/rspec.xml
38
71
  --format=doc
39
72
  - run:
@@ -46,23 +79,32 @@ jobs:
46
79
  when: on_fail
47
80
  - store_test_results:
48
81
  path: "/tmp/test-results"
49
- ruby-2.6.6-rails-6.0:
82
+ ruby-2.7.5-rails-7.0:
50
83
  docker:
51
- - image: circleci/ruby:2.6.6
84
+ - image: cimg/ruby:2.7.5
85
+ auth:
86
+ username: "$DOCKERHUB_USERNAME"
87
+ password: "$DOCKERHUB_PASSWORD"
52
88
  environment:
53
- BUNDLE_GEMFILE: Gemfile.rails-6.0
89
+ BUNDLE_GEMFILE: Gemfile.rails-7.0
54
90
  - image: redis:2.8.12
91
+ auth:
92
+ username: "$DOCKERHUB_USERNAME"
93
+ password: "$DOCKERHUB_PASSWORD"
55
94
  - image: rabbitmq:3.5.6
95
+ auth:
96
+ username: "$DOCKERHUB_USERNAME"
97
+ password: "$DOCKERHUB_PASSWORD"
56
98
  working_directory: "~/pwwka"
57
99
  steps:
58
100
  - checkout
59
101
  - run:
60
102
  name: Check for Gemfile.lock presence
61
103
  command: ' if (test -f Gemfile.lock) then echo "Dont commit Gemfile.lock (see
62
- https://github.com/stitchfix/eng-wiki/blob/master/architecture-decisions/0009-rubygem-dependencies-will-be-managed-more-explicitly.md)"
104
+ https://github.com/stitchfix/eng-wiki/blob/main/architecture-decisions/0009-rubygem-dependencies-will-be-managed-more-explicitly.md)"
63
105
  1>&2 ; exit 1 ; else exit 0 ; fi '
64
106
  - run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN
65
- - run: bundle install --full-index
107
+ - run: bundle install
66
108
  - run: bundle exec rspec --format RspecJunitFormatter --out /tmp/test-results/rspec.xml
67
109
  --format=doc
68
110
  - run:
@@ -75,23 +117,32 @@ jobs:
75
117
  when: on_fail
76
118
  - store_test_results:
77
119
  path: "/tmp/test-results"
78
- ruby-2.7.1-rails-5.2:
120
+ ruby-3.0.3-rails-6.1:
79
121
  docker:
80
- - image: circleci/ruby:2.7.1
122
+ - image: cimg/ruby:3.0.3
123
+ auth:
124
+ username: "$DOCKERHUB_USERNAME"
125
+ password: "$DOCKERHUB_PASSWORD"
81
126
  environment:
82
- BUNDLE_GEMFILE: Gemfile.rails-5.2
127
+ BUNDLE_GEMFILE: Gemfile.rails-6.1
83
128
  - image: redis:2.8.12
129
+ auth:
130
+ username: "$DOCKERHUB_USERNAME"
131
+ password: "$DOCKERHUB_PASSWORD"
84
132
  - image: rabbitmq:3.5.6
133
+ auth:
134
+ username: "$DOCKERHUB_USERNAME"
135
+ password: "$DOCKERHUB_PASSWORD"
85
136
  working_directory: "~/pwwka"
86
137
  steps:
87
138
  - checkout
88
139
  - run:
89
140
  name: Check for Gemfile.lock presence
90
141
  command: ' if (test -f Gemfile.lock) then echo "Dont commit Gemfile.lock (see
91
- https://github.com/stitchfix/eng-wiki/blob/master/architecture-decisions/0009-rubygem-dependencies-will-be-managed-more-explicitly.md)"
142
+ https://github.com/stitchfix/eng-wiki/blob/main/architecture-decisions/0009-rubygem-dependencies-will-be-managed-more-explicitly.md)"
92
143
  1>&2 ; exit 1 ; else exit 0 ; fi '
93
144
  - run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN
94
- - run: bundle install --full-index
145
+ - run: bundle install
95
146
  - run: bundle exec rspec --format RspecJunitFormatter --out /tmp/test-results/rspec.xml
96
147
  --format=doc
97
148
  - run:
@@ -104,23 +155,32 @@ jobs:
104
155
  when: on_fail
105
156
  - store_test_results:
106
157
  path: "/tmp/test-results"
107
- ruby-2.6.6-rails-5.2:
158
+ ruby-2.7.5-rails-6.1:
108
159
  docker:
109
- - image: circleci/ruby:2.6.6
160
+ - image: cimg/ruby:2.7.5
161
+ auth:
162
+ username: "$DOCKERHUB_USERNAME"
163
+ password: "$DOCKERHUB_PASSWORD"
110
164
  environment:
111
- BUNDLE_GEMFILE: Gemfile.rails-5.2
165
+ BUNDLE_GEMFILE: Gemfile.rails-6.1
112
166
  - image: redis:2.8.12
167
+ auth:
168
+ username: "$DOCKERHUB_USERNAME"
169
+ password: "$DOCKERHUB_PASSWORD"
113
170
  - image: rabbitmq:3.5.6
171
+ auth:
172
+ username: "$DOCKERHUB_USERNAME"
173
+ password: "$DOCKERHUB_PASSWORD"
114
174
  working_directory: "~/pwwka"
115
175
  steps:
116
176
  - checkout
117
177
  - run:
118
178
  name: Check for Gemfile.lock presence
119
179
  command: ' if (test -f Gemfile.lock) then echo "Dont commit Gemfile.lock (see
120
- https://github.com/stitchfix/eng-wiki/blob/master/architecture-decisions/0009-rubygem-dependencies-will-be-managed-more-explicitly.md)"
180
+ https://github.com/stitchfix/eng-wiki/blob/main/architecture-decisions/0009-rubygem-dependencies-will-be-managed-more-explicitly.md)"
121
181
  1>&2 ; exit 1 ; else exit 0 ; fi '
122
182
  - run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN
123
- - run: bundle install --full-index
183
+ - run: bundle install
124
184
  - run: bundle exec rspec --format RspecJunitFormatter --out /tmp/test-results/rspec.xml
125
185
  --format=doc
126
186
  - run:
@@ -140,31 +200,40 @@ workflows:
140
200
  - release:
141
201
  context: org-global
142
202
  requires:
143
- - ruby-2.7.1-rails-6.0
144
- - ruby-2.6.6-rails-6.0
145
- - ruby-2.7.1-rails-5.2
146
- - ruby-2.6.6-rails-5.2
203
+ - ruby-3.0.3-rails-7.0
204
+ - ruby-2.7.5-rails-7.0
205
+ - ruby-3.0.3-rails-6.1
206
+ - ruby-2.7.5-rails-6.1
207
+ filters:
208
+ tags:
209
+ only: /^[0-9]+\.[0-9]+\.[0-9]+(\.?(RC|rc)[-\.]?\w*)?$/
210
+ branches:
211
+ ignore: /.*/
212
+ - generate-and-push-docs:
213
+ context: org-global
214
+ requires:
215
+ - release
147
216
  filters:
148
217
  tags:
149
218
  only: /^[0-9]+\.[0-9]+\.[0-9]+(\.?(RC|rc)[-\.]?\w*)?$/
150
219
  branches:
151
220
  ignore: /.*/
152
- - ruby-2.7.1-rails-6.0:
221
+ - ruby-3.0.3-rails-7.0:
153
222
  context: org-global
154
223
  filters:
155
224
  tags:
156
225
  only: &1 /.*/
157
- - ruby-2.6.6-rails-6.0:
226
+ - ruby-2.7.5-rails-7.0:
158
227
  context: org-global
159
228
  filters:
160
229
  tags:
161
230
  only: *1
162
- - ruby-2.7.1-rails-5.2:
231
+ - ruby-3.0.3-rails-6.1:
163
232
  context: org-global
164
233
  filters:
165
234
  tags:
166
235
  only: *1
167
- - ruby-2.6.6-rails-5.2:
236
+ - ruby-2.7.5-rails-6.1:
168
237
  context: org-global
169
238
  filters:
170
239
  tags:
@@ -176,13 +245,13 @@ workflows:
176
245
  filters:
177
246
  branches:
178
247
  only:
179
- - master
248
+ - main
180
249
  jobs:
181
- - ruby-2.7.1-rails-6.0:
250
+ - ruby-3.0.3-rails-7.0:
182
251
  context: org-global
183
- - ruby-2.6.6-rails-6.0:
252
+ - ruby-2.7.5-rails-7.0:
184
253
  context: org-global
185
- - ruby-2.7.1-rails-5.2:
254
+ - ruby-3.0.3-rails-6.1:
186
255
  context: org-global
187
- - ruby-2.6.6-rails-5.2:
256
+ - ruby-2.7.5-rails-6.1:
188
257
  context: org-global
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.1
1
+ ruby-2.7.3
@@ -4,4 +4,4 @@ source 'https://stitchfix01.jfrog.io/stitchfix01/api/gems/eng-gems/'
4
4
 
5
5
  gemspec
6
6
 
7
- gem 'activesupport', '~> 6.0.0'
7
+ gem 'activesupport', '~> 6.1.0'
@@ -4,4 +4,4 @@ source 'https://stitchfix01.jfrog.io/stitchfix01/api/gems/eng-gems/'
4
4
 
5
5
  gemspec
6
6
 
7
- gem 'activesupport', '~> 5.1.0'
7
+ gem 'activesupport', '~> 7.0.0'
@@ -48,11 +48,8 @@ module Pwwka
48
48
  if @app_id.to_s.strip == ""
49
49
  if defined?(Rails)
50
50
  if Rails.respond_to?(:application) && Rails.respond_to?(:version)
51
- # Module#module_parent is the preferred technique, but we keep usage
52
- # of the deprecated Module#parent for Rails 5 compatibility. see
53
- # https://github.com/stitchfix/pwwka/issues/91 for context.
54
51
  app_klass = Rails.application.class
55
- app_parent = Rails.version =~ /^6/ ? app_klass.module_parent : app_klass.parent
52
+ app_parent = app_klass.module_parent
56
53
  app_parent.name
57
54
  else
58
55
  raise "'Rails' is defined, but it doesn't respond to #application or #version, so could not derive the app_id; you must explicitly set it"
data/lib/pwwka/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Pwwka
2
- VERSION = '0.24.0'
2
+ VERSION = '1.0.0.RC1'
3
3
  end
4
4
 
data/pwwka.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
21
  s.require_paths = ["lib"]
22
22
  s.add_runtime_dependency("bunny")
23
- s.add_runtime_dependency("activesupport")
23
+ s.add_runtime_dependency("activesupport", ">= 6.0.0")
24
24
  s.add_runtime_dependency("activemodel")
25
25
  s.add_runtime_dependency("mono_logger")
26
26
  s.add_development_dependency("rake")
@@ -2,6 +2,7 @@ require 'spec_helper.rb'
2
2
  require 'resqutils/spec/resque_helpers'
3
3
  require 'resqutils/spec/resque_matchers'
4
4
  require 'pwwka/queue_resque_job_handler'
5
+ require 'active_support/time'
5
6
 
6
7
  require_relative "support/integration_test_setup"
7
8
  require_relative "support/logging_receiver"
@@ -201,7 +202,7 @@ describe "sending and receiving messages", :integration do
201
202
  it "can queue a job to send a message with a delay" do
202
203
  Pwwka::Transmitter.send_message_async({ sample: "payload" },
203
204
  "pwwka.testing.bar",
204
- delay_by_ms: 1)
205
+ delay_by_ms: 1_000)
205
206
 
206
207
  allow_receivers_to_process_queues # not expecting anything to be processed
207
208
 
data/spec/spec_helper.rb CHANGED
@@ -11,7 +11,12 @@ end
11
11
 
12
12
  require 'pwwka'
13
13
  require 'pwwka/test_handler'
14
- require 'active_support/core_ext/hash'
14
+ begin
15
+ require 'active_support/core_ext/hash'
16
+ rescue NameError
17
+ require "active_support/isolated_execution_state"
18
+ require 'active_support/core_ext/hash'
19
+ end
15
20
 
16
21
  # These are required in pwwka proper, but they are guarded to not cause
17
22
  # an error if missing. Requiring here so their absence will fail the tests
@@ -26,7 +31,7 @@ test_configuration = TestConfiguration.new(File.join(GEM_ROOT,"docker-compose.ym
26
31
  RSpec.configure do |config|
27
32
 
28
33
  config.expect_with :rspec do |c|
29
- c.syntax = [:should,:expect] # should is needed to make a resque helper
34
+ c.syntax = [:should,:expect] # should is needed to make a resque helper
30
35
  # from resqutils work
31
36
  end
32
37
 
@@ -77,7 +77,11 @@ describe Pwwka::Configuration do
77
77
  end
78
78
 
79
79
  def self.version
80
- '5.2.0'
80
+ active_support_dependency = Bundler.locked_gems.dependencies.detect do |name, dep|
81
+ name == "activesupport"
82
+ end.last
83
+ version_specification = active_support_dependency.requirement.to_s
84
+ version_specification[/\d.+/]
81
85
  end
82
86
  end
83
87
  Object.const_set("Rails",rails)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwwka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.0
4
+ version: 1.0.0.RC1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stitch Fix Engineering
@@ -12,10 +12,10 @@ authors:
12
12
  - Jonathan Dean
13
13
  - Nick Reavill
14
14
  - Simeon Willbanks
15
- autorequire:
15
+ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2020-08-25 00:00:00.000000000 Z
18
+ date: 2022-01-27 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: bunny
@@ -37,14 +37,14 @@ dependencies:
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 6.0.0
41
41
  type: :runtime
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 6.0.0
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: activemodel
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -239,11 +239,8 @@ files:
239
239
  - CODE_OF_CONDUCT.md
240
240
  - CONTRIBUTING.md
241
241
  - Gemfile
242
- - Gemfile.rails-4.2
243
- - Gemfile.rails-5.0
244
- - Gemfile.rails-5.1
245
- - Gemfile.rails-5.2
246
- - Gemfile.rails-6.0
242
+ - Gemfile.rails-6.1
243
+ - Gemfile.rails-7.0
247
244
  - LICENSE
248
245
  - README.md
249
246
  - Rakefile
@@ -304,7 +301,7 @@ homepage: https://github.com/stitchfix/pwwka
304
301
  licenses:
305
302
  - MIT
306
303
  metadata: {}
307
- post_install_message:
304
+ post_install_message:
308
305
  rdoc_options: []
309
306
  require_paths:
310
307
  - lib
@@ -315,12 +312,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
315
312
  version: '0'
316
313
  required_rubygems_version: !ruby/object:Gem::Requirement
317
314
  requirements:
318
- - - ">="
315
+ - - ">"
319
316
  - !ruby/object:Gem::Version
320
- version: '0'
317
+ version: 1.3.1
321
318
  requirements: []
322
- rubygems_version: 3.1.2
323
- signing_key:
319
+ rubygems_version: 3.1.6
320
+ signing_key:
324
321
  specification_version: 4
325
322
  summary: Send and receive messages via RabbitMQ
326
323
  test_files:
data/Gemfile.rails-4.2 DELETED
@@ -1,8 +0,0 @@
1
- # DO NOT MODIFY - this is managed by Git Reduce in goro
2
- #
3
- source 'https://gem.fury.io/me/'
4
- source 'https://www.rubygems.org'
5
-
6
- gemspec
7
-
8
- gem 'activesupport', '~> 4.2.0'
data/Gemfile.rails-5.0 DELETED
@@ -1,8 +0,0 @@
1
- # DO NOT MODIFY - this is managed by Git Reduce in goro
2
- #
3
- source 'https://gem.fury.io/me/'
4
- source 'https://www.rubygems.org'
5
-
6
- gemspec
7
-
8
- gem 'activesupport', '~> 5.0.0'
data/Gemfile.rails-5.2 DELETED
@@ -1,7 +0,0 @@
1
- # DO NOT MODIFY - this is managed by Git Reduce in goro
2
- #
3
- source 'https://stitchfix01.jfrog.io/stitchfix01/api/gems/eng-gems/'
4
-
5
- gemspec
6
-
7
- gem 'activesupport', '~> 5.2.0'