sentry-raven 2.13.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.craft.yml +15 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
  4. data/.github/pull_request_template.md +16 -0
  5. data/.github/workflows/test.yml +92 -0
  6. data/.github/workflows/zeus_upload.yml +32 -0
  7. data/.gitignore +3 -0
  8. data/.rubocop.yml +50 -12
  9. data/.scripts/bump-version.sh +9 -0
  10. data/{changelog.md → CHANGELOG.md} +155 -1
  11. data/CONTRIBUTING.md +71 -0
  12. data/Gemfile +20 -25
  13. data/README.md +26 -16
  14. data/lib/raven/backtrace.rb +9 -5
  15. data/lib/raven/base.rb +6 -2
  16. data/lib/raven/breadcrumbs/{activesupport.rb → active_support_logger.rb} +9 -3
  17. data/lib/raven/breadcrumbs/logger.rb +2 -92
  18. data/lib/raven/breadcrumbs/sentry_logger.rb +73 -0
  19. data/lib/raven/breadcrumbs.rb +1 -1
  20. data/lib/raven/cli.rb +10 -21
  21. data/lib/raven/client.rb +9 -4
  22. data/lib/raven/configuration.rb +86 -10
  23. data/lib/raven/context.rb +13 -8
  24. data/lib/raven/core_ext/object/deep_dup.rb +57 -0
  25. data/lib/raven/core_ext/object/duplicable.rb +153 -0
  26. data/lib/raven/event.rb +27 -15
  27. data/lib/raven/helpers/deprecation_helper.rb +17 -0
  28. data/lib/raven/instance.rb +9 -4
  29. data/lib/raven/integrations/delayed_job.rb +13 -14
  30. data/lib/raven/integrations/rack-timeout.rb +7 -4
  31. data/lib/raven/integrations/rack.rb +4 -3
  32. data/lib/raven/integrations/rails/active_job.rb +6 -4
  33. data/lib/raven/integrations/rails/backtrace_cleaner.rb +29 -0
  34. data/lib/raven/integrations/rails/overrides/debug_exceptions_catcher.rb +2 -2
  35. data/lib/raven/integrations/rails.rb +13 -3
  36. data/lib/raven/integrations/sidekiq/cleanup_middleware.rb +13 -0
  37. data/lib/raven/integrations/sidekiq/context_filter.rb +42 -0
  38. data/lib/raven/integrations/sidekiq/error_handler.rb +38 -0
  39. data/lib/raven/integrations/sidekiq.rb +4 -78
  40. data/lib/raven/interface.rb +2 -2
  41. data/lib/raven/interfaces/stack_trace.rb +1 -1
  42. data/lib/raven/linecache.rb +5 -2
  43. data/lib/raven/logger.rb +3 -2
  44. data/lib/raven/processor/cookies.rb +16 -6
  45. data/lib/raven/processor/post_data.rb +2 -0
  46. data/lib/raven/processor/removecircularreferences.rb +3 -1
  47. data/lib/raven/processor/sanitizedata.rb +65 -17
  48. data/lib/raven/processor/utf8conversion.rb +2 -0
  49. data/lib/raven/transports/http.rb +5 -5
  50. data/lib/raven/transports.rb +4 -0
  51. data/lib/raven/utils/exception_cause_chain.rb +1 -0
  52. data/lib/raven/utils/real_ip.rb +1 -1
  53. data/lib/raven/version.rb +2 -2
  54. data/lib/sentry-raven-without-integrations.rb +6 -1
  55. data/lib/sentry_raven_without_integrations.rb +1 -0
  56. data/sentry-raven.gemspec +2 -2
  57. metadata +21 -12
  58. data/.travis.yml +0 -47
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 478a0cd677f1508fc2153381addf6956e189c5f9491ede8f79b6097977dd59b9
4
- data.tar.gz: d87fe2f303acf7e1d8b658950a1e591800eaf8a0f8bbdd35637355ac6856f571
3
+ metadata.gz: 41350227e78833d91c3cbff3192b09d7bf3cec1b8560aeabf815ec5f6fcac156
4
+ data.tar.gz: a40cf7486907f4069c719584c63dcf36a34587702bcfee8a25e0ab5816cdf72f
5
5
  SHA512:
6
- metadata.gz: c83298b6f11a500e50f4e530de5421f32d15f7ea72d3a6aea18cd4330f832073a2000a68228b0237313e709b3e4adba570b140837256798ff3987b9eb0bb0fc9
7
- data.tar.gz: 80405a6c1d1f99a7b65ed9491bd17c0d4143a5d5f212c6408988c9de329bc2bee2f2c6c1421d6134cc7f3d4c23ed2da06d0ba76509f6ae191f0236e83c53bdf8
6
+ metadata.gz: 7d0c868e31eb523845681398cb7579022dc6635bf3cc2982ae55cd83f5b0eaf414988b9a7ba6f728d96c43518fd27895fd98a3e0960577c1f06e4bb333be3339
7
+ data.tar.gz: a9d232ad2858a142d01d52eaa854ca1daa9c7844353487ac2be6c97b9715e41c3c807d93fdd5662e44e5bf0443dffbeb67e0d1ad39d3563e4cf088e433b7be6c
data/.craft.yml ADDED
@@ -0,0 +1,15 @@
1
+ minVersion: '0.11.0'
2
+ github:
3
+ owner: getsentry
4
+ repo: raven-ruby
5
+ changelogPolicy: simple
6
+ preReleaseCommand: ruby .scripts/bump-version.sh
7
+ statusProvider:
8
+ name: github
9
+ targets:
10
+ - name: gem
11
+ - name: github
12
+ - name: registry
13
+ type: sdk
14
+ config:
15
+ canonical: 'gem:sentry-raven'
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: bug
6
+ assignees: st0012
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+
12
+ **To Reproduce**
13
+
14
+ **Expected behavior**
15
+
16
+ **Actual behavior**
17
+
18
+ **Environment**
19
+ - Ruby Version:
20
+ - SDK Version:
21
+ - Integration Versions (if any):
22
+ - e.g. Rails 6.0, Sidekiq 6.1.2
23
+
24
+ **Raven Config**
25
+
26
+ This is not necessary but could be helpful.
27
+
28
+ ```ruby
29
+ Raven.configure do |config|
30
+ # the config you're using, without DSN and other sensitive data
31
+ end
32
+ ```
@@ -0,0 +1,16 @@
1
+ Thanks for your Pull Request 🎉
2
+
3
+ **Please keep these instructions in mind so we can review it more efficiently:**
4
+
5
+ - Add the references of all the related issues/PRs in the description
6
+ - Whether it's a new feature or a bug fix, make sure they're covered by new test cases
7
+ - If this PR contains any refactoring work, please give it its own commit(s)
8
+
9
+
10
+ **Other Notes**
11
+ - We squash all commits before merging
12
+ - We generally review new PRs within a week
13
+ - If you have any question, you can ask for feedback in our [discord community](https://discord.gg/Ww9hbqr) first
14
+
15
+ ## Description
16
+ Describe your changes:
@@ -0,0 +1,92 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ jobs:
9
+ test:
10
+ name: Test on ruby ${{ matrix.ruby_version }} and rails ${{ matrix.rails_version }}
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ matrix:
14
+ rails_version: [0, 4.2, 5.2, 6.0]
15
+ ruby_version: [2.3, 2.4, 2.5, 2.6, 2.7, jruby, head]
16
+ os: [ubuntu-latest]
17
+ include:
18
+ - ruby_version: head
19
+ rails_version: 0
20
+ - ruby_version: 2.7
21
+ rails_version: 6.0
22
+ env: RUBYOPT="--enable-frozen-string-literal --debug=frozen-string-literal"
23
+ exclude:
24
+ - ruby_version: 2.3
25
+ rails_version: 6.0
26
+ - ruby_version: 2.4
27
+ rails_version: 6.0
28
+ - ruby_version: 2.7
29
+ rails_version: 4.2
30
+ - ruby_version: head
31
+ rails_version: 4.2
32
+ - ruby_version: head
33
+ rails_version: 5.2
34
+ - ruby_version: head
35
+ rails_version: 6.0
36
+
37
+ steps:
38
+ - uses: actions/checkout@v1
39
+
40
+ - name: Set up Ruby ${{ matrix.ruby_version }}
41
+ uses: ruby/setup-ruby@v1
42
+ with:
43
+ bundler: 1
44
+ ruby-version: ${{ matrix.ruby_version }}
45
+
46
+ - name: Start Redis
47
+ uses: supercharge/redis-github-action@1.1.0
48
+ with:
49
+ redis-version: 5
50
+
51
+ - name: Build with Rails ${{ matrix.rails_version }}
52
+ env:
53
+ RAILS_VERSION: ${{ matrix.rails_version }}
54
+ run: |
55
+ bundle install --jobs 4 --retry 3
56
+ bundle exec rake
57
+
58
+ compare_allocation:
59
+ name: Compare memory allocation with ${{ matrix.ruby_version }} and rails ${{ matrix.rails_version }}
60
+ runs-on: ${{ matrix.os }}
61
+ needs: test
62
+ env:
63
+ RAILS_VERSION: ${{ matrix.rails_version }}
64
+ strategy:
65
+ matrix:
66
+ rails_version: [5.2, 6.0]
67
+ ruby_version: [2.6, 2.7]
68
+ os: [ubuntu-latest]
69
+ steps:
70
+ - name: Set up Ruby ${{ matrix.ruby_version }}
71
+ uses: ruby/setup-ruby@v1
72
+ with:
73
+ bundler: 1
74
+ ruby-version: ${{ matrix.ruby_version }}
75
+
76
+ - uses: actions/checkout@v2
77
+ with:
78
+ ref: master
79
+
80
+ - name: Build and run allocation report on master
81
+ run: |
82
+ bundle install --jobs 4 --retry 3
83
+ bundle exec ruby benchmarks/allocation_comparison.rb
84
+
85
+ - uses: actions/checkout@v1
86
+
87
+ - name: Rebuild on the branch
88
+ run: |
89
+ bundle install --jobs 4 --retry 3
90
+ - name: Run allocation report on the branch
91
+ run: |
92
+ bundle exec ruby benchmarks/allocation_comparison.rb
@@ -0,0 +1,32 @@
1
+ name: Zeus Upload
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - release/**
7
+
8
+ jobs:
9
+ zeus_upload:
10
+ name: Zeus
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - uses: actions/setup-node@v1
15
+ - name: Set up Ruby
16
+ uses: ruby/setup-ruby@v1
17
+ with:
18
+ ruby-version: 2.6 # Not needed with a .ruby-version file
19
+ - run: bundle install
20
+ - name: Install Zeus
21
+ run: |
22
+ yarn global add @zeus-ci/cli
23
+ echo "::add-path::$(yarn global bin)"
24
+ - name: Upload to Zeus
25
+ env:
26
+ ZEUS_API_TOKEN: ${{ secrets.ZEUS_API_TOKEN }}
27
+ ZEUS_HOOK_BASE: ${{ secrets.ZEUS_HOOK_BASE }}
28
+ run: |
29
+ zeus job update -b $GITHUB_RUN_ID -j $GITHUB_RUN_NUMBER -r $GITHUB_SHA
30
+ gem build sentry-raven.gemspec
31
+ zeus upload -b $GITHUB_RUN_ID -j $GITHUB_RUN_NUMBER -t "application/tar+gem" ./*.gem
32
+ zeus job update --status=passed -b $GITHUB_RUN_ID -j $GITHUB_RUN_NUMBER -r $GITHUB_SHA
data/.gitignore CHANGED
@@ -1,5 +1,6 @@
1
1
  coverage
2
2
  pkg
3
+ tmp
3
4
  ruby/
4
5
  log/
5
6
  .bundle
@@ -11,3 +12,5 @@ Gemfile.lock
11
12
  .ruby-gemset
12
13
  .idea
13
14
  *.rdb
15
+
16
+ examples/**/node_modules
data/.rubocop.yml CHANGED
@@ -7,42 +7,57 @@ AllCops:
7
7
  - 'vendor/**/*'
8
8
 
9
9
  Metrics/ClassLength:
10
- Max: 300
10
+ Max: 350
11
11
  CountComments: false
12
12
 
13
13
  Metrics/AbcSize:
14
14
  Max: 40
15
15
 
16
+ Metrics/BlockLength:
17
+ Enabled: false
18
+
16
19
  Metrics/CyclomaticComplexity:
17
20
  Max: 12
18
21
 
19
22
  Metrics/PerceivedComplexity:
20
23
  Max: 11
21
24
 
22
- Metrics/LineLength:
23
- Max: 155
24
-
25
25
  Metrics/MethodLength:
26
- Max: 30
26
+ Max: 40
27
27
 
28
- Style/SignalException:
28
+ Style/SymbolArray:
29
+ Enabled: false
30
+
31
+ Style/PercentLiteralDelimiters:
32
+ Enabled: false
33
+
34
+ Style/FrozenStringLiteralComment:
29
35
  Enabled: false
30
36
 
31
- Performance/Casecmp:
37
+ Style/SignalException:
32
38
  Enabled: false
33
39
 
34
40
  Style/ClassAndModuleChildren:
35
41
  Enabled: false
36
42
 
43
+ Style/RescueStandardError:
44
+ Enabled: false
45
+
37
46
  Style/ParallelAssignment:
38
47
  Enabled: false
39
48
 
40
49
  Style/Documentation:
41
50
  Enabled: false
42
51
 
52
+ Style/CommentedKeyword:
53
+ Enabled: false
54
+
43
55
  Style/RescueModifier:
44
56
  Enabled: false
45
57
 
58
+ Style/RegexpLiteral:
59
+ Enabled: false
60
+
46
61
  Style/StringLiterals:
47
62
  Enabled: false
48
63
 
@@ -52,17 +67,21 @@ Style/CaseEquality:
52
67
  Style/DoubleNegation:
53
68
  Enabled: false
54
69
 
55
- Style/FileName:
56
- Exclude:
57
- - 'lib/sentry-raven-without-integrations.rb'
58
- - 'lib/sentry-raven.rb'
70
+ Style/GuardClause:
71
+ Enabled: false
72
+
73
+ Style/RedundantBegin:
74
+ Enabled: false
59
75
 
60
76
  Style/NumericLiterals:
61
77
  Exclude:
62
78
  - 'spec/raven/processors/sanitizedata_processor_spec.rb'
63
79
 
64
80
  Style/HashSyntax:
65
- EnforcedStyle: hash_rockets
81
+ Enabled: false
82
+
83
+ Style/IfUnlessModifier:
84
+ Enabled: false
66
85
 
67
86
  Lint/RescueException:
68
87
  Exclude:
@@ -72,3 +91,22 @@ Lint/RescueException:
72
91
  - 'lib/raven/integrations/rack.rb'
73
92
  - 'lib/raven/integrations/sidekiq.rb'
74
93
  - 'spec/raven/event_spec.rb'
94
+
95
+ Lint/SuppressedException:
96
+ Enabled: false
97
+
98
+ Lint/AssignmentInCondition:
99
+ Enabled: false
100
+
101
+ Layout/LineLength:
102
+ Max: 155
103
+
104
+ Naming/FileName:
105
+ Exclude:
106
+ - 'lib/sentry-raven-without-integrations.rb'
107
+ - 'lib/sentry-raven.rb'
108
+ - 'lib/raven/integrations/rack-timeout.rb'
109
+
110
+ Naming/MethodParameterName:
111
+ Enabled: false
112
+
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ file_names = ['lib/raven/version.rb']
4
+
5
+ file_names.each do |file_name|
6
+ text = File.read(file_name)
7
+ new_contents = text.gsub(/\d.\d.\d/, ARGV[1])
8
+ File.open(file_name, "w") {|file| file.puts new_contents }
9
+ end
@@ -1,3 +1,157 @@
1
+ # Changelog
2
+
3
+ ## 3.1.0
4
+
5
+ **Feature**
6
+
7
+ - Exclude all 4xx Rails errors ([#1004](https://github.com/getsentry/raven-ruby/pull/1004))
8
+
9
+ See the full list [here](https://github.com/getsentry/raven-ruby/blob/master/lib/raven/configuration.rb#L198-L219)
10
+
11
+ - Add some error context in `transport_failure_callback` ([#1003](https://github.com/getsentry/raven-ruby/pull/1003))
12
+
13
+ Before:
14
+
15
+ ```ruby
16
+ config.transport_failure_callback = lambda { |event|
17
+ AdminMailer.email_admins("Oh god, it's on fire!", event).deliver_later
18
+ }
19
+ ```
20
+
21
+ After:
22
+
23
+ ```ruby
24
+ config.transport_failure_callback = lambda { |event, error|
25
+ AdminMailer.email_admins("Oh god, it's on fire because #{error.message}!", event).deliver_later
26
+ }
27
+ ```
28
+
29
+ - Support cleaning up exception backtrace with customized backtrace_cleaner ([#1011](https://github.com/getsentry/raven-ruby/pull/1011))
30
+
31
+ The new config `backtrace_cleanup_callback` takes a lambda/proc object (default is `nil`) and will be called with exception's backtrace
32
+
33
+ ```ruby
34
+ Raven.configure do |config|
35
+ config.backtrace_cleanup_callback = lambda do |backtrace|
36
+ Rails.backtrace_cleaner.clean(backtrace)
37
+ end
38
+ end
39
+ ```
40
+
41
+ And with the Rails integration, it'll automatically use a customized `Raven::Rails::BacktraceCleaner` to clean up exception's backtrace. It's basically Rails 6's [backtrace cleaner](https://github.com/rails/rails/blob/master/railties/lib/rails/backtrace_cleaner.rb) but without silencers.
42
+
43
+ The main reason to add this cleaner is to remove template methods from the trace, e.g.
44
+
45
+ ```
46
+ app/views/welcome/view_error.html.erb in _app_views_welcome_view_error_html_erb__2807287320172182514_65600 at line 1
47
+ ```
48
+
49
+ will become
50
+
51
+ ```
52
+ app/views/welcome/view_error.html.erb at line 1
53
+ ```
54
+
55
+ This can help Sentry group issues more accurately. See [#957](https://github.com/getsentry/raven-ruby/issues/957) for more information about this.
56
+
57
+ If you don't want this change, you can disable it with:
58
+
59
+ ```ruby
60
+ Raven.configure do |config|
61
+ config.backtrace_cleanup_callback = nil
62
+ end
63
+ ```
64
+
65
+
66
+ - Make dsn value accessable from config ([#1012](https://github.com/getsentry/raven-ruby/pull/1012))
67
+
68
+ You can now access the dsn value via `Raven.configuration.dsn`
69
+
70
+ **Deprecation**
71
+
72
+ - Deprecate dasherized filenames ([#1006](https://github.com/getsentry/raven-ruby/pull/1006))
73
+
74
+ If you're using
75
+
76
+ ```ruby
77
+ gem 'sentry-raven', require: 'sentry-raven-without-integrations'
78
+ # or
79
+ require "sentry-raven-without-integrations"
80
+ ```
81
+
82
+ you will start seeing deprecation warnings. Please change them into
83
+
84
+ ```ruby
85
+ gem 'sentry-raven', require: 'sentry_raven_without_integrations'
86
+ # or
87
+ require "sentry_raven_without_integrations"
88
+ ```
89
+
90
+ - Unify breadcrumb loggers activation ([#1016](https://github.com/getsentry/raven-ruby/pull/1016))
91
+
92
+ Currently, we activate our breadcrumb loggers differently:
93
+
94
+ ```ruby
95
+ require "raven/breadcrumbs/sentry_logger"
96
+ Raven.configuration.rails_activesupport_breadcrumbs = true
97
+ ```
98
+
99
+ It's not a nice user interface, so this PR adds a new configuration
100
+ option `breadcrumbs_logger` to improve this:
101
+
102
+ ```ruby
103
+ Raven.configuration.breadcrumbs_logger = :sentry_logger
104
+ Raven.configuration.breadcrumbs_logger = :active_support_logger
105
+ Raven.configuration.breadcrumbs_logger = [:sentry_logger, :active_support_logger]
106
+ ```
107
+
108
+ Please migrate to the new activation apporach, otherwise you'll see depraction warnings. And old ones will be dropped in version 4.0.
109
+
110
+ **Refactor**
111
+
112
+ - Accept non-string message in Event.from_exception ([#1005](https://github.com/getsentry/raven-ruby/pull/1005))
113
+ - Refactor event initialization ([#1010](https://github.com/getsentry/raven-ruby/pull/1010))
114
+ - Refactor sidekiq integration ([#1019](https://github.com/getsentry/raven-ruby/pull/1019))
115
+
116
+ **Fix**
117
+
118
+ - Replace sys_command usages in context.rb ([#1017](https://github.com/getsentry/raven-ruby/pull/1017))
119
+ - Fix merge error from rack-timeout raven_context on old releases ([#1007](https://github.com/getsentry/raven-ruby/pull/1007))
120
+ - Return value of `rescue_with_handler` when intercepting ActiveJob exceptions ([#1027](https://github.com/getsentry/raven-ruby/pull/1027))
121
+
122
+ ## 3.0.4
123
+
124
+ - fix: Don't log warning messages when it doesn't need to (#1000)
125
+ - fix: Revert "Refactor Raven::Client class" (#1002)
126
+
127
+ ## 3.0.3
128
+
129
+ - fix: Ensure Processor::Cookie can run after Processor::RemoveCircularReferences (#996)
130
+ - fix: Avoid mutating user passed in options (#994)
131
+ - fix: Fix/Refactor Raven::Cli (#989)
132
+ - ref: Refactor Raven::Client class (#995)
133
+ - It adds `Event#message_from_exception` and `Event#log_message` interfaces
134
+
135
+ ## 3.0.2
136
+
137
+ - fix: Add gem target for craft
138
+
139
+ ## 3.0.1
140
+
141
+ - fix: Improve SanitizeData processor (#984)
142
+ - fix: Masking cookies as key/pair instead of a single string (#983)
143
+ - fix: Transports classes' requiring issue (#986)
144
+ - fix: Frozen string issues (#977)
145
+ - feat: Officially support Rails 6 (#982)
146
+
147
+ 3.0.0
148
+ ----
149
+
150
+ * SDK now requires Ruby >= 2.3
151
+ * REF: Retain any literal "HTTP-" in header names [@elliterate, #950]
152
+ * REF: Delete JSON spec for recursive hashes [@ksylvest, #952]
153
+ * FEAT: Bump faraday version to latest [@ksylvest, #946]
154
+
1
155
  2.13.0
2
156
  ----
3
157
 
@@ -475,7 +629,7 @@ OTHER CHANGES:
475
629
  0.12.0
476
630
  ------
477
631
 
478
- - You can now give additional fields to the SanitizeData processor. Values matched are replaced by the string mask (*********). Full documentation (and how to use with Rails config.filter_parameters) [here](https://docs.getsentry.com/hosted/clients/ruby/config/). [jamescway, #232]
632
+ - You can now give additional fields to the SanitizeData processor. Values matched are replaced by the string mask (*********). Full documentation (and how to use with Rails config.filter_parameters) [here](https://docs.sentry.io/platforms/ruby/config/). [jamescway, #232]
479
633
  - An additional processor has been added, though it isn't turned on by default: RemoveStacktrace. Use it to remove stacktraces from exception reports. [nateberkopec, #233]
480
634
  - Dependency on `uuidtools` has been removed. [nateberkopec, #231]
481
635
 
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,71 @@
1
+ <p align="center">
2
+ <a href="https://sentry.io" target="_blank" align="center">
3
+ <img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" width="280">
4
+ </a>
5
+ <br />
6
+ </p>
7
+
8
+ # Contributing
9
+
10
+ You can contribute this project in the following ways:
11
+
12
+ - File a [bug report] or propose a feature
13
+ - Open a PR for bug fixes or implementing requested features
14
+ - Give feedback to opened issues/pull requests
15
+ - Test the latest version - `gem 'sentry-raven', github: 'getsentry/raven-ruby'`
16
+ - Contribute documentation in the [document repo]
17
+
18
+
19
+ And if you have any questions, please feel free to reach out on [Discord].
20
+
21
+
22
+ [bug report]: https://github.com/getsentry/raven-ruby/issues/new?template=bug_report.md
23
+ [document repo]: https://github.com/getsentry/sentry-docs
24
+ [Discord]: https://discord.gg/Ww9hbqr
25
+
26
+ ## How To Contribute
27
+
28
+ ### Running Tests
29
+
30
+ #### RAILS_VERSION
31
+
32
+ Because this SDK supports multiple versions of Rails, or even without Rails, you might want to run your test against different versions of Rails.
33
+
34
+ You can do this by changing the `RAILS_VERSION` environment variable:
35
+
36
+
37
+ ```
38
+ $ echo RAILS_VERSION=6.0
39
+ $ bundle update # this is necessary if you're switching between Rails versions
40
+ $ bundle exec rake
41
+ ```
42
+
43
+ If not specified, it runs tests against `Rails 5.2`.
44
+
45
+ And if you don't want to run the Rails related test cases, you can use `RAILS_VERSION=0`
46
+
47
+ ```
48
+ $ RAILS_VERSION=0 bundle exec rake # runs without Rails related test cases
49
+ ```
50
+
51
+ ### Testing Your Change Against Example Rails Apps
52
+
53
+ We have a few example apps for different Rails versions under the `/examples` folder. You can use them to perform an end-to-end testing on your changes (just remember to change the DSN to your project's).
54
+
55
+ At this moment, we recommend testing against the [Rails 6 example](https://github.com/getsentry/raven-ruby/tree/master/examples/rails-6.0) first. Please read its readme to see what kind of testing you can perform with it.
56
+
57
+
58
+ ## Making a release
59
+
60
+ Install and use `craft`: https://github.com/getsentry/craft
61
+
62
+ Make sure the `CHANGELOG.md` is update and latest `master` contains all changes.
63
+
64
+ Run:
65
+
66
+ ```bash
67
+ craft prepare x.x.x
68
+ ```
69
+
70
+ Where `x.x.x` stands for the version you want to release.
71
+ Afterwards reach out to an employee of Sentry, they will cut a release by running the `publish` process of `craft`.
data/Gemfile CHANGED
@@ -2,37 +2,32 @@ source "https://rubygems.org/"
2
2
 
3
3
  gemspec
4
4
 
5
- if ENV["RAILS_VERSION"] && (ENV["RAILS_VERSION"].to_i == 4)
6
- gem "rails", "< 5"
7
- gem "rspec-rails", "> 3"
8
- elsif ENV["RAILS_VERSION"] && (ENV["RAILS_VERSION"].to_i == 0)
9
- # no-op. No Rails.
10
- else
11
- gem "rails", "< 6"
12
- gem "rspec-rails", "> 3"
13
- end
5
+ rails_version = ENV["RAILS_VERSION"]
6
+ rails_version = "5.2" if rails_version.nil?
14
7
 
15
- if RUBY_VERSION < '2.0'
16
- gem "mime-types", "< 3.0.0"
17
- gem "nokogiri", "~> 1.6.8"
18
- gem "rack", "~> 1.6.8"
19
- gem "sidekiq", "< 3.2"
20
- gem "rack-timeout", "0.3.0"
21
- else
22
- gem "rack"
23
- gem "sidekiq"
24
- gem "rack-timeout"
8
+ if rails_version.to_f != 0
9
+ gem "rails", "~> #{rails_version}"
10
+ gem "rspec-rails", "~> 4.0"
25
11
  end
12
+
13
+ gem "sidekiq"
14
+
15
+ gem "rack"
16
+ gem "rack-timeout"
17
+
26
18
  gem "pry"
27
- gem "pry-coolline"
28
19
  gem "benchmark-ips"
29
- gem "benchmark-ipsa" if RUBY_VERSION > '2.0'
20
+ gem "benchmark_driver"
21
+ gem "benchmark-ipsa"
22
+ gem "benchmark-memory"
30
23
  gem "ruby-prof", platform: :mri
31
24
  gem "rake", "> 12"
32
- gem "rubocop", "~> 0.41.1" # Last version that supported 1.9, upgrade to 0.50 after we drop 1.9
33
- gem "rspec", "> 3"
34
- gem "capybara" # rspec system tests
25
+ gem "rubocop", "~> 0.81.0"
26
+ gem "rspec", "~> 3.9.0"
27
+ gem "capybara", "~> 3.15.0" # rspec system tests
35
28
  gem "puma" # rspec system tests
36
29
 
37
30
  gem "timecop"
38
- gem "test-unit", platform: :mri if RUBY_VERSION > '2.2'
31
+ gem "test-unit"
32
+ gem "simplecov"
33
+ gem "codecov"