pheme 4.0.3 → 4.0.5

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: 0a03bd21407e73fb60ef72e1802d45683fe8e5fb20017f5144d2a6fd5a34b59e
4
- data.tar.gz: fd9e6b59b514c56700ded3dc91a654cea4fc0fc132c32cfd9496deea30688ab0
3
+ metadata.gz: 2800b7391329c041eb8ab2e0253e3708f18cacb21458bbc210aa83e9b886685d
4
+ data.tar.gz: c3115082962233b0ae03a3b9f1ed6d67dd82e18d52417d1959b615f8ad074569
5
5
  SHA512:
6
- metadata.gz: e69e7edc5eacbe3d6e81d2e478c7963acf878a44f970f7a8ebd0b1cfa91f2077132bf2f137e6fe13c82168170ac9e6258b6c3b78c7e7cb5caea5a9a8c9874345
7
- data.tar.gz: 62ceeeec4b07913d09cd22d8e28b57e6fe19e72d62e2fa658e099ccd8ffea54753f1db71f1249e6d03366dc16c443ea0d2ff31601324f81d06b0f0e628fd925c
6
+ metadata.gz: 185617f33efa34f653fd9aa203ebf83d2f68ec5e9ce30d841eff1e47b5a7ae001af60a8b686b1793cebcb456e4630d566b55a6f6f3ed2cc79e5d292ffc8404b7
7
+ data.tar.gz: 7c86ed02c4efd79e1fac0464eaffe1b7ac891d9d5b842b8ae38a0e8b17ca8934acf9ff12a8cb53ff156999c83dd63ce55bdf71c70d384bc9312f726782e29ea4
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: Pipeline
3
+ on:
4
+ push:
5
+ jobs:
6
+ build:
7
+ name: Build
8
+ runs-on: ubuntu-20.04
9
+ steps:
10
+ - uses: actions/checkout@v2
11
+ - uses: ruby/setup-ruby@v1
12
+ with:
13
+ bundler-cache: true
14
+ - name: Lint
15
+ run: bundle exec rubocop
16
+ - name: Test
17
+ run: bundle exec rspec
18
+ - name: Release the gem
19
+ if: ${{ github.ref == 'refs/heads/main' }}
20
+ run: |
21
+ mkdir -p ~/.gem
22
+ cat << EOF > ~/.gem/credentials
23
+ ---
24
+ :github: Bearer ${GITHUB_TOKEN}
25
+ :rubygems_api_key: ${RUBYGEMS_API_KEY}
26
+ EOF
27
+ chmod 0600 ~/.gem/credentials
28
+ git config user.email "noreply@wealthsimple.com"
29
+ git config user.name "Wolfbot"
30
+ bundle exec rake release
31
+ env:
32
+ RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
data/.gitignore CHANGED
@@ -28,7 +28,6 @@ build/
28
28
 
29
29
  # for a library or gem, you might want to ignore these files since the code is
30
30
  # intended to run in multiple environments; otherwise, check them in:
31
- Gemfile.lock
32
31
  .ruby-version
33
32
  .ruby-gemset
34
33
 
data/.rubocop.yml CHANGED
@@ -6,4 +6,4 @@ inherit_gem:
6
6
 
7
7
  AllCops:
8
8
  # Specify your target Ruby version here (only major/minor versions):
9
- TargetRubyVersion: 2.4
9
+ TargetRubyVersion: 2.7
data/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## 4.0.5 - 2021-04-20
8
+ ### Changed
9
+ - Update dependencies
10
+
11
+ ## 4.0.4 - 2021-04-16
12
+ ### Changed
13
+ - Migrate CI from CircleCI to GitHub Actions
14
+
7
15
  ## 4.0.3 - 2021-03-08
8
16
  - Update documentation to include instructions on directly publishing to SQS
9
17
 
data/Gemfile.lock ADDED
@@ -0,0 +1,138 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ pheme (4.0.5)
5
+ activesupport (>= 4)
6
+ aws-sdk-sns (~> 1.1)
7
+ aws-sdk-sqs (~> 1.3)
8
+ recursive-open-struct (~> 1)
9
+ smarter_csv (~> 1)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ activesupport (6.1.3.1)
15
+ concurrent-ruby (~> 1.0, >= 1.0.2)
16
+ i18n (>= 1.6, < 2)
17
+ minitest (>= 5.1)
18
+ tzinfo (~> 2.0)
19
+ zeitwerk (~> 2.3)
20
+ ast (2.4.2)
21
+ aws-eventstream (1.1.1)
22
+ aws-partitions (1.446.0)
23
+ aws-sdk-core (3.114.0)
24
+ aws-eventstream (~> 1, >= 1.0.2)
25
+ aws-partitions (~> 1, >= 1.239.0)
26
+ aws-sigv4 (~> 1.1)
27
+ jmespath (~> 1.0)
28
+ aws-sdk-sns (1.39.0)
29
+ aws-sdk-core (~> 3, >= 3.112.0)
30
+ aws-sigv4 (~> 1.1)
31
+ aws-sdk-sqs (1.38.0)
32
+ aws-sdk-core (~> 3, >= 3.112.0)
33
+ aws-sigv4 (~> 1.1)
34
+ aws-sigv4 (1.2.3)
35
+ aws-eventstream (~> 1, >= 1.0.2)
36
+ bundler-audit (0.8.0)
37
+ bundler (>= 1.2.0, < 3)
38
+ thor (~> 1.0)
39
+ concurrent-ruby (1.1.8)
40
+ diff-lcs (1.4.4)
41
+ docile (1.3.5)
42
+ git (1.8.1)
43
+ rchardet (~> 1.8)
44
+ i18n (1.8.10)
45
+ concurrent-ruby (~> 1.0)
46
+ jmespath (1.4.0)
47
+ json (2.5.1)
48
+ minitest (5.14.4)
49
+ parallel (1.20.1)
50
+ parser (3.0.1.0)
51
+ ast (~> 2.4.1)
52
+ rack (2.2.3)
53
+ rainbow (3.0.0)
54
+ rake (13.0.3)
55
+ rchardet (1.8.0)
56
+ recursive-open-struct (1.1.3)
57
+ regexp_parser (2.1.1)
58
+ rexml (3.2.5)
59
+ rspec (3.10.0)
60
+ rspec-core (~> 3.10.0)
61
+ rspec-expectations (~> 3.10.0)
62
+ rspec-mocks (~> 3.10.0)
63
+ rspec-collection_matchers (1.2.0)
64
+ rspec-expectations (>= 2.99.0.beta1)
65
+ rspec-core (3.10.1)
66
+ rspec-support (~> 3.10.0)
67
+ rspec-expectations (3.10.1)
68
+ diff-lcs (>= 1.2.0, < 2.0)
69
+ rspec-support (~> 3.10.0)
70
+ rspec-its (1.3.0)
71
+ rspec-core (>= 3.0.0)
72
+ rspec-expectations (>= 3.0.0)
73
+ rspec-mocks (3.10.2)
74
+ diff-lcs (>= 1.2.0, < 2.0)
75
+ rspec-support (~> 3.10.0)
76
+ rspec-support (3.10.2)
77
+ rspec_junit_formatter (0.4.1)
78
+ rspec-core (>= 2, < 4, != 2.12.0)
79
+ rubocop (1.12.1)
80
+ parallel (~> 1.10)
81
+ parser (>= 3.0.0.0)
82
+ rainbow (>= 2.2.2, < 4.0)
83
+ regexp_parser (>= 1.8, < 3.0)
84
+ rexml
85
+ rubocop-ast (>= 1.2.0, < 2.0)
86
+ ruby-progressbar (~> 1.7)
87
+ unicode-display_width (>= 1.4.0, < 3.0)
88
+ rubocop-ast (1.4.1)
89
+ parser (>= 2.7.1.5)
90
+ rubocop-performance (1.10.2)
91
+ rubocop (>= 0.90.0, < 2.0)
92
+ rubocop-ast (>= 0.4.0)
93
+ rubocop-rails (2.9.1)
94
+ activesupport (>= 4.2.0)
95
+ rack (>= 1.1)
96
+ rubocop (>= 0.90.0, < 2.0)
97
+ rubocop-rspec (2.2.0)
98
+ rubocop (~> 1.0)
99
+ rubocop-ast (>= 1.1.0)
100
+ rubocop-vendor (0.6.0)
101
+ rubocop (>= 0.53.0)
102
+ ruby-progressbar (1.11.0)
103
+ simplecov (0.16.1)
104
+ docile (~> 1.1)
105
+ json (>= 1.8, < 3)
106
+ simplecov-html (~> 0.10.0)
107
+ simplecov-html (0.10.2)
108
+ smarter_csv (1.2.8)
109
+ thor (1.1.0)
110
+ tzinfo (2.0.4)
111
+ concurrent-ruby (~> 1.0)
112
+ unicode-display_width (2.0.0)
113
+ ws-style (6.9.0)
114
+ rubocop (>= 1.12.1)
115
+ rubocop-performance (>= 1.10.2)
116
+ rubocop-rails (>= 2.9.1)
117
+ rubocop-rspec (>= 2.2.0)
118
+ rubocop-vendor (>= 0.6.0)
119
+ zeitwerk (2.4.2)
120
+
121
+ PLATFORMS
122
+ ruby
123
+
124
+ DEPENDENCIES
125
+ bundler
126
+ bundler-audit
127
+ git
128
+ pheme!
129
+ rake
130
+ rspec
131
+ rspec-collection_matchers
132
+ rspec-its
133
+ rspec_junit_formatter (~> 0.2)
134
+ simplecov
135
+ ws-style
136
+
137
+ BUNDLED WITH
138
+ 2.2.16
data/README.md CHANGED
@@ -1,4 +1,7 @@
1
- # pheme [![CircleCI](https://circleci.com/gh/wealthsimple/pheme.svg?style=svg&circle-token=76942be0b1712ac066627be264886ee18039ad11)](https://circleci.com/gh/wealthsimple/pheme) [![Coverage Status](https://coveralls.io/repos/github/wealthsimple/pheme/badge.svg)](https://coveralls.io/github/wealthsimple/pheme)
1
+ # pheme
2
+ [![Github Actions Badge](https://github.com/wealthsimple/pheme/actions/workflows/main.yml/badge.svg)](https://github.com/wealthsimple/pheme/actions)
3
+
4
+ [![GitHub Actions Workflow Badge](https://github.com/wealthsimple/pheme/actions/workflows/master-workflow.yml/badge.svg)](https://github.com/wealthsimple/pheme/actions)
2
5
 
3
6
  Ruby SNS publisher + SQS poller & message handler
4
7
 
@@ -58,20 +58,18 @@ module Pheme
58
58
  queue_poller.poll(poller_configuration) do |queue_message|
59
59
  @messages_received += 1
60
60
  Pheme.logger.tagged(queue_message.message_id) do
61
- begin
62
- content = parse_body(queue_message)
63
- metadata = parse_metadata(queue_message)
64
- message_attributes = parse_message_attributes(queue_message)
65
- with_optional_connection_pool_block { handle(content, metadata, message_attributes) }
66
- queue_poller.delete_message(queue_message)
67
- log_delete(queue_message)
68
- @messages_processed += 1
69
- rescue SignalException
70
- throw :stop_polling
71
- rescue StandardError => e
72
- Pheme.logger.error(e)
73
- Pheme.rollbar(e, "#{self.class} failed to process message", { message: content })
74
- end
61
+ content = parse_body(queue_message)
62
+ metadata = parse_metadata(queue_message)
63
+ message_attributes = parse_message_attributes(queue_message)
64
+ with_optional_connection_pool_block { handle(content, metadata, message_attributes) }
65
+ queue_poller.delete_message(queue_message)
66
+ log_delete(queue_message)
67
+ @messages_processed += 1
68
+ rescue SignalException
69
+ throw :stop_polling
70
+ rescue StandardError => e
71
+ Pheme.logger.error(e)
72
+ Pheme.rollbar(e, "#{self.class} failed to process message", { message: content })
75
73
  end
76
74
  end
77
75
  log_polling_end(time_start)
data/lib/pheme/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pheme
2
- VERSION = '4.0.3'.freeze
2
+ VERSION = '4.0.5'.freeze
3
3
  end
data/pheme.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.require_paths = ["lib"]
21
21
  s.license = "MIT"
22
22
 
23
- s.required_ruby_version = '>= 2.4'
23
+ s.required_ruby_version = '>= 2.7.3'
24
24
 
25
25
  s.add_dependency "activesupport", ">= 4"
26
26
  s.add_dependency "aws-sdk-sns", "~> 1.1"
@@ -29,7 +29,6 @@ Gem::Specification.new do |s|
29
29
  s.add_dependency "smarter_csv", "~> 1"
30
30
 
31
31
  s.add_development_dependency 'bundler'
32
- s.add_development_dependency 'coveralls', "~> 0.8"
33
32
  s.add_development_dependency 'git'
34
33
  s.add_development_dependency 'rake'
35
34
  s.add_development_dependency 'rspec'
data/spec/spec_helper.rb CHANGED
@@ -1,10 +1,5 @@
1
1
  require 'simplecov'
2
- require 'coveralls'
3
2
 
4
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
5
- SimpleCov::Formatter::HTMLFormatter,
6
- Coveralls::SimpleCov::Formatter,
7
- ])
8
3
  SimpleCov.start do
9
4
  add_filter 'spec'
10
5
  end
data/spec/version_spec.rb CHANGED
@@ -21,14 +21,12 @@ describe Pheme do
21
21
 
22
22
  it 'has a bumped version' do
23
23
  git = Git.open('.')
24
- skip('already on master branch, no need to compare versions') if git.current_branch == 'master'
24
+ main_version = get_version(git, 'origin/main')
25
+ skip('first time publishing, no need to compare versions') if main_version.nil?
25
26
 
26
- head_version = get_version(git, 'HEAD')
27
- master_version = get_version(git, 'origin/master')
28
-
29
- raise 'no version.rb file found on the current branch' if head_version.nil?
30
- raise 'no version.rb file found on the master branch' if master_version.nil?
27
+ is_main_branch = git.current_branch == 'main'
28
+ skip('already on main branch, no need to compare versions') if is_main_branch
31
29
 
32
- expect(Gem::Version.new(head_version)).to be > Gem::Version.new(master_version)
30
+ expect(Gem::Version.new(head_version)).to be > Gem::Version.new(main_version)
33
31
  end
34
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pheme
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 4.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Graham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-08 00:00:00.000000000 Z
11
+ date: 2021-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -94,20 +94,6 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: coveralls
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '0.8'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '0.8'
111
97
  - !ruby/object:Gem::Dependency
112
98
  name: git
113
99
  requirement: !ruby/object:Gem::Requirement
@@ -227,9 +213,9 @@ executables: []
227
213
  extensions: []
228
214
  extra_rdoc_files: []
229
215
  files:
230
- - ".circleci/config.yml"
231
216
  - ".github/CODEOWNERS"
232
217
  - ".github/PULL_REQUEST_TEMPLATE.md"
218
+ - ".github/workflows/main.yml"
233
219
  - ".gitignore"
234
220
  - ".rspec"
235
221
  - ".rubocop.yml"
@@ -237,6 +223,7 @@ files:
237
223
  - ".ruby-version"
238
224
  - CHANGELOG.md
239
225
  - Gemfile
226
+ - Gemfile.lock
240
227
  - LICENSE
241
228
  - README.md
242
229
  - Rakefile
@@ -283,14 +270,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
283
270
  requirements:
284
271
  - - ">="
285
272
  - !ruby/object:Gem::Version
286
- version: '2.4'
273
+ version: 2.7.3
287
274
  required_rubygems_version: !ruby/object:Gem::Requirement
288
275
  requirements:
289
276
  - - ">="
290
277
  - !ruby/object:Gem::Version
291
278
  version: '0'
292
279
  requirements: []
293
- rubygems_version: 3.0.3
280
+ rubygems_version: 3.1.6
294
281
  signing_key:
295
282
  specification_version: 4
296
283
  summary: Ruby SNS publisher + SQS poller & message handler
data/.circleci/config.yml DELETED
@@ -1,153 +0,0 @@
1
- version: 2
2
-
3
- references:
4
- defaults:
5
- 2_4_10: &defaults_2_4_10
6
- working_directory: ~/wealthsimple
7
- docker:
8
- - image: circleci/ruby:2.4.10
9
- environment:
10
- RAILS_ENV: test
11
-
12
- 2_5_8: &defaults
13
- working_directory: ~/wealthsimple
14
- docker:
15
- - image: circleci/ruby:2.5.8
16
- environment:
17
- RAILS_ENV: test
18
-
19
- which_bundler: &which_bundler
20
- run:
21
- name: Which bundler?
22
- command: bundle -v
23
-
24
- bundle_install: &bundle_install
25
- run:
26
- name: Bundle Install
27
- command: bundle install --jobs=4 --retry=3 --path vendor/bundle
28
-
29
- attach_code_workspace: &attach_code_workspace
30
- attach_workspace:
31
- at: ~/wealthsimple
32
-
33
- restore_bundle_dependencies: &restore_bundle_dependencies
34
- run:
35
- name: Restore bundle dependencies from workspace
36
- command: bundle --path vendor/bundle
37
-
38
- run_rspec: &run_rspec
39
- run:
40
- name: Run rspec
41
- command: |
42
- bundle exec rspec \
43
- --require spec_helper \
44
- --format RspecJunitFormatter \
45
- --out test_results/rspec.xml \
46
- --format documentation
47
-
48
- jobs:
49
- checkout_and_bundle_2_4_10:
50
- <<: *defaults_2_4_10
51
- environment:
52
- COVERALLS_REPO_TOKEN: ''
53
- steps:
54
- - checkout
55
- - *which_bundler
56
- - *bundle_install
57
- - *run_rspec
58
- - store_test_results:
59
- path: test_results
60
-
61
- checkout_and_bundle:
62
- <<: *defaults
63
- steps:
64
- - checkout
65
- - *which_bundler
66
- - *bundle_install
67
- - persist_to_workspace:
68
- root: .
69
- paths: .
70
-
71
- rspec:
72
- <<: *defaults
73
- steps:
74
- - *attach_code_workspace
75
- - *restore_bundle_dependencies
76
- - *run_rspec
77
- - store_test_results:
78
- path: test_results
79
-
80
- lint_check:
81
- <<: *defaults
82
- steps:
83
- - *attach_code_workspace
84
- - *restore_bundle_dependencies
85
- - run: bundle exec rubocop
86
-
87
- vulnerability_check:
88
- <<: *defaults
89
- steps:
90
- - *attach_code_workspace
91
- - *restore_bundle_dependencies
92
- - run: bundle exec bundle-audit update && bundle exec bundle-audit check
93
-
94
- release:
95
- <<: *defaults
96
- steps:
97
- - checkout
98
- - *attach_code_workspace
99
- - *restore_bundle_dependencies
100
- - run:
101
- name: Release to rubygems.org
102
- command: |
103
- mkdir ~/.gem
104
- echo ":rubygems_api_key: ${RUBYGEMS_API_KEY}" >> ~/.gem/credentials
105
- chmod 600 ~/.gem/credentials
106
- bundle exec rake release
107
-
108
- workflows:
109
- version: 2
110
- build:
111
- jobs:
112
- - checkout_and_bundle_2_4_10:
113
- context: wealthsimple
114
- - checkout_and_bundle:
115
- context: wealthsimple
116
- - rspec:
117
- context: wealthsimple
118
- requires:
119
- - checkout_and_bundle
120
- - lint_check:
121
- context: wealthsimple
122
- requires:
123
- - checkout_and_bundle
124
- - vulnerability_check:
125
- context: wealthsimple
126
- requires:
127
- - checkout_and_bundle
128
- - release:
129
- context: wealthsimple
130
- filters:
131
- branches:
132
- only: master
133
- requires:
134
- - checkout_and_bundle_2_4_10
135
- - rspec
136
- - lint_check
137
- - vulnerability_check
138
-
139
- security-audit:
140
- triggers:
141
- - schedule:
142
- # 11:05 am UTC: 6:05 am EST / 7:05 am EDT
143
- cron: "5 11 * * *"
144
- filters:
145
- branches:
146
- only: master
147
- jobs:
148
- - checkout_and_bundle:
149
- context: wealthsimple
150
- - vulnerability_check:
151
- context: wealthsimple
152
- requires:
153
- - checkout_and_bundle