ddtrace 0.45.0 → 0.47.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 (302) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +131 -12
  3. data/.circleci/images/primary/{Dockerfile-jruby-9.2 → Dockerfile-jruby-9.2-latest} +2 -1
  4. data/.circleci/images/primary/Dockerfile-jruby-9.2.0.0 +73 -0
  5. data/.circleci/images/primary/Dockerfile-truffleruby-21.0.0 +73 -0
  6. data/.github/workflows/create-next-milestone.yml +2 -2
  7. data/.rubocop.yml +250 -7
  8. data/.rubocop_todo.yml +397 -0
  9. data/.simplecov +6 -0
  10. data/Appraisals +16 -1
  11. data/CHANGELOG.md +150 -1
  12. data/Gemfile +53 -3
  13. data/LICENSE-3rdparty.csv +2 -0
  14. data/Rakefile +5 -23
  15. data/ddtrace.gemspec +6 -36
  16. data/docker-compose.yml +75 -7
  17. data/docs/DevelopmentGuide.md +28 -0
  18. data/docs/GettingStarted.md +69 -17
  19. data/integration/README.md +68 -0
  20. data/integration/apps/rack/.dockerignore +1 -0
  21. data/integration/apps/rack/.envrc.sample +1 -0
  22. data/integration/apps/rack/.gitignore +4 -0
  23. data/integration/apps/rack/.rspec +1 -0
  24. data/integration/apps/rack/Dockerfile +25 -0
  25. data/integration/apps/rack/Dockerfile-ci +11 -0
  26. data/integration/apps/rack/Gemfile +24 -0
  27. data/integration/apps/rack/README.md +93 -0
  28. data/integration/apps/rack/app/acme.rb +80 -0
  29. data/integration/apps/rack/app/datadog.rb +17 -0
  30. data/integration/apps/rack/bin/run +22 -0
  31. data/integration/apps/rack/bin/setup +17 -0
  32. data/integration/apps/rack/bin/test +24 -0
  33. data/integration/apps/rack/config.ru +6 -0
  34. data/integration/apps/rack/config/puma.rb +14 -0
  35. data/integration/apps/rack/config/unicorn.rb +23 -0
  36. data/integration/apps/rack/docker-compose.ci.yml +62 -0
  37. data/integration/apps/rack/docker-compose.yml +78 -0
  38. data/integration/apps/rack/script/build-images +38 -0
  39. data/integration/apps/rack/script/ci +50 -0
  40. data/integration/apps/rack/spec/integration/basic_spec.rb +10 -0
  41. data/integration/apps/rack/spec/spec_helper.rb +16 -0
  42. data/integration/apps/rack/spec/support/integration_helper.rb +22 -0
  43. data/integration/apps/rails-five/.dockerignore +1 -0
  44. data/integration/apps/rails-five/.env +3 -0
  45. data/integration/apps/rails-five/.envrc.sample +1 -0
  46. data/integration/apps/rails-five/.gitignore +30 -0
  47. data/integration/apps/rails-five/Dockerfile +25 -0
  48. data/integration/apps/rails-five/Dockerfile-ci +11 -0
  49. data/integration/apps/rails-five/Gemfile +104 -0
  50. data/integration/apps/rails-five/README.md +94 -0
  51. data/integration/apps/rails-five/Rakefile +6 -0
  52. data/integration/apps/rails-five/app/channels/application_cable/channel.rb +4 -0
  53. data/integration/apps/rails-five/app/channels/application_cable/connection.rb +4 -0
  54. data/integration/apps/rails-five/app/controllers/application_controller.rb +2 -0
  55. data/integration/apps/rails-five/app/controllers/basic_controller.rb +36 -0
  56. data/integration/apps/rails-five/app/controllers/concerns/.keep +0 -0
  57. data/integration/apps/rails-five/app/controllers/health_controller.rb +9 -0
  58. data/integration/apps/rails-five/app/controllers/jobs_controller.rb +12 -0
  59. data/integration/apps/rails-five/app/jobs/application_job.rb +2 -0
  60. data/integration/apps/rails-five/app/jobs/test_job.rb +12 -0
  61. data/integration/apps/rails-five/app/mailers/application_mailer.rb +4 -0
  62. data/integration/apps/rails-five/app/models/application_record.rb +3 -0
  63. data/integration/apps/rails-five/app/models/concerns/.keep +0 -0
  64. data/integration/apps/rails-five/app/models/test.rb +2 -0
  65. data/integration/apps/rails-five/app/views/layouts/mailer.html.erb +13 -0
  66. data/integration/apps/rails-five/app/views/layouts/mailer.text.erb +1 -0
  67. data/integration/apps/rails-five/bin/bundle +3 -0
  68. data/integration/apps/rails-five/bin/rails +9 -0
  69. data/integration/apps/rails-five/bin/rake +9 -0
  70. data/integration/apps/rails-five/bin/run +24 -0
  71. data/integration/apps/rails-five/bin/setup +27 -0
  72. data/integration/apps/rails-five/bin/spring +17 -0
  73. data/integration/apps/rails-five/bin/test +21 -0
  74. data/integration/apps/rails-five/bin/update +28 -0
  75. data/integration/apps/rails-five/config.ru +5 -0
  76. data/integration/apps/rails-five/config/application.rb +97 -0
  77. data/integration/apps/rails-five/config/boot.rb +4 -0
  78. data/integration/apps/rails-five/config/cable.yml +10 -0
  79. data/integration/apps/rails-five/config/credentials.yml.enc +1 -0
  80. data/integration/apps/rails-five/config/database.yml +28 -0
  81. data/integration/apps/rails-five/config/environment.rb +5 -0
  82. data/integration/apps/rails-five/config/environments/development.rb +51 -0
  83. data/integration/apps/rails-five/config/environments/production.rb +82 -0
  84. data/integration/apps/rails-five/config/environments/test.rb +43 -0
  85. data/integration/apps/rails-five/config/initializers/datadog.rb +18 -0
  86. data/integration/apps/rails-five/config/initializers/filter_parameter_logging.rb +4 -0
  87. data/integration/apps/rails-five/config/initializers/resque.rb +4 -0
  88. data/integration/apps/rails-five/config/initializers/rollbar.rb +5 -0
  89. data/integration/apps/rails-five/config/initializers/wrap_parameters.rb +14 -0
  90. data/integration/apps/rails-five/config/locales/en.yml +33 -0
  91. data/integration/apps/rails-five/config/puma.rb +24 -0
  92. data/integration/apps/rails-five/config/routes.rb +11 -0
  93. data/integration/apps/rails-five/config/spring.rb +6 -0
  94. data/integration/apps/rails-five/config/unicorn.rb +29 -0
  95. data/integration/apps/rails-five/db/migrate/20190927215052_create_tests.rb +11 -0
  96. data/integration/apps/rails-five/db/schema.rb +23 -0
  97. data/integration/apps/rails-five/db/seeds.rb +7 -0
  98. data/integration/apps/rails-five/docker-compose.ci.yml +98 -0
  99. data/integration/apps/rails-five/docker-compose.yml +100 -0
  100. data/integration/apps/rails-five/lib/tasks/.keep +0 -0
  101. data/integration/apps/rails-five/log/.keep +0 -0
  102. data/integration/apps/rails-five/public/robots.txt +1 -0
  103. data/integration/apps/rails-five/script/build-images +35 -0
  104. data/integration/apps/rails-five/script/ci +50 -0
  105. data/integration/apps/rails-five/spec/integration/basic_spec.rb +10 -0
  106. data/integration/apps/rails-five/spec/spec_helper.rb +16 -0
  107. data/integration/apps/rails-five/spec/support/integration_helper.rb +22 -0
  108. data/integration/apps/rails-five/storage/.keep +0 -0
  109. data/integration/apps/rails-five/tmp/.keep +0 -0
  110. data/integration/apps/rails-five/vendor/.keep +0 -0
  111. data/integration/apps/ruby/.dockerignore +1 -0
  112. data/integration/apps/ruby/.envrc.sample +1 -0
  113. data/integration/apps/ruby/.gitignore +2 -0
  114. data/integration/apps/ruby/Dockerfile +25 -0
  115. data/integration/apps/ruby/Dockerfile-ci +11 -0
  116. data/integration/apps/ruby/Gemfile +11 -0
  117. data/integration/apps/ruby/README.md +70 -0
  118. data/integration/apps/ruby/agent.yaml +3 -0
  119. data/integration/apps/ruby/app/datadog.rb +13 -0
  120. data/integration/apps/ruby/app/fibonacci.rb +58 -0
  121. data/integration/apps/ruby/bin/run +20 -0
  122. data/integration/apps/ruby/bin/setup +17 -0
  123. data/integration/apps/ruby/bin/test +21 -0
  124. data/integration/apps/ruby/docker-compose.ci.yml +51 -0
  125. data/integration/apps/ruby/docker-compose.yml +63 -0
  126. data/integration/apps/ruby/script/build-images +38 -0
  127. data/integration/apps/ruby/script/ci +50 -0
  128. data/integration/images/agent/Dockerfile +2 -0
  129. data/integration/images/agent/agent.yaml +3 -0
  130. data/integration/images/include/datadog/analyzer.rb +71 -0
  131. data/integration/images/include/datadog/demo_env.rb +101 -0
  132. data/integration/images/include/http-health-check +33 -0
  133. data/integration/images/ruby/2.0/Dockerfile +54 -0
  134. data/integration/images/ruby/2.1/Dockerfile +54 -0
  135. data/integration/images/ruby/2.2/Dockerfile +54 -0
  136. data/integration/images/ruby/2.3/Dockerfile +70 -0
  137. data/integration/images/ruby/2.4/Dockerfile +54 -0
  138. data/integration/images/ruby/2.5/Dockerfile +54 -0
  139. data/integration/images/ruby/2.6/Dockerfile +54 -0
  140. data/integration/images/ruby/2.7/Dockerfile +54 -0
  141. data/integration/images/ruby/3.0/Dockerfile +54 -0
  142. data/integration/images/wrk/Dockerfile +33 -0
  143. data/integration/images/wrk/scripts/entrypoint.sh +17 -0
  144. data/integration/images/wrk/scripts/scenarios/basic/default.lua +1 -0
  145. data/integration/images/wrk/scripts/scenarios/basic/fibonacci.lua +1 -0
  146. data/integration/script/build-images +43 -0
  147. data/lib/ddtrace.rb +0 -5
  148. data/lib/ddtrace/analytics.rb +2 -0
  149. data/lib/ddtrace/buffer.rb +4 -4
  150. data/lib/ddtrace/configuration.rb +92 -23
  151. data/lib/ddtrace/configuration/base.rb +1 -1
  152. data/lib/ddtrace/configuration/components.rb +2 -2
  153. data/lib/ddtrace/configuration/option_definition.rb +1 -3
  154. data/lib/ddtrace/configuration/options.rb +4 -7
  155. data/lib/ddtrace/configuration/settings.rb +17 -3
  156. data/lib/ddtrace/context.rb +5 -6
  157. data/lib/ddtrace/context_provider.rb +0 -1
  158. data/lib/ddtrace/contrib/action_cable/event.rb +1 -0
  159. data/lib/ddtrace/contrib/action_pack/action_controller/instrumentation.rb +1 -3
  160. data/lib/ddtrace/contrib/action_view/event.rb +1 -1
  161. data/lib/ddtrace/contrib/action_view/utils.rb +1 -1
  162. data/lib/ddtrace/contrib/active_record/configuration/resolver.rb +101 -18
  163. data/lib/ddtrace/contrib/active_record/utils.rb +1 -0
  164. data/lib/ddtrace/contrib/active_support/notifications/event.rb +2 -1
  165. data/lib/ddtrace/contrib/active_support/notifications/subscriber.rb +1 -0
  166. data/lib/ddtrace/contrib/active_support/notifications/subscription.rb +9 -5
  167. data/lib/ddtrace/contrib/auto_instrument.rb +1 -0
  168. data/lib/ddtrace/contrib/aws/patcher.rb +1 -0
  169. data/lib/ddtrace/contrib/aws/services.rb +2 -0
  170. data/lib/ddtrace/contrib/configurable.rb +63 -39
  171. data/lib/ddtrace/contrib/configuration/resolver.rb +70 -5
  172. data/lib/ddtrace/contrib/configuration/resolvers/pattern_resolver.rb +19 -20
  173. data/lib/ddtrace/contrib/configuration/settings.rb +7 -6
  174. data/lib/ddtrace/contrib/cucumber/configuration/settings.rb +0 -10
  175. data/lib/ddtrace/contrib/cucumber/ext.rb +0 -2
  176. data/lib/ddtrace/contrib/cucumber/formatter.rb +5 -11
  177. data/lib/ddtrace/contrib/dalli/patcher.rb +0 -38
  178. data/lib/ddtrace/contrib/delayed_job/plugin.rb +0 -1
  179. data/lib/ddtrace/contrib/elasticsearch/patcher.rb +1 -0
  180. data/lib/ddtrace/contrib/elasticsearch/quantize.rb +3 -2
  181. data/lib/ddtrace/contrib/ethon/easy_patch.rb +5 -5
  182. data/lib/ddtrace/contrib/excon/middleware.rb +2 -6
  183. data/lib/ddtrace/contrib/extensions.rb +27 -3
  184. data/lib/ddtrace/contrib/faraday/middleware.rb +1 -3
  185. data/lib/ddtrace/contrib/faraday/patcher.rb +0 -36
  186. data/lib/ddtrace/contrib/grape/endpoint.rb +8 -15
  187. data/lib/ddtrace/contrib/grape/patcher.rb +0 -42
  188. data/lib/ddtrace/contrib/grpc/datadog_interceptor.rb +8 -8
  189. data/lib/ddtrace/contrib/grpc/datadog_interceptor/server.rb +1 -0
  190. data/lib/ddtrace/contrib/grpc/patcher.rb +0 -36
  191. data/lib/ddtrace/contrib/http/circuit_breaker.rb +1 -3
  192. data/lib/ddtrace/contrib/http/instrumentation.rb +5 -5
  193. data/lib/ddtrace/contrib/httpclient/instrumentation.rb +14 -19
  194. data/lib/ddtrace/contrib/httpclient/patcher.rb +5 -2
  195. data/lib/ddtrace/contrib/httprb/instrumentation.rb +14 -20
  196. data/lib/ddtrace/contrib/httprb/patcher.rb +5 -2
  197. data/lib/ddtrace/contrib/mongodb/instrumentation.rb +2 -0
  198. data/lib/ddtrace/contrib/mongodb/subscribers.rb +2 -3
  199. data/lib/ddtrace/contrib/patcher.rb +9 -6
  200. data/lib/ddtrace/contrib/presto/patcher.rb +5 -2
  201. data/lib/ddtrace/contrib/qless/qless_job.rb +1 -0
  202. data/lib/ddtrace/contrib/qless/tracer_cleaner.rb +1 -0
  203. data/lib/ddtrace/contrib/que/ext.rb +19 -19
  204. data/lib/ddtrace/contrib/que/tracer.rb +1 -1
  205. data/lib/ddtrace/contrib/racecar/event.rb +1 -0
  206. data/lib/ddtrace/contrib/rack/configuration/settings.rb +3 -3
  207. data/lib/ddtrace/contrib/rack/middlewares.rb +5 -10
  208. data/lib/ddtrace/contrib/rack/patcher.rb +1 -3
  209. data/lib/ddtrace/contrib/rails/patcher.rb +6 -2
  210. data/lib/ddtrace/contrib/rake/instrumentation.rb +4 -2
  211. data/lib/ddtrace/contrib/redis/configuration/resolver.rb +11 -4
  212. data/lib/ddtrace/contrib/redis/quantize.rb +1 -0
  213. data/lib/ddtrace/contrib/redis/vendor/LICENSE +20 -0
  214. data/lib/ddtrace/contrib/redis/vendor/resolver.rb +6 -7
  215. data/lib/ddtrace/contrib/registry.rb +2 -2
  216. data/lib/ddtrace/contrib/resque/integration.rb +1 -1
  217. data/lib/ddtrace/contrib/resque/resque_job.rb +2 -0
  218. data/lib/ddtrace/contrib/rest_client/request_patch.rb +1 -3
  219. data/lib/ddtrace/contrib/rspec/configuration/settings.rb +0 -10
  220. data/lib/ddtrace/contrib/rspec/example.rb +24 -10
  221. data/lib/ddtrace/contrib/rspec/ext.rb +0 -3
  222. data/lib/ddtrace/contrib/rspec/integration.rb +1 -1
  223. data/lib/ddtrace/contrib/rspec/patcher.rb +0 -2
  224. data/lib/ddtrace/contrib/sequel/utils.rb +5 -6
  225. data/lib/ddtrace/contrib/shoryuken/tracer.rb +0 -1
  226. data/lib/ddtrace/contrib/sidekiq/server_tracer.rb +2 -7
  227. data/lib/ddtrace/contrib/sidekiq/tracing.rb +0 -1
  228. data/lib/ddtrace/contrib/sinatra/env.rb +1 -3
  229. data/lib/ddtrace/contrib/sinatra/headers.rb +1 -3
  230. data/lib/ddtrace/contrib/sinatra/tracer.rb +1 -3
  231. data/lib/ddtrace/contrib/sinatra/tracer_middleware.rb +3 -3
  232. data/lib/ddtrace/contrib/sneakers/ext.rb +11 -11
  233. data/lib/ddtrace/contrib/sneakers/tracer.rb +2 -4
  234. data/lib/ddtrace/contrib/status_code_matcher.rb +5 -3
  235. data/lib/ddtrace/correlation.rb +1 -0
  236. data/lib/ddtrace/diagnostics/environment_logger.rb +2 -1
  237. data/lib/ddtrace/distributed_tracing/headers/headers.rb +1 -0
  238. data/lib/ddtrace/distributed_tracing/headers/helpers.rb +1 -3
  239. data/lib/ddtrace/ext/ci.rb +2 -2
  240. data/lib/ddtrace/ext/distributed.rb +1 -1
  241. data/lib/ddtrace/ext/http.rb +1 -1
  242. data/lib/ddtrace/ext/runtime.rb +3 -1
  243. data/lib/ddtrace/forced_tracing.rb +2 -0
  244. data/lib/ddtrace/logger.rb +1 -1
  245. data/lib/ddtrace/metrics.rb +10 -6
  246. data/lib/ddtrace/opentracer/distributed_headers.rb +3 -0
  247. data/lib/ddtrace/opentracer/span.rb +2 -6
  248. data/lib/ddtrace/opentracer/thread_local_scope.rb +1 -0
  249. data/lib/ddtrace/patcher.rb +25 -4
  250. data/lib/ddtrace/pin.rb +8 -61
  251. data/lib/ddtrace/pipeline/span_filter.rb +1 -1
  252. data/lib/ddtrace/propagation/grpc_propagator.rb +1 -0
  253. data/lib/ddtrace/quantization/http.rb +1 -0
  254. data/lib/ddtrace/runtime/cgroup.rb +2 -2
  255. data/lib/ddtrace/runtime/container.rb +27 -29
  256. data/lib/ddtrace/runtime/identity.rb +8 -0
  257. data/lib/ddtrace/sampler.rb +1 -1
  258. data/lib/ddtrace/sampling/rule_sampler.rb +1 -0
  259. data/lib/ddtrace/span.rb +7 -7
  260. data/lib/ddtrace/sync_writer.rb +12 -12
  261. data/lib/ddtrace/tracer.rb +7 -5
  262. data/lib/ddtrace/transport/http.rb +15 -8
  263. data/lib/ddtrace/transport/http/adapters/net.rb +27 -8
  264. data/lib/ddtrace/transport/http/adapters/registry.rb +1 -0
  265. data/lib/ddtrace/transport/http/adapters/unix_socket.rb +2 -4
  266. data/lib/ddtrace/transport/http/builder.rb +7 -1
  267. data/lib/ddtrace/transport/http/env.rb +8 -0
  268. data/lib/ddtrace/transport/http/traces.rb +2 -3
  269. data/lib/ddtrace/transport/io.rb +1 -1
  270. data/lib/ddtrace/transport/io/response.rb +1 -3
  271. data/lib/ddtrace/transport/io/traces.rb +6 -0
  272. data/lib/ddtrace/transport/traces.rb +18 -1
  273. data/lib/ddtrace/utils/compression.rb +27 -0
  274. data/lib/ddtrace/utils/object_set.rb +41 -0
  275. data/lib/ddtrace/utils/only_once.rb +40 -0
  276. data/lib/ddtrace/utils/sequence.rb +17 -0
  277. data/lib/ddtrace/utils/string_table.rb +45 -0
  278. data/lib/ddtrace/utils/time.rb +32 -1
  279. data/lib/ddtrace/vendor/active_record/MIT-LICENSE +20 -0
  280. data/lib/ddtrace/vendor/multipart-post/LICENSE +11 -0
  281. data/lib/ddtrace/vendor/multipart-post/multipart.rb +12 -0
  282. data/lib/ddtrace/vendor/multipart-post/multipart/post.rb +8 -0
  283. data/lib/ddtrace/vendor/multipart-post/multipart/post/composite_read_io.rb +116 -0
  284. data/lib/ddtrace/vendor/multipart-post/multipart/post/multipartable.rb +57 -0
  285. data/lib/ddtrace/vendor/multipart-post/multipart/post/parts.rb +135 -0
  286. data/lib/ddtrace/vendor/multipart-post/multipart/post/version.rb +9 -0
  287. data/lib/ddtrace/vendor/multipart-post/net/http/post/multipart.rb +32 -0
  288. data/lib/ddtrace/version.rb +1 -1
  289. data/lib/ddtrace/workers.rb +5 -0
  290. data/lib/ddtrace/workers/async.rb +11 -3
  291. data/lib/ddtrace/workers/loop.rb +17 -3
  292. data/lib/ddtrace/workers/polling.rb +1 -0
  293. data/lib/ddtrace/workers/queue.rb +1 -0
  294. data/lib/ddtrace/workers/trace_writer.rb +10 -10
  295. data/lib/ddtrace/writer.rb +7 -4
  296. metadata +152 -402
  297. data/lib/ddtrace/augmentation.rb +0 -13
  298. data/lib/ddtrace/augmentation/method_wrapper.rb +0 -20
  299. data/lib/ddtrace/augmentation/method_wrapping.rb +0 -38
  300. data/lib/ddtrace/augmentation/shim.rb +0 -102
  301. data/lib/ddtrace/contrib/rspec/example_group.rb +0 -61
  302. data/lib/ddtrace/monkey.rb +0 -58
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 9d5d1f968ae142a829712c88c018d2a36c50684921cb3e92c4f3f44f098c94a3
4
- data.tar.gz: 1296fb1dd4b26cc15e6cef392b364abb19192252d6f99167a6fde82418cce557
2
+ SHA1:
3
+ metadata.gz: 9cf1ef2c94e28df64fe5d26a43c3cfb1c31cc9be
4
+ data.tar.gz: a7daf78f76f691e785946f0e3f2763b424cd6127
5
5
  SHA512:
6
- metadata.gz: 91c0cea0127c496224ba589eb67cb516c59915a038396fdcf5f70d97ca99a688926b7092f7e0e0ffb7f0690c59876e007da58694ce3a2d9f3cea52fd8b988e7a
7
- data.tar.gz: f2f6578f4fc3dcca0df0ff12a246303e5fab195cfa4faaa92ffcfc0e6290e2678827ed121dad8cb1a39aae2561fdef678041458649a1d8dc042e7fc4ee97fd43
6
+ metadata.gz: 3d4f7408c4ef0b587c3a078cb29b5165a43cbb03bb204b72d04a989de1567cd0ff9ae8c7c0649f6269a531a4041c156970fc0470c7f124b208f7a98435c942e8
7
+ data.tar.gz: a8e0484124bc54ef8c69e3af13f6f06e8b0070223a6316922e38d2df2d97004d306f3d205babfdfe876dad6f76c69ccfba77ffc5de58c7bb6fc441856f85df60
data/.circleci/config.yml CHANGED
@@ -21,8 +21,13 @@ test_containers:
21
21
  description: Jit enabled?
22
22
  type: boolean
23
23
  default: false
24
+ resource_class_to_use:
25
+ description: Resource class to use
26
+ type: string
27
+ default: medium
24
28
  - &container_base_environment
25
29
  BUNDLE_GEMFILE: /app/Gemfile
30
+ JRUBY_OPTS: --dev # Faster JVM startup: https://github.com/jruby/jruby/wiki/Improving-startup-time#use-the---dev-flag
26
31
  - &container_parameters_environment
27
32
  - *container_base_environment
28
33
  - RUBY_OPT: <<# parameters.jit >>--jit<</ parameters.jit >>
@@ -45,7 +50,8 @@ test_containers:
45
50
  - POSTGRES_DB=postgres
46
51
  - &postgres_port 5432
47
52
  - &container_presto
48
- image: prestosql/presto
53
+ # Move to trinodb/trino after https://github.com/treasure-data/presto-client-ruby/issues/64 is resolved.
54
+ image: starburstdata/presto:332-e.9
49
55
  - &presto_port 8080
50
56
  - &container_mysql
51
57
  image: mysql:5.6
@@ -132,6 +138,7 @@ orbs:
132
138
  jobs:
133
139
  build:
134
140
  <<: *test_job_default
141
+ resource_class: <<parameters.resource_class_to_use>>
135
142
  steps:
136
143
  - checkout
137
144
  - restore_cache:
@@ -161,6 +168,34 @@ orbs:
161
168
  key: bundle-{{ .Environment.CIRCLE_CACHE_VERSION }}-<<parameters.ruby_version>>-{{ checksum "lib/ddtrace/version.rb" }}-{{ .Branch }}-{{ checksum "Gemfile" }}-{{ checksum "Appraisals" }}-{{ checksum "ddtrace.gemspec" }}-{{ checksum ".circleci/bundle_checksum" }}'
162
169
  paths:
163
170
  - /usr/local/bundle
171
+ build_and_test_integration:
172
+ executor: docker-integration
173
+ parameters:
174
+ ruby_version:
175
+ description: Ruby version
176
+ type: string
177
+ integration_apps:
178
+ description: Integration apps
179
+ type: string
180
+ steps:
181
+ - checkout
182
+ - setup_remote_docker:
183
+ docker_layer_caching: true
184
+ - run:
185
+ name: Build integration base images
186
+ command: ./integration/script/build-images -v <<parameters.ruby_version>>
187
+ - run:
188
+ name: Build integration app images
189
+ command: |
190
+ for i in <<parameters.integration_apps>>; do
191
+ ./integration/apps/$i/script/build-images -v <<parameters.ruby_version>>
192
+ done
193
+ - run:
194
+ name: Test integration apps
195
+ command: |
196
+ for i in <<parameters.integration_apps>>; do
197
+ ./integration/apps/$i/script/ci -v <<parameters.ruby_version>>
198
+ done
164
199
  test:
165
200
  <<: *test_job_default
166
201
  docker:
@@ -299,6 +334,9 @@ orbs:
299
334
  name: Wait for container on port <<parameters.port>>
300
335
  command: dockerize -wait 'tcp://localhost:<<parameters.port>>' -timeout '<<parameters.timeout>>'
301
336
  executors:
337
+ docker-integration:
338
+ docker:
339
+ - image: circleci/buildpack-deps:stretch
302
340
 
303
341
  jobs:
304
342
  "deploy release":
@@ -402,10 +440,20 @@ job_configuration:
402
440
  image: marcotc/docker-library:ddtrace_rb_3.0.0
403
441
  jit: true
404
442
  # JRuby
405
- - &config-jruby-9_2
443
+ - &config-jruby-9_2_0_0 # Oldest supported version
444
+ <<: *filters_all_branches_and_tags
445
+ ruby_version: 'jruby-9.2.0.0'
446
+ image: marcotc/docker-library:ddtrace_rb_jruby_9_2_0_0
447
+ - &config-jruby-9_2-latest # More recent release of 9.2
406
448
  <<: *filters_all_branches_and_tags
407
- ruby_version: 'jruby-9.2'
408
- image: marcotc/docker-library:ddtrace_rb_jruby_9_2
449
+ ruby_version: 'jruby-9.2-latest'
450
+ image: marcotc/docker-library:ddtrace_rb_jruby_9_2_11_1
451
+ # TruffleRuby
452
+ - &config-truffleruby-21_0_0
453
+ <<: *filters_all_branches_and_tags
454
+ ruby_version: 'truffleruby-21.0.0'
455
+ image: ivoanjo/docker-library:ddtrace_rb_truffleruby_21_0_0
456
+ resource_class_to_use: large
409
457
 
410
458
  workflows:
411
459
  version: 2
@@ -429,7 +477,9 @@ workflows:
429
477
  - test-2.6
430
478
  - test-2.7
431
479
  - test-3.0
432
- - test-jruby-9.2
480
+ - test-jruby-9.2.0.0
481
+ - test-jruby-9.2-latest
482
+ # soon™️ - test-truffleruby-21.0.0
433
483
  - orb/changelog:
434
484
  <<: *config-2_7
435
485
  name: changelog
@@ -438,6 +488,53 @@ workflows:
438
488
  filters:
439
489
  branches:
440
490
  only: /bump_to_version_.*/
491
+ # Integration
492
+ - orb/build_and_test_integration:
493
+ name: build_and_test_integration-2.0
494
+ integration_apps: 'ruby rack'
495
+ ruby_version: '2.0'
496
+ <<: *filters_all_branches_and_tags
497
+ - orb/build_and_test_integration:
498
+ name: build_and_test_integration-2.1
499
+ integration_apps: 'ruby rack'
500
+ ruby_version: '2.1'
501
+ <<: *filters_all_branches_and_tags
502
+ - orb/build_and_test_integration:
503
+ name: build_and_test_integration-2.2
504
+ integration_apps: 'ruby rack'
505
+ ruby_version: '2.2'
506
+ <<: *filters_all_branches_and_tags
507
+ - orb/build_and_test_integration:
508
+ name: build_and_test_integration-2.3
509
+ integration_apps: 'ruby rack rails-five'
510
+ ruby_version: '2.3'
511
+ <<: *filters_all_branches_and_tags
512
+ - orb/build_and_test_integration:
513
+ name: build_and_test_integration-2.4
514
+ integration_apps: 'ruby rack rails-five'
515
+ ruby_version: '2.4'
516
+ <<: *filters_all_branches_and_tags
517
+ - orb/build_and_test_integration:
518
+ name: build_and_test_integration-2.5
519
+ integration_apps: 'ruby rack rails-five'
520
+ ruby_version: '2.5'
521
+ <<: *filters_all_branches_and_tags
522
+ - orb/build_and_test_integration:
523
+ name: build_and_test_integration-2.6
524
+ integration_apps: 'ruby rack rails-five'
525
+ ruby_version: '2.6'
526
+ <<: *filters_all_branches_and_tags
527
+ - orb/build_and_test_integration:
528
+ name: build_and_test_integration-2.7
529
+ integration_apps: 'ruby rack rails-five'
530
+ ruby_version: '2.7'
531
+ <<: *filters_all_branches_and_tags
532
+ - orb/build_and_test_integration:
533
+ name: build_and_test_integration-3.0
534
+ # TODO: Get Rack & Rails apps working with Ruby 3.0
535
+ integration_apps: 'ruby'
536
+ ruby_version: '3.0'
537
+ <<: *filters_all_branches_and_tags
441
538
  # MRI
442
539
  - orb/build:
443
540
  <<: *config-2_0
@@ -526,13 +623,31 @@ workflows:
526
623
  - build-3.0-jit
527
624
  # JRuby
528
625
  - orb/build:
529
- <<: *config-jruby-9_2
530
- name: build-jruby-9.2
626
+ <<: *config-jruby-9_2_0_0
627
+ name: build-jruby-9.2.0.0
628
+ - orb/test:
629
+ <<: *config-jruby-9_2_0_0
630
+ name: test-jruby-9.2.0.0
631
+ requires:
632
+ - build-jruby-9.2.0.0
633
+ - orb/build:
634
+ <<: *config-jruby-9_2-latest
635
+ name: build-jruby-9.2-latest
531
636
  - orb/test:
532
- <<: *config-jruby-9_2
533
- name: test-jruby-9.2
637
+ <<: *config-jruby-9_2-latest
638
+ name: test-jruby-9.2-latest
534
639
  requires:
535
- - build-jruby-9.2
640
+ - build-jruby-9.2-latest
641
+ # TruffleRuby
642
+ # soon™️
643
+ # - orb/build:
644
+ # <<: *config-truffleruby-21_0_0
645
+ # name: build-truffleruby-21.0.0
646
+ # - orb/test:
647
+ # <<: *config-truffleruby-21_0_0
648
+ # name: test-truffleruby-21.0.0
649
+ # requires:
650
+ # - build-truffleruby-21.0.0
536
651
  # Release jobs
537
652
  - "deploy prerelease Gem":
538
653
  <<: *filters_all_branches_and_tags
@@ -548,7 +663,9 @@ workflows:
548
663
  - test-2.7
549
664
  - test-3.0
550
665
  - test-3.0-jit
551
- - test-jruby-9.2
666
+ - test-jruby-9.2.0.0
667
+ - test-jruby-9.2-latest
668
+ # soon™️ - test-truffleruby-21.0.0
552
669
  - "deploy release":
553
670
  <<: *filters_only_release_tags
554
671
  requires:
@@ -563,4 +680,6 @@ workflows:
563
680
  - test-2.7
564
681
  - test-3.0
565
682
  - test-3.0-jit
566
- - test-jruby-9.2
683
+ - test-jruby-9.2.0.0
684
+ - test-jruby-9.2-latest
685
+ # soon™️ - test-truffleruby-21.0.0
@@ -16,7 +16,8 @@ RUN set -ex; \
16
16
  locales sudo openssh-client ca-certificates tar gzip parallel \
17
17
  net-tools netcat unzip zip bzip2 gnupg curl wget \
18
18
  tzdata rsync vim \
19
- build-essential; \
19
+ build-essential \
20
+ shared-mime-info; \
20
21
  rm -rf /var/lib/apt/lists/*;
21
22
 
22
23
  # Set timezone to UTC by default
@@ -0,0 +1,73 @@
1
+ # Current version: https://github.com/cpuguy83/docker-jruby/blob/db08637839406420a254a9c825d94994cded5021/9000/jre/Dockerfile
2
+ FROM jruby:9.2.0.0
3
+
4
+ # Make apt non-interactive
5
+ RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \
6
+ && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci
7
+
8
+ ENV DEBIAN_FRONTEND=noninteractive
9
+
10
+ # Install required packages
11
+ RUN set -ex; \
12
+ apt-get update; \
13
+ mkdir -p /usr/share/man/man1; \
14
+ apt-get install -y --no-install-recommends \
15
+ git mercurial xvfb \
16
+ locales sudo openssh-client ca-certificates tar gzip parallel \
17
+ net-tools netcat unzip zip bzip2 gnupg curl wget \
18
+ tzdata rsync vim \
19
+ build-essential; \
20
+ rm -rf /var/lib/apt/lists/*;
21
+
22
+ # Set timezone to UTC by default
23
+ RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
24
+
25
+ # Set language
26
+ RUN locale-gen en_US.UTF-8
27
+ ENV LANG en_US.UTF-8
28
+ ENV LANGUAGE en_US:en
29
+
30
+ # Install jq
31
+ RUN JQ_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/jq-latest" \
32
+ && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/jq $JQ_URL \
33
+ && chmod +x /usr/bin/jq \
34
+ && jq --version
35
+
36
+ # Install Docker
37
+ RUN set -ex \
38
+ && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/x86_64/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \
39
+ && DOCKER_URL="https://download.docker.com/linux/static/stable/x86_64/${DOCKER_VERSION}" \
40
+ && echo Docker URL: $DOCKER_URL \
41
+ && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \
42
+ && ls -lha /tmp/docker.tgz \
43
+ && tar -xz -C /tmp -f /tmp/docker.tgz \
44
+ && mv /tmp/docker/* /usr/bin \
45
+ && rm -rf /tmp/docker /tmp/docker.tgz \
46
+ && which docker \
47
+ && (docker version || true)
48
+
49
+ # Install Docker Compose
50
+ RUN COMPOSE_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/docker-compose-latest" \
51
+ && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \
52
+ && chmod +x /usr/bin/docker-compose \
53
+ && docker-compose version
54
+
55
+ # Install Dockerize
56
+ RUN DOCKERIZE_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/dockerize-latest.tar.gz" \
57
+ && curl --silent --show-error --location --fail --retry 3 --output /tmp/dockerize-linux-amd64.tar.gz $DOCKERIZE_URL \
58
+ && tar -C /usr/local/bin -xzvf /tmp/dockerize-linux-amd64.tar.gz \
59
+ && rm -rf /tmp/dockerize-linux-amd64.tar.gz \
60
+ && dockerize --version
61
+
62
+ # Install RubyGems
63
+ RUN gem update --system
64
+ RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME"
65
+ ENV BUNDLE_SILENCE_ROOT_WARNING 1
66
+
67
+ # Ensure JRuby is available when running "bash --login"
68
+ RUN echo "export PATH=/opt/jruby/bin:$BUNDLE_BIN:\$PATH" >> ~/.profile
69
+
70
+ RUN mkdir /app
71
+ WORKDIR /app
72
+
73
+ CMD ["bin", "bash", "--login"]
@@ -0,0 +1,73 @@
1
+ FROM flavorjones/truffleruby:21.0.0-buster
2
+
3
+ # Make apt non-interactive
4
+ RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \
5
+ && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci
6
+
7
+ ENV DEBIAN_FRONTEND=noninteractive
8
+
9
+ # Install required packages
10
+ RUN set -ex; \
11
+ apt-get update; \
12
+ mkdir -p /usr/share/man/man1; \
13
+ apt-get install -y --no-install-recommends \
14
+ git mercurial xvfb \
15
+ locales sudo openssh-client ca-certificates tar gzip parallel \
16
+ net-tools netcat unzip zip bzip2 gnupg curl wget \
17
+ tzdata rsync vim; \
18
+ rm -rf /var/lib/apt/lists/*;
19
+
20
+ # Set timezone to UTC by default
21
+ RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
22
+
23
+ # Set language
24
+ RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
25
+ RUN locale-gen en_US.UTF-8
26
+ ENV LANG en_US.UTF-8
27
+ ENV LANGUAGE en_US:en
28
+
29
+ # Install jq
30
+ RUN JQ_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/jq-latest" \
31
+ && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/jq $JQ_URL \
32
+ && chmod +x /usr/bin/jq \
33
+ && jq --version
34
+
35
+ # Install Docker
36
+ RUN set -ex \
37
+ && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/x86_64/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \
38
+ && DOCKER_URL="https://download.docker.com/linux/static/stable/x86_64/${DOCKER_VERSION}" \
39
+ && echo Docker URL: $DOCKER_URL \
40
+ && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \
41
+ && ls -lha /tmp/docker.tgz \
42
+ && tar -xz -C /tmp -f /tmp/docker.tgz \
43
+ && mv /tmp/docker/* /usr/bin \
44
+ && rm -rf /tmp/docker /tmp/docker.tgz \
45
+ && which docker \
46
+ && (docker version || true)
47
+
48
+ # Install Docker Compose
49
+ RUN COMPOSE_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/docker-compose-latest" \
50
+ && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \
51
+ && chmod +x /usr/bin/docker-compose \
52
+ && docker-compose version
53
+
54
+ # Install Dockerize
55
+ RUN DOCKERIZE_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/dockerize-latest.tar.gz" \
56
+ && curl --silent --show-error --location --fail --retry 3 --output /tmp/dockerize-linux-amd64.tar.gz $DOCKERIZE_URL \
57
+ && tar -C /usr/local/bin -xzvf /tmp/dockerize-linux-amd64.tar.gz \
58
+ && rm -rf /tmp/dockerize-linux-amd64.tar.gz \
59
+ && dockerize --version
60
+
61
+ # Install RubyGems
62
+ RUN gem update --system
63
+ RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME"
64
+
65
+ # Upgrade RubyGems and Bundler
66
+ RUN gem update --system
67
+ RUN gem install bundler
68
+ ENV BUNDLE_SILENCE_ROOT_WARNING 1
69
+
70
+ RUN mkdir /app
71
+ WORKDIR /app
72
+
73
+ CMD ["/bin/sh"]
@@ -9,11 +9,11 @@ jobs:
9
9
  steps:
10
10
  - name: Get next minor version
11
11
  id: semvers
12
- uses: WyriHaximus/github-action-next-semvers@0.1.0
12
+ uses: WyriHaximus/github-action-next-semvers@b135abb108d66990a85e18623d906404f4350ce4
13
13
  with:
14
14
  version: ${{ github.event.milestone.title }}
15
15
  - name: Create next milestone
16
- uses: WyriHaximus/github-action-create-milestone@0.1.0
16
+ uses: WyriHaximus/github-action-create-milestone@ab85332e3150ec018daf497a0f761fe69d52bc7d
17
17
  with:
18
18
  title: ${{ steps.semvers.outputs.minor }}
19
19
  env:
data/.rubocop.yml CHANGED
@@ -1,5 +1,11 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ require:
4
+ - rubocop-performance
5
+ - rubocop-rspec
6
+
1
7
  AllCops:
2
- TargetRubyVersion: 2.1
8
+ TargetRubyVersion: 2.4 # Lowest version supported currently
3
9
  Include:
4
10
  - 'lib/**/*.rb'
5
11
  - 'test/**/*.rb'
@@ -9,11 +15,14 @@ AllCops:
9
15
  Exclude:
10
16
  - 'Appraisals'
11
17
  - '*.gemspec'
12
- - 'lib/ddtrace/vendor/**/*.rb'
18
+ - 'lib/ddtrace/**/vendor/**/*.rb'
19
+ - 'integration/apps/*/bin/*'
20
+ - 'integration/apps/*/Gemfile'
21
+ NewCops: disable # Don't allow new cops to be enabled implicitly.
13
22
 
14
23
  # 80 characters is a nice goal, but not worth currently changing in existing
15
24
  # code for the sake of changing it to conform to a length set in 1928 (IBM).
16
- Metrics/LineLength:
25
+ Layout/LineLength:
17
26
  Max: 124
18
27
 
19
28
  # These exceptions are good goals to attain, and probably will over time,
@@ -34,10 +43,7 @@ Performance/Casecmp:
34
43
  # should enable again this rule but it will change the public API because
35
44
  # we're using set_ methods. We should work on that because also Rails
36
45
  # honors this rule.
37
- Style/AccessorMethodName:
38
- Enabled: false
39
-
40
- Style/MethodCallWithoutArgsParentheses:
46
+ Naming/AccessorMethodName:
41
47
  Enabled: false
42
48
 
43
49
  Style/RescueModifier:
@@ -67,6 +73,9 @@ Metrics/PerceivedComplexity:
67
73
  Lint/UnusedMethodArgument:
68
74
  Enabled: false
69
75
 
76
+ Style/RescueStandardError:
77
+ Enabled: false
78
+
70
79
  # alias and alias_method are not equivalent
71
80
  Style/Alias:
72
81
  Enabled: false
@@ -83,3 +92,237 @@ Style/GuardClause:
83
92
  # Case equality is not intrinsically problematic.
84
93
  Style/CaseEquality:
85
94
  Enabled: false
95
+
96
+ # New cops since Rubocop 1.0.
97
+ # We have to explicitly opt-in for new cops to apply
98
+ # before the next major release.
99
+ Gemspec/DateAssignment: # (new in 1.10)
100
+ Enabled: true
101
+ Layout/SpaceBeforeBrackets: # (new in 1.7)
102
+ Enabled: true
103
+ Lint/AmbiguousAssignment: # (new in 1.7)
104
+ Enabled: true
105
+ Lint/DeprecatedConstants: # (new in 1.8)
106
+ Enabled: true
107
+ Lint/DuplicateBranch: # (new in 1.3)
108
+ Enabled: true
109
+ Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
110
+ Enabled: true
111
+ Lint/EmptyClass: # (new in 1.3)
112
+ Enabled: true
113
+ Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
114
+ Enabled: true
115
+ Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
116
+ Enabled: true
117
+ Lint/NumberedParameterAssignment: # (new in 1.9)
118
+ Enabled: true
119
+ Lint/OrAssignmentToConstant: # (new in 1.9)
120
+ Enabled: true
121
+ Lint/RedundantDirGlobSort: # (new in 1.8)
122
+ Enabled: true
123
+ Lint/SymbolConversion: # (new in 1.9)
124
+ Enabled: true
125
+ Lint/ToEnumArguments: # (new in 1.1)
126
+ Enabled: true
127
+ Lint/TripleQuotes: # (new in 1.9)
128
+ Enabled: true
129
+ Lint/UnexpectedBlockArity: # (new in 1.5)
130
+ Enabled: true
131
+ Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
132
+ Enabled: true
133
+ Style/ArgumentsForwarding: # (new in 1.1)
134
+ Enabled: true
135
+ Style/DocumentDynamicEvalDefinition: # (new in 1.1)
136
+ Enabled: true
137
+ Style/EndlessMethod: # (new in 1.8)
138
+ Enabled: true
139
+ Style/HashExcept: # (new in 1.7)
140
+ Enabled: true
141
+ Style/IfWithBooleanLiteralBranches: # (new in 1.9)
142
+ Enabled: true
143
+ Style/NilLambda: # (new in 1.3)
144
+ Enabled: true
145
+ Style/RedundantArgument: # (new in 1.4)
146
+ Enabled: true
147
+ Style/SwapValues: # (new in 1.1)
148
+ Enabled: true
149
+ Performance/AncestorsInclude: # (new in 1.7)
150
+ Enabled: true
151
+ Performance/BigDecimalWithNumericArgument: # (new in 1.7)
152
+ Enabled: true
153
+ Performance/BlockGivenWithExplicitBlock: # (new in 1.9)
154
+ Enabled: true
155
+ Performance/CollectionLiteralInLoop: # (new in 1.8)
156
+ Enabled: true
157
+ Performance/ConstantRegexp: # (new in 1.9)
158
+ Enabled: true
159
+ Performance/MethodObjectAsBlock: # (new in 1.9)
160
+ Enabled: true
161
+ Performance/RedundantSortBlock: # (new in 1.7)
162
+ Enabled: true
163
+ Performance/RedundantStringChars: # (new in 1.7)
164
+ Enabled: true
165
+ Performance/ReverseFirst: # (new in 1.7)
166
+ Enabled: true
167
+ Performance/SortReverse: # (new in 1.7)
168
+ Enabled: true
169
+ Performance/Squeeze: # (new in 1.7)
170
+ Enabled: true
171
+ Performance/StringInclude: # (new in 1.7)
172
+ Enabled: true
173
+ Performance/Sum: # (new in 1.8)
174
+ Enabled: true
175
+
176
+ # Requires Ruby 2.1
177
+ Style/HashConversion:
178
+ Enabled: false
179
+
180
+ # Requires Ruby 2.1
181
+ Lint/SendWithMixinArgument:
182
+ Enabled: false
183
+
184
+ # Requires Ruby 2.2
185
+ Style/HashSyntax:
186
+ Enabled: false
187
+
188
+ # Requires Ruby 2.3
189
+ Style/SafeNavigation:
190
+ Enabled: false
191
+
192
+ # Requires Ruby 2.3
193
+ Performance/UnfreezeString:
194
+ Enabled: false
195
+
196
+ # Requires Ruby 2.4
197
+ Style/HashTransformValues:
198
+ Enabled: false
199
+
200
+ # Requires Ruby 2.4
201
+ Style/CollectionCompact:
202
+ Enabled: false
203
+
204
+ # Enforces negative/positive branching order,
205
+ # which can hurt readability.
206
+ Style/NegatedIfElseCondition:
207
+ Enabled: false
208
+
209
+ # Converts `to change{foo.bar}` to `to change(foo, :bar)`.
210
+ # It doesn't seem to make it more readable, and doesn't work
211
+ # when `foo` has to be re-evaluated.
212
+ RSpec/ExpectChange:
213
+ Enabled: false
214
+
215
+ # Readability is not meaningfully affected by enforcing
216
+ # `not_to` vs `to_not`.
217
+ RSpec/NotToNot:
218
+ Enabled: false
219
+
220
+ # Enforces `subject` above all else, even `include_context`
221
+ # declarations.
222
+ RSpec/LeadingSubject:
223
+ Enabled: false
224
+
225
+ # Enforces usage of `expect(subject)` instead of `is_expected`.
226
+ RSpec/ImplicitSubject:
227
+ Enabled: false
228
+
229
+ # TODO: Disabling until we categorize which file are safe to do so.
230
+ Style/FrozenStringLiteralComment:
231
+ Enabled: false
232
+
233
+ # Replaces `x == 0` with `x.zero?` and similar.
234
+ # These methods are ~2x slower than the simple math comparison.
235
+ Style/NumericPredicate:
236
+ Enabled: false
237
+
238
+ # Allow for empty blocks (without a comment) in tests.
239
+ Lint/EmptyBlock:
240
+ Exclude:
241
+ - 'test/**/*.rb'
242
+ - 'spec/**/*.rb'
243
+
244
+ # Enforces that context description must start with 'when', 'with', or 'without'.
245
+ RSpec/ContextWording:
246
+ Enabled: false
247
+
248
+ # Enforces that examples should only have a limited amount of assertions.
249
+ RSpec/MultipleExpectations:
250
+ Enabled: false
251
+
252
+ # Enforces minimum character length for parameters.
253
+ Naming/MethodParameterName:
254
+ Enabled: false
255
+
256
+ # Enforces no instance variable in specs.
257
+ RSpec/InstanceVariable:
258
+ Enabled: false
259
+
260
+ # Enforces a maximum nested example group level.
261
+ RSpec/NestedGroups:
262
+ Enabled: false
263
+
264
+ # Enforces `receive` vs `have_received` expectation pattern.
265
+ RSpec/MessageSpies:
266
+ Enabled: false
267
+
268
+ # Enforces example line count limit.
269
+ RSpec/ExampleLength:
270
+ Enabled: false
271
+
272
+ # Enforces maximum let and subject calls.
273
+ RSpec/MultipleMemoizedHelpers:
274
+ Enabled: false
275
+
276
+ # Enforces `allow` over `expect` when configuring a response.
277
+ RSpec/StubbedMock:
278
+ Enabled: false
279
+
280
+ # Enforces no use of `expect` in `before` hooks.
281
+ RSpec/ExpectInHook:
282
+ Enabled: false
283
+
284
+ # Enforces no stubbing using `allow_any_instance_of`.
285
+ RSpec/AnyInstance:
286
+ Enabled: false
287
+
288
+ # Enforces strict matching of example class with spec file name.
289
+ # This does not work for our current namespacing as our gem is called
290
+ # `ddtrace` while our namespace is `::Datadog`.
291
+ # It would have to either be `ddtrace` + `::DDTrace` or
292
+ # `datadog` + `::Datadog`.
293
+ RSpec/FilePath:
294
+ Enabled: false
295
+
296
+ # Enforces no stubbing of methods of the object under test.
297
+ RSpec/SubjectStub:
298
+ Enabled: false
299
+
300
+ # Enforces that the first argument to describe should
301
+ # be the class or module being tested.
302
+ RSpec/DescribeClass:
303
+ Enabled: false
304
+
305
+ # Enforces to no use let! to setup objects not referenced in tests.
306
+ # Fails to account for shared examples across files.
307
+ RSpec/LetSetup:
308
+ Enabled: false
309
+
310
+ # Identifies where `fetch(key) { value }` can be replaced by `fetch(key, value)`.
311
+ # Can't differentiate between `Hash#fetch` and `RailsCache#fetch`,
312
+ # passing in wrong parameters to these methods.
313
+ Style/RedundantFetchBlock:
314
+ Enabled: false
315
+
316
+ # Warns about usage of `before(:all)`
317
+ RSpec/BeforeAfterAll:
318
+ Enabled: false
319
+
320
+ # Enforces snake case file names.
321
+ Naming/FileName:
322
+ Exclude:
323
+ - 'integration/**/Gemfile'
324
+ - 'integration/**/Rakefile'
325
+
326
+ # Enforces boolean parameters with default to be keyword arguments.
327
+ Style/OptionalBooleanParameter:
328
+ Enabled: false