Skip to content

Commit

Permalink
Merge pull request #46 from rainforestapp/update_ruby_320
Browse files Browse the repository at this point in the history
RF-26342 Support ruby 3.2.0
  • Loading branch information
sebaherrera07 authored Jan 10, 2023
2 parents 8632390 + 9f3564c commit 1c45af8
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 6 deletions.
26 changes: 24 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2.1
jobs:
test:
docker:
- image: cimg/ruby:3.0.3
- image: cimg/ruby:3.2.0
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_TOKEN
Expand All @@ -27,7 +27,7 @@ jobs:
push_to_rubygems:
docker:
- image: cimg/ruby:3.0.3
- image: cimg/ruby:3.2.0
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_TOKEN
Expand All @@ -47,6 +47,21 @@ jobs:
gem build queue_classic_plus
gem push queue_classic_plus-*.gem
update_jira:
docker:
- image: alpine:3.8
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_TOKEN
steps:
- run:
name: Install dependencies
command: apk add --no-cache bash curl git openssh
- checkout
- run:
name: Update JIRA
command: .circleci/update-jira.sh

workflows:
version: 2
gem_release:
Expand All @@ -65,3 +80,10 @@ workflows:
- /^v.*/
context:
- DockerHub
- RubyGems
- update_jira:
context:
- DockerHub
- update-jira-webhook
requires:
- push_to_rubygems
10 changes: 10 additions & 0 deletions .circleci/update-jira.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -euo pipefail

# Use JIRA automation webhooks to move issues to SHIPPED:
# https://support.atlassian.com/jira-software-cloud/docs/automation-triggers/#Automationtriggers-Incomingwebhook

git log --max-count=50 --pretty=format:'%s' | grep -Eo '^\w+-[0-9]+' | sort -u | while read i; do
curl -X POST "$UPDATE_JIRA_WEBHOOK_URL?issue=$i"
done
10 changes: 8 additions & 2 deletions lib/queue_classic_plus/datadog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

module QueueClassicDatadog
def _perform(*args)
Datadog.tracer.trace('qc.job', service_name: 'qc.job', resource: "#{name}#perform") do |_|
super
if Gem.loaded_specs['ddtrace'].version >= Gem::Version.new('1')
Datadog::Tracing.trace('qc.job', service: 'qc.job', resource: "#{name}#perform") do |_|
super
end
else
Datadog.tracer.trace('qc.job', service_name: 'qc.job', resource: "#{name}#perform") do |_|
super
end
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/datadog_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def self.perform

it 'adds Datadog profiling support' do
require 'queue_classic_plus/datadog'
expect(Datadog.tracer).to receive(:trace).with(
'qc.job', service_name: 'qc.job', resource: 'FunkyName#perform'
expect(Datadog::Tracing).to receive(:trace).with(
'qc.job', service: 'qc.job', resource: 'FunkyName#perform'
)
subject
end
Expand Down

0 comments on commit 1c45af8

Please sign in to comment.