elastic-apm 3.3.0 → 3.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/.jenkins_exclude.yml +43 -24
  3. data/.ci/.jenkins_framework.yml +2 -2
  4. data/.ci/.jenkins_ruby.yml +1 -1
  5. data/.ci/Jenkinsfile +288 -170
  6. data/.ci/docker/jruby/11-jdk/Dockerfile +40 -0
  7. data/.ci/docker/jruby/12-jdk/Dockerfile +40 -0
  8. data/.ci/docker/jruby/13-jdk/Dockerfile +40 -0
  9. data/.ci/docker/jruby/7-jdk/Dockerfile +40 -0
  10. data/.ci/docker/jruby/8-jdk/Dockerfile +40 -0
  11. data/.ci/docker/jruby/README.md +31 -0
  12. data/.ci/docker/jruby/run.sh +73 -0
  13. data/.ci/docker/jruby/test.sh +13 -0
  14. data/.ci/jobs/apm-agent-ruby-downstream.yml +1 -0
  15. data/.ci/jobs/apm-agent-ruby-linting-mbp.yml +1 -0
  16. data/.ci/jobs/apm-agent-ruby-mbp.yml +1 -0
  17. data/.ci/jobs/defaults.yml +1 -1
  18. data/.ci/packer_cache.sh +16 -0
  19. data/.github/ISSUE_TEMPLATE/Bug_report.md +40 -0
  20. data/.github/ISSUE_TEMPLATE/Feature_request.md +17 -0
  21. data/.github/PULL_REQUEST_TEMPLATE.md +60 -0
  22. data/.gitignore +8 -0
  23. data/.rspec +0 -1
  24. data/.rubocop.yml +18 -0
  25. data/CHANGELOG.asciidoc +104 -1
  26. data/CONTRIBUTING.md +6 -48
  27. data/Gemfile +38 -10
  28. data/README.md +62 -13
  29. data/Rakefile +37 -5
  30. data/bench/sql.rb +49 -0
  31. data/bin/build_docs +1 -1
  32. data/bin/run-tests +4 -1
  33. data/docker-compose.yml +7 -0
  34. data/docs/api.asciidoc +52 -3
  35. data/docs/configuration.asciidoc +171 -22
  36. data/docs/getting-started-rails.asciidoc +2 -0
  37. data/docs/graphql.asciidoc +23 -0
  38. data/docs/images/dynamic-config.svg +1 -0
  39. data/docs/index.asciidoc +6 -1
  40. data/docs/introduction.asciidoc +2 -1
  41. data/docs/performance-tuning.asciidoc +106 -0
  42. data/docs/set-up.asciidoc +5 -2
  43. data/docs/supported-technologies.asciidoc +86 -1
  44. data/docs/upgrading.asciidoc +45 -0
  45. data/elastic-apm.gemspec +17 -0
  46. data/lib/elastic-apm.rb +17 -0
  47. data/lib/elastic_apm.rb +58 -5
  48. data/lib/elastic_apm/agent.rb +55 -4
  49. data/lib/elastic_apm/central_config.rb +27 -8
  50. data/lib/elastic_apm/central_config/cache_control.rb +17 -0
  51. data/lib/elastic_apm/child_durations.rb +26 -4
  52. data/lib/elastic_apm/config.rb +86 -5
  53. data/lib/elastic_apm/config/bytes.rb +17 -0
  54. data/lib/elastic_apm/config/duration.rb +17 -0
  55. data/lib/elastic_apm/config/options.rb +21 -5
  56. data/lib/elastic_apm/config/regexp_list.rb +17 -0
  57. data/lib/elastic_apm/config/wildcard_pattern_list.rb +20 -1
  58. data/lib/elastic_apm/context.rb +17 -0
  59. data/lib/elastic_apm/context/request.rb +17 -0
  60. data/lib/elastic_apm/context/request/socket.rb +17 -0
  61. data/lib/elastic_apm/context/request/url.rb +17 -0
  62. data/lib/elastic_apm/context/response.rb +27 -2
  63. data/lib/elastic_apm/context/user.rb +17 -0
  64. data/lib/elastic_apm/context_builder.rb +17 -0
  65. data/lib/elastic_apm/deprecations.rb +17 -0
  66. data/lib/elastic_apm/error.rb +17 -0
  67. data/lib/elastic_apm/error/exception.rb +17 -0
  68. data/lib/elastic_apm/error/log.rb +17 -0
  69. data/lib/elastic_apm/error_builder.rb +17 -0
  70. data/lib/elastic_apm/grape.rb +17 -0
  71. data/lib/elastic_apm/graphql.rb +91 -0
  72. data/lib/elastic_apm/grpc.rb +99 -0
  73. data/lib/elastic_apm/instrumenter.rb +49 -15
  74. data/lib/elastic_apm/internal_error.rb +17 -0
  75. data/lib/elastic_apm/logging.rb +17 -0
  76. data/lib/elastic_apm/metadata.rb +17 -0
  77. data/lib/elastic_apm/metadata/process_info.rb +17 -0
  78. data/lib/elastic_apm/metadata/service_info.rb +22 -2
  79. data/lib/elastic_apm/metadata/system_info.rb +17 -0
  80. data/lib/elastic_apm/metadata/system_info/container_info.rb +17 -0
  81. data/lib/elastic_apm/metrics.rb +33 -1
  82. data/lib/elastic_apm/metrics/breakdown_set.rb +17 -0
  83. data/lib/elastic_apm/metrics/cpu_mem_set.rb +17 -0
  84. data/lib/elastic_apm/metrics/metric.rb +23 -4
  85. data/lib/elastic_apm/metrics/set.rb +17 -0
  86. data/lib/elastic_apm/metrics/span_scoped_set.rb +17 -0
  87. data/lib/elastic_apm/metrics/transaction_set.rb +17 -0
  88. data/lib/elastic_apm/metrics/vm_set.rb +17 -0
  89. data/lib/elastic_apm/metricset.rb +17 -0
  90. data/lib/elastic_apm/middleware.rb +20 -4
  91. data/lib/elastic_apm/naively_hashable.rb +17 -0
  92. data/lib/elastic_apm/normalizers.rb +17 -0
  93. data/lib/elastic_apm/normalizers/grape.rb +17 -0
  94. data/lib/elastic_apm/normalizers/grape/endpoint_run.rb +18 -1
  95. data/lib/elastic_apm/normalizers/rails.rb +17 -0
  96. data/lib/elastic_apm/normalizers/rails/action_controller.rb +17 -0
  97. data/lib/elastic_apm/normalizers/rails/action_mailer.rb +17 -0
  98. data/lib/elastic_apm/normalizers/rails/action_view.rb +17 -0
  99. data/lib/elastic_apm/normalizers/rails/active_record.rb +29 -5
  100. data/lib/elastic_apm/opentracing.rb +66 -24
  101. data/lib/elastic_apm/rails.rb +18 -10
  102. data/lib/elastic_apm/railtie.rb +18 -1
  103. data/lib/elastic_apm/resque.rb +29 -0
  104. data/lib/elastic_apm/sinatra.rb +17 -0
  105. data/lib/elastic_apm/span.rb +20 -2
  106. data/lib/elastic_apm/span/context.rb +43 -44
  107. data/lib/elastic_apm/span/context/db.rb +43 -0
  108. data/lib/elastic_apm/span/context/destination.rb +77 -0
  109. data/lib/elastic_apm/span/context/http.rb +43 -0
  110. data/lib/elastic_apm/span_helpers.rb +17 -0
  111. data/lib/elastic_apm/spies.rb +33 -14
  112. data/lib/elastic_apm/spies/action_dispatch.rb +17 -0
  113. data/lib/elastic_apm/spies/delayed_job.rb +17 -0
  114. data/lib/elastic_apm/spies/elasticsearch.rb +49 -5
  115. data/lib/elastic_apm/spies/faraday.rb +53 -18
  116. data/lib/elastic_apm/spies/http.rb +35 -3
  117. data/lib/elastic_apm/spies/json.rb +17 -0
  118. data/lib/elastic_apm/spies/mongo.rb +23 -1
  119. data/lib/elastic_apm/spies/net_http.rb +50 -8
  120. data/lib/elastic_apm/spies/rake.rb +17 -0
  121. data/lib/elastic_apm/spies/redis.rb +17 -0
  122. data/lib/elastic_apm/spies/resque.rb +53 -0
  123. data/lib/elastic_apm/spies/sequel.rb +52 -15
  124. data/lib/elastic_apm/spies/shoryuken.rb +65 -0
  125. data/lib/elastic_apm/spies/sidekiq.rb +17 -0
  126. data/lib/elastic_apm/spies/sinatra.rb +17 -0
  127. data/lib/elastic_apm/spies/sneakers.rb +74 -0
  128. data/lib/elastic_apm/spies/sucker_punch.rb +54 -0
  129. data/lib/elastic_apm/spies/tilt.rb +17 -0
  130. data/lib/elastic_apm/sql.rb +36 -0
  131. data/lib/elastic_apm/sql/signature.rb +169 -0
  132. data/lib/elastic_apm/sql/tokenizer.rb +264 -0
  133. data/lib/elastic_apm/sql/tokens.rb +63 -0
  134. data/lib/elastic_apm/sql_summarizer.rb +18 -2
  135. data/lib/elastic_apm/stacktrace.rb +17 -0
  136. data/lib/elastic_apm/stacktrace/frame.rb +17 -0
  137. data/lib/elastic_apm/stacktrace_builder.rb +23 -1
  138. data/lib/elastic_apm/subscriber.rb +17 -0
  139. data/lib/elastic_apm/trace_context.rb +85 -49
  140. data/lib/elastic_apm/trace_context/traceparent.rb +113 -0
  141. data/lib/elastic_apm/trace_context/tracestate.rb +43 -0
  142. data/lib/elastic_apm/transaction.rb +43 -15
  143. data/lib/elastic_apm/transport/base.rb +39 -23
  144. data/lib/elastic_apm/transport/connection.rb +17 -0
  145. data/lib/elastic_apm/transport/connection/http.rb +17 -0
  146. data/lib/elastic_apm/transport/connection/proxy_pipe.rb +24 -2
  147. data/lib/elastic_apm/transport/filters.rb +17 -0
  148. data/lib/elastic_apm/transport/filters/hash_sanitizer.rb +77 -0
  149. data/lib/elastic_apm/transport/filters/secrets_filter.rb +29 -53
  150. data/lib/elastic_apm/transport/headers.rb +21 -0
  151. data/lib/elastic_apm/transport/serializers.rb +17 -0
  152. data/lib/elastic_apm/transport/serializers/context_serializer.rb +17 -0
  153. data/lib/elastic_apm/transport/serializers/error_serializer.rb +17 -0
  154. data/lib/elastic_apm/transport/serializers/metadata_serializer.rb +44 -20
  155. data/lib/elastic_apm/transport/serializers/metricset_serializer.rb +17 -0
  156. data/lib/elastic_apm/transport/serializers/span_serializer.rb +45 -8
  157. data/lib/elastic_apm/transport/serializers/transaction_serializer.rb +17 -0
  158. data/lib/elastic_apm/transport/user_agent.rb +17 -0
  159. data/lib/elastic_apm/transport/worker.rb +17 -0
  160. data/lib/elastic_apm/util.rb +17 -0
  161. data/lib/elastic_apm/util/inflector.rb +17 -0
  162. data/lib/elastic_apm/util/lru_cache.rb +17 -0
  163. data/lib/elastic_apm/util/throttle.rb +17 -0
  164. data/lib/elastic_apm/version.rb +18 -1
  165. metadata +36 -7
  166. data/.ci/downstreamTests.groovy +0 -185
  167. data/.ci/prepare-git-context.sh +0 -24
  168. data/.github/workflows/main.yml +0 -14
  169. data/CHANGELOG.md +0 -1
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic-apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikkel Malmberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-05 00:00:00.000000000 Z
11
+ date: 2020-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -51,21 +51,29 @@ files:
51
51
  - ".ci/.jenkins_master_framework.yml"
52
52
  - ".ci/.jenkins_ruby.yml"
53
53
  - ".ci/Jenkinsfile"
54
- - ".ci/downstreamTests.groovy"
54
+ - ".ci/docker/jruby/11-jdk/Dockerfile"
55
+ - ".ci/docker/jruby/12-jdk/Dockerfile"
56
+ - ".ci/docker/jruby/13-jdk/Dockerfile"
57
+ - ".ci/docker/jruby/7-jdk/Dockerfile"
58
+ - ".ci/docker/jruby/8-jdk/Dockerfile"
59
+ - ".ci/docker/jruby/README.md"
60
+ - ".ci/docker/jruby/run.sh"
61
+ - ".ci/docker/jruby/test.sh"
55
62
  - ".ci/jobs/apm-agent-ruby-downstream.yml"
56
63
  - ".ci/jobs/apm-agent-ruby-linting-mbp.yml"
57
64
  - ".ci/jobs/apm-agent-ruby-mbp.yml"
58
65
  - ".ci/jobs/apm-agent-ruby.yml"
59
66
  - ".ci/jobs/defaults.yml"
60
67
  - ".ci/linting.groovy"
61
- - ".ci/prepare-git-context.sh"
62
- - ".github/workflows/main.yml"
68
+ - ".ci/packer_cache.sh"
69
+ - ".github/ISSUE_TEMPLATE/Bug_report.md"
70
+ - ".github/ISSUE_TEMPLATE/Feature_request.md"
71
+ - ".github/PULL_REQUEST_TEMPLATE.md"
63
72
  - ".gitignore"
64
73
  - ".pre-commit-config.yaml"
65
74
  - ".rspec"
66
75
  - ".rubocop.yml"
67
76
  - CHANGELOG.asciidoc
68
- - CHANGELOG.md
69
77
  - CODE_OF_CONDUCT.md
70
78
  - CONTRIBUTING.md
71
79
  - Dockerfile
@@ -78,6 +86,7 @@ files:
78
86
  - bench/benchmark.rb
79
87
  - bench/report.rb
80
88
  - bench/rubyprof.rb
89
+ - bench/sql.rb
81
90
  - bench/stackprof.rb
82
91
  - bench/tmp/.gitkeep
83
92
  - bin/build_docs
@@ -95,14 +104,18 @@ files:
95
104
  - docs/debugging.asciidoc
96
105
  - docs/getting-started-rack.asciidoc
97
106
  - docs/getting-started-rails.asciidoc
107
+ - docs/graphql.asciidoc
108
+ - docs/images/dynamic-config.svg
98
109
  - docs/index.asciidoc
99
110
  - docs/introduction.asciidoc
100
111
  - docs/log-correlation.asciidoc
101
112
  - docs/metrics.asciidoc
102
113
  - docs/opentracing.asciidoc
114
+ - docs/performance-tuning.asciidoc
103
115
  - docs/release-notes.asciidoc
104
116
  - docs/set-up.asciidoc
105
117
  - docs/supported-technologies.asciidoc
118
+ - docs/upgrading.asciidoc
106
119
  - elastic-apm.gemspec
107
120
  - lib/elastic-apm.rb
108
121
  - lib/elastic_apm.rb
@@ -129,6 +142,8 @@ files:
129
142
  - lib/elastic_apm/error/log.rb
130
143
  - lib/elastic_apm/error_builder.rb
131
144
  - lib/elastic_apm/grape.rb
145
+ - lib/elastic_apm/graphql.rb
146
+ - lib/elastic_apm/grpc.rb
132
147
  - lib/elastic_apm/instrumenter.rb
133
148
  - lib/elastic_apm/internal_error.rb
134
149
  - lib/elastic_apm/logging.rb
@@ -159,9 +174,13 @@ files:
159
174
  - lib/elastic_apm/opentracing.rb
160
175
  - lib/elastic_apm/rails.rb
161
176
  - lib/elastic_apm/railtie.rb
177
+ - lib/elastic_apm/resque.rb
162
178
  - lib/elastic_apm/sinatra.rb
163
179
  - lib/elastic_apm/span.rb
164
180
  - lib/elastic_apm/span/context.rb
181
+ - lib/elastic_apm/span/context/db.rb
182
+ - lib/elastic_apm/span/context/destination.rb
183
+ - lib/elastic_apm/span/context/http.rb
165
184
  - lib/elastic_apm/span_helpers.rb
166
185
  - lib/elastic_apm/spies.rb
167
186
  - lib/elastic_apm/spies/action_dispatch.rb
@@ -174,22 +193,33 @@ files:
174
193
  - lib/elastic_apm/spies/net_http.rb
175
194
  - lib/elastic_apm/spies/rake.rb
176
195
  - lib/elastic_apm/spies/redis.rb
196
+ - lib/elastic_apm/spies/resque.rb
177
197
  - lib/elastic_apm/spies/sequel.rb
198
+ - lib/elastic_apm/spies/shoryuken.rb
178
199
  - lib/elastic_apm/spies/sidekiq.rb
179
200
  - lib/elastic_apm/spies/sinatra.rb
201
+ - lib/elastic_apm/spies/sneakers.rb
202
+ - lib/elastic_apm/spies/sucker_punch.rb
180
203
  - lib/elastic_apm/spies/tilt.rb
204
+ - lib/elastic_apm/sql.rb
205
+ - lib/elastic_apm/sql/signature.rb
206
+ - lib/elastic_apm/sql/tokenizer.rb
207
+ - lib/elastic_apm/sql/tokens.rb
181
208
  - lib/elastic_apm/sql_summarizer.rb
182
209
  - lib/elastic_apm/stacktrace.rb
183
210
  - lib/elastic_apm/stacktrace/frame.rb
184
211
  - lib/elastic_apm/stacktrace_builder.rb
185
212
  - lib/elastic_apm/subscriber.rb
186
213
  - lib/elastic_apm/trace_context.rb
214
+ - lib/elastic_apm/trace_context/traceparent.rb
215
+ - lib/elastic_apm/trace_context/tracestate.rb
187
216
  - lib/elastic_apm/transaction.rb
188
217
  - lib/elastic_apm/transport/base.rb
189
218
  - lib/elastic_apm/transport/connection.rb
190
219
  - lib/elastic_apm/transport/connection/http.rb
191
220
  - lib/elastic_apm/transport/connection/proxy_pipe.rb
192
221
  - lib/elastic_apm/transport/filters.rb
222
+ - lib/elastic_apm/transport/filters/hash_sanitizer.rb
193
223
  - lib/elastic_apm/transport/filters/secrets_filter.rb
194
224
  - lib/elastic_apm/transport/headers.rb
195
225
  - lib/elastic_apm/transport/serializers.rb
@@ -206,7 +236,6 @@ files:
206
236
  - lib/elastic_apm/util/lru_cache.rb
207
237
  - lib/elastic_apm/util/throttle.rb
208
238
  - lib/elastic_apm/version.rb
209
- - vendor/.gitkeep
210
239
  homepage: https://github.com/elastic/apm-agent-ruby
211
240
  licenses:
212
241
  - Apache-2.0
@@ -1,185 +0,0 @@
1
- #!/usr/bin/env groovy
2
- @Library('apm@current') _
3
-
4
- import co.elastic.matrix.*
5
- import groovy.transform.Field
6
-
7
- /**
8
- This is the parallel tasks generator,
9
- it is need as field to store the results of the tests.
10
- */
11
- @Field def rubyTasksGen
12
-
13
- pipeline {
14
- agent { label 'linux && immutable' }
15
- environment {
16
- REPO="git@github.com:elastic/apm-agent-ruby.git"
17
- BASE_DIR="src/github.com/elastic/apm-agent-ruby"
18
- PIPELINE_LOG_LEVEL='INFO'
19
- NOTIFY_TO = credentials('notify-to')
20
- JOB_GCS_BUCKET = credentials('gcs-bucket')
21
- JOB_GIT_CREDENTIALS = "f6c7695a-671e-4f4f-a331-acdce44ff9ba"
22
- DOCKER_REGISTRY = 'docker.elastic.co'
23
- DOCKER_SECRET = 'secret/apm-team/ci/docker-registry/prod'
24
- CODECOV_SECRET = 'secret/apm-team/ci/apm-agent-ruby-codecov'
25
- }
26
- options {
27
- timeout(time: 2, unit: 'HOURS')
28
- buildDiscarder(logRotator(numToKeepStr: '300', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
29
- timestamps()
30
- ansiColor('xterm')
31
- disableResume()
32
- durabilityHint('PERFORMANCE_OPTIMIZED')
33
- rateLimitBuilds(throttle: [count: 60, durationName: 'hour', userBoost: true])
34
- quietPeriod(10)
35
- }
36
- parameters {
37
- string(name: 'RUBY_VERSION', defaultValue: "ruby:2.6", description: "Ruby version to test")
38
- string(name: 'BRANCH_SPECIFIER', defaultValue: "master", description: "Git branch/tag to use")
39
- }
40
- stages {
41
- /**
42
- Checkout the code and stash it, to use it on other stages.
43
- */
44
- stage('Checkout') {
45
- options { skipDefaultCheckout() }
46
- steps {
47
- deleteDir()
48
- gitCheckout(basedir: "${BASE_DIR}",
49
- branch: "${params.BRANCH_SPECIFIER}",
50
- repo: "${REPO}",
51
- credentialsId: "${JOB_GIT_CREDENTIALS}")
52
- stash allowEmpty: true, name: 'source', useDefaultExcludes: false
53
- }
54
- }
55
- stage('Test') {
56
- options { skipDefaultCheckout() }
57
- steps {
58
- runTests('.ci/.jenkins_framework.yml')
59
- }
60
- }
61
- stage('Master Test') {
62
- options { skipDefaultCheckout() }
63
- steps {
64
- catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE', message: "The tests for the master framework have failed. Let's warn instead.") {
65
- runTests('.ci/.jenkins_master_framework.yml')
66
- }
67
- }
68
- }
69
- }
70
- post {
71
- cleanup {
72
- script{
73
- if(rubyTasksGen?.results){
74
- writeJSON(file: 'results.json', json: toJSON(rubyTasksGen.results), pretty: 2)
75
- def mapResults = ["Ruby": rubyTasksGen.results]
76
- def processor = new ResultsProcessor()
77
- processor.processResults(mapResults)
78
- archiveArtifacts allowEmptyArchive: true, artifacts: 'results.json,results.html', defaultExcludes: false
79
- catchError(buildResult: 'SUCCESS') {
80
- def datafile = readFile(file: "results.json")
81
- def json = getVaultSecret(secret: 'secret/apm-team/ci/jenkins-stats-cloud')
82
- sendDataToElasticsearch(es: json.data.url, data: datafile, restCall: '/jenkins-builds-ruby-test-results/_doc/')
83
- }
84
- }
85
- }
86
- notifyBuildResult()
87
- }
88
- }
89
- }
90
-
91
- /**
92
- Parallel task generator for the integration tests.
93
- */
94
- class RubyParallelTaskGenerator extends DefaultParallelTaskGenerator {
95
-
96
- public RubyParallelTaskGenerator(Map params){
97
- super(params)
98
- }
99
-
100
- /**
101
- build a clousure that launch and agent and execute the corresponding test script,
102
- then store the results.
103
- */
104
- public Closure generateStep(x, y){
105
- return {
106
- steps.sleep steps.randomNumber(min:10, max: 30)
107
- steps.node('linux && immutable'){
108
- // Label is transformed to avoid using the internal docker registry in the x coordinate
109
- // TODO: def label = "${tag}:${x?.drop(x?.lastIndexOf('/')+1)}#${y}"
110
- def label = "${tag}:${x}#${y}"
111
- try {
112
- steps.runScript(label: label, ruby: x, framework: y)
113
- saveResult(x, y, 1)
114
- } catch(e){
115
- saveResult(x, y, 0)
116
- steps.error("${label} tests failed : ${e.toString()}\n")
117
- } finally {
118
- steps.junit(allowEmptyResults: true,
119
- keepLongStdio: true,
120
- testResults: "**/spec/junit-reports/**/ruby-agent-junit.xml")
121
- if (steps.isCodecovEnabled(x, y)) {
122
- steps.codecov(repo: "${steps.env.REPO}", basedir: "${steps.env.BASE_DIR}",
123
- secret: "${steps.env.CODECOV_SECRET}")
124
- }
125
- }
126
- }
127
- }
128
- }
129
- }
130
-
131
- /**
132
- Run tests for a Ruby version and framework version.
133
- */
134
- def runScript(Map params = [:]){
135
- def label = params.label
136
- def ruby = params.ruby
137
- def framework = params.framework
138
- log(level: 'INFO', text: "${label}")
139
- env.HOME = "${env.WORKSPACE}"
140
- env.PATH = "${env.PATH}:${env.WORKSPACE}/bin"
141
- deleteDir()
142
- unstash 'source'
143
- dir("${BASE_DIR}"){
144
- retry(2){
145
- sleep randomNumber(min:10, max: 30)
146
- dockerLogin(secret: "${DOCKER_SECRET}", registry: "${DOCKER_REGISTRY}")
147
- sh("./spec/scripts/spec.sh ${ruby} ${framework}")
148
- }
149
- }
150
- }
151
-
152
- /**
153
- * Whether the given ruby version and framework are in charge of sending the
154
- * codecov results. It does require the workspace.
155
- */
156
- def isCodecovEnabled(ruby, framework){
157
- dir(BASE_DIR){
158
- def codecovVersions = readYaml(file: '.ci/.jenkins_codecov.yml')
159
- return codecovVersions['ENABLED'].any { it.trim() == "${ruby?.trim()}#${framework?.trim()}" }
160
- }
161
- }
162
-
163
- /**
164
- Run all the tests for the given ruby version and file with the frameworks to test
165
- */
166
- def runTests(frameworkFile) {
167
- deleteDir()
168
- unstash "source"
169
- dir("${BASE_DIR}"){
170
- script {
171
- rubyTasksGen = new RubyParallelTaskGenerator(
172
- xVersions: [ "${params.RUBY_VERSION}" ],
173
- xKey: 'RUBY_VERSION',
174
- yKey: 'FRAMEWORK',
175
- yFile: frameworkFile,
176
- exclusionFile: '.ci/.jenkins_exclude.yml',
177
- tag: 'Ruby',
178
- name: 'Ruby',
179
- steps: this
180
- )
181
- def mapPatallelTasks = rubyTasksGen.generateParallelTests()
182
- parallel(mapPatallelTasks)
183
- }
184
- }
185
- }
@@ -1,24 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -exo pipefail
3
-
4
- # Enable git+ssh. Env variables are created on the fly with the gitCheckout
5
- git config remote.origin.url "git@github.com:${ORG_NAME}/${REPO_NAME}.git"
6
-
7
- # Enable to fetch branches when cloning with a detached and shallow clone
8
- git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
9
-
10
- # Force the git user details when pushing using the last commit details
11
- USER_MAIL=$(git log -1 --pretty=format:'%ae')
12
- USER_NAME=$(git log -1 --pretty=format:'%an')
13
- git config --global user.email "${USER_MAIL}"
14
- git config --global user.name "${USER_NAME}"
15
-
16
- # Checkout the branch as it's detached based by default.
17
- # See https://issues.jenkins-ci.org/browse/JENKINS-33171
18
- git fetch --all
19
- git checkout "${BRANCH_NAME}"
20
-
21
- # Ensure the master branch points to the original commit to avoid commit injection
22
- # when running the release pipeline.
23
- # used GIT_BASE_COMMIT instead GIT_COMMIT to support the MultiBranchPipelines.
24
- git reset --hard "${GIT_BASE_COMMIT}"
@@ -1,14 +0,0 @@
1
- name: Lint
2
-
3
- on: [push]
4
-
5
- jobs:
6
- build:
7
- name: Rubocop
8
- runs-on: ubuntu-latest
9
- steps:
10
- - uses: actions/checkout@v1
11
- - name: Rubocop checks
12
- uses: mikker/rubocop-action@master
13
- env:
14
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -1 +0,0 @@
1
- Release notes are now available in our documentation at ([elastic.co](https://www.elastic.co/guide/en/apm/agent/ruby/current/release-notes.html))