queue_classic_plus 4.0.0.alpha9 → 4.0.0.alpha11

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: 998da8f0e2f5f397e1125b9f47f447ba3cdb17908e79bb4eb9d34a5acb87f7d8
4
- data.tar.gz: fb21b8b1175142d27792885d814597c145b68fe2e82e8541d6db78a000c30a86
3
+ metadata.gz: ff8976dc68cd90745c7f0761be48d57abefb93066f094781d2f7d8c5d1bad0c4
4
+ data.tar.gz: '05283113c365e521b0c2e6e29166ef6e4b88e0e93206fde58c3bb592ae05e87c'
5
5
  SHA512:
6
- metadata.gz: 84850b2d1be63a0127adf54eab5d810b6fde5de1d9ee2826a2121f76343fc3442cac74de674858234fcf5ae1f25c418f70d578e242280f83485a892e935f13e3
7
- data.tar.gz: 1e2e3b3ca6d2280c5aa445737b7179e2bd7f800c8c5a971d81fc3978f753189f437c99fe6ea81b7d69c079b631e4da41c1adf09032f9fe92863c8003e3fd8ee4
6
+ metadata.gz: 40100aa7380005e2d58ce5047bf94ddba43caadf4d0b55966fdf2a311c1ae68bd402ba4af00d99957c970139a2d2331466309e3ed6694da44a14ac8abc18b571
7
+ data.tar.gz: 6c969f33a7c29f0f4e6120305b09d40e2f982631cf2e33e7d25deb16d9b2223cfb6801bd16926fac02ec17bdc330a91515925e4f5c9386f32d9edc1755314925
data/.circleci/config.yml CHANGED
@@ -3,7 +3,7 @@ version: 2.1
3
3
  jobs:
4
4
  test:
5
5
  docker:
6
- - image: circleci/ruby:2.7.4-node
6
+ - image: cimg/ruby:3.2.0
7
7
  auth:
8
8
  username: $DOCKERHUB_USERNAME
9
9
  password: $DOCKERHUB_TOKEN
@@ -27,7 +27,7 @@ jobs:
27
27
 
28
28
  push_to_rubygems:
29
29
  docker:
30
- - image: circleci/ruby:2.7.4
30
+ - image: cimg/ruby:3.2.0
31
31
  auth:
32
32
  username: $DOCKERHUB_USERNAME
33
33
  password: $DOCKERHUB_TOKEN
@@ -47,6 +47,21 @@ jobs:
47
47
  gem build queue_classic_plus
48
48
  gem push queue_classic_plus-*.gem
49
49
 
50
+ update_jira:
51
+ docker:
52
+ - image: alpine:3.8
53
+ auth:
54
+ username: $DOCKERHUB_USERNAME
55
+ password: $DOCKERHUB_TOKEN
56
+ steps:
57
+ - run:
58
+ name: Install dependencies
59
+ command: apk add --no-cache bash curl git openssh
60
+ - checkout
61
+ - run:
62
+ name: Update JIRA
63
+ command: .circleci/update-jira.sh
64
+
50
65
  workflows:
51
66
  version: 2
52
67
  gem_release:
@@ -65,3 +80,10 @@ workflows:
65
80
  - /^v.*/
66
81
  context:
67
82
  - DockerHub
83
+ - RubyGems
84
+ - update_jira:
85
+ context:
86
+ - DockerHub
87
+ - update-jira-webhook
88
+ requires:
89
+ - push_to_rubygems
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ # Use JIRA automation webhooks to move issues to SHIPPED:
6
+ # https://support.atlassian.com/jira-software-cloud/docs/automation-triggers/#Automationtriggers-Incomingwebhook
7
+
8
+ git log --max-count=50 --pretty=format:'%s' | grep -Eo '^\w+-[0-9]+' | sort -u | while read i; do
9
+ curl -X POST "$UPDATE_JIRA_WEBHOOK_URL?issue=$i"
10
+ done
data/Gemfile CHANGED
@@ -13,9 +13,9 @@ end
13
13
 
14
14
  group :test do
15
15
  gem 'byebug'
16
- gem 'rake'
17
16
  gem 'rspec'
18
17
  gem 'timecop'
19
18
  gem 'newrelic_rpm'
20
19
  gem 'ddtrace'
20
+ gem 'simplecov', require: false
21
21
  end
@@ -122,7 +122,7 @@ module QueueClassicPlus
122
122
  if defined?(ActiveRecord) && ActiveRecord::Base.connected?
123
123
  # If ActiveRecord is loaded, we use it's own transaction mechanisn since
124
124
  # it has slightly different semanctics for rollback.
125
- ActiveRecord::Base.transaction(options, &block)
125
+ ActiveRecord::Base.transaction(**options, &block)
126
126
  else
127
127
  begin
128
128
  execute "BEGIN"
@@ -2,8 +2,14 @@
2
2
 
3
3
  module QueueClassicDatadog
4
4
  def _perform(*args)
5
- Datadog.tracer.trace('qc.job', service_name: 'qc.job', resource: "#{name}#perform") do |_|
6
- super
5
+ if Gem.loaded_specs['ddtrace'].version >= Gem::Version.new('1')
6
+ Datadog::Tracing.trace('qc.job', service: 'qc.job', resource: "#{name}#perform") do |_|
7
+ super
8
+ end
9
+ else
10
+ Datadog.tracer.trace('qc.job', service_name: 'qc.job', resource: "#{name}#perform") do |_|
11
+ super
12
+ end
7
13
  end
8
14
  end
9
15
 
@@ -1,3 +1,3 @@
1
1
  module QueueClassicPlus
2
- VERSION = '4.0.0.alpha9'.freeze
2
+ VERSION = '4.0.0.alpha11'.freeze
3
3
  end
data/spec/base_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'spec_helper'
2
+ require 'active_record'
1
3
 
2
4
  describe QueueClassicPlus::Base do
3
5
  context "A child of QueueClassicPlus::Base" do
@@ -189,5 +191,32 @@ describe QueueClassicPlus::Base do
189
191
  expect(Jobs::Tests::TestJob.librato_key).to eq('jobs.tests.test_job')
190
192
  end
191
193
  end
192
- end
193
194
 
195
+ context 'with ActiveRecord' do
196
+ before do
197
+ @old_conn_adapter = QC.default_conn_adapter
198
+ @activerecord_conn = ActiveRecord::Base.establish_connection(ENV["DATABASE_URL"])
199
+ QC.default_conn_adapter = QC::ConnAdapter.new(
200
+ connection: ActiveRecord::Base.connection.raw_connection
201
+ )
202
+ end
203
+
204
+ after do
205
+ @activerecord_conn.disconnect!
206
+ QC.default_conn_adapter = @old_conn_adapter
207
+ end
208
+
209
+ subject do
210
+ Class.new(QueueClassicPlus::Base) do
211
+ @queue = :test
212
+
213
+ def self.perform(foo, bar)
214
+ end
215
+ end
216
+ end
217
+
218
+ it 'works' do
219
+ expect { subject._perform(1, 2) }.not_to raise_error
220
+ end
221
+ end
222
+ end
data/spec/datadog_spec.rb CHANGED
@@ -10,8 +10,8 @@ describe 'requiring queue_classic_plus/new_relic' do
10
10
 
11
11
  it 'adds Datadog profiling support' do
12
12
  require 'queue_classic_plus/datadog'
13
- expect(Datadog.tracer).to receive(:trace).with(
14
- 'qc.job', service_name: 'qc.job', resource: 'FunkyName#perform'
13
+ expect(Datadog::Tracing).to receive(:trace).with(
14
+ 'qc.job', service: 'qc.job', resource: 'FunkyName#perform'
15
15
  )
16
16
  subject
17
17
  end
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,10 @@
1
+ require 'simplecov'
2
+
3
+ SimpleCov.start do
4
+ add_filter(%r/^\/spec\//)
5
+ enable_coverage(:branch)
6
+ end
7
+
1
8
  require 'queue_classic_plus'
2
9
  require 'pg'
3
10
  require 'timecop'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: queue_classic_plus
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.alpha9
4
+ version: 4.0.0.alpha11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Mathieu
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-10-27 00:00:00.000000000 Z
13
+ date: 2023-01-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: queue_classic
@@ -92,10 +92,10 @@ extensions: []
92
92
  extra_rdoc_files: []
93
93
  files:
94
94
  - ".circleci/config.yml"
95
+ - ".circleci/update-jira.sh"
95
96
  - ".github/dependabot.yml"
96
97
  - ".gitignore"
97
98
  - ".rspec"
98
- - ".rvmrc"
99
99
  - Gemfile
100
100
  - Guardfile
101
101
  - LICENSE.txt
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  - !ruby/object:Gem::Version
148
148
  version: 1.3.1
149
149
  requirements: []
150
- rubygems_version: 3.1.6
150
+ rubygems_version: 3.4.1
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: Useful extras for Queue Classic
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm use 2.1.3@queue_classic_plus --create