gitlab-labkit 0.16.2 → 0.17.1

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: db0f8ac56d95729fa2008c5b65bf1630137b99e977e09d1b5090b7a890c8f9a3
4
- data.tar.gz: 94c467fca0a2d54afde08588b34e01a46c3b0c62db8384cd84db125504949413
3
+ metadata.gz: 235f0b00e0d08d7ee809ae43736e0ce5c900c0c75d402028bfb1247df868f9ac
4
+ data.tar.gz: 759c4d7bd91c75aeb7bc2b737f55558c6426b32940a399cca982efebb7b1740f
5
5
  SHA512:
6
- metadata.gz: 9617b98e2e29783bb2b644da067283e3166e1b78298d34f853431a94a6f4da7a1f219315697d958d0b3ed66dae8eceb4b8a1df409397999c09b3b6030e288f9d
7
- data.tar.gz: 2dfc9f64306996c329795db9e5c463dfed0814fa1eb6430cd7bb788a0bc4ba757c70c9daeaf118f5d5efedbe829e4b393fffa2b95ebc88b035cbb2d58fee7633
6
+ metadata.gz: 42c83bbcdcb9c588a703400bd5d1830e426680e9d433a223026566d1417a7eb8000dec99530e2e9887935686938e6e2128c8953f44540ead950447c3a3d2b564
7
+ data.tar.gz: 9cd740e3bd04db453cf812b1efc71a6d5b516c875cfce4cfb0837660390c8457b86679c775f2d23b1dd373b59183255268340d710215d1f1bac5864fdf03c2f6
data/.gitlab-ci.yml CHANGED
@@ -1,3 +1,6 @@
1
+ default:
2
+ image: ruby:2.7
3
+
1
4
  workflow:
2
5
  rules:
3
6
  # For merge requests, create a pipeline.
@@ -22,9 +25,11 @@ test:2.6:
22
25
  image: ruby:2.6
23
26
  <<: *test_definition
24
27
 
25
- test:2.5:
26
- image: ruby:2.5
27
- <<: *test_definition
28
+ static-analysis:
29
+ before_script:
30
+ - bundle install
31
+ script:
32
+ - rake verify
28
33
 
29
34
  deploy:
30
35
  stage: deploy
data/.rubocop.yml CHANGED
@@ -1,8 +1,11 @@
1
- AllCops:
2
- TargetRubyVersion: 2.4
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ inherit_gem:
4
+ gitlab-styles:
5
+ - rubocop-default.yml
3
6
 
4
- require:
5
- - rubocop-rspec
7
+ AllCops:
8
+ TargetRubyVersion: 2.7
6
9
 
7
10
  Style/HashSyntax:
8
11
  EnforcedStyle: no_mixed_keys
@@ -28,11 +31,11 @@ Style/StringLiterals:
28
31
  Style/StringLiteralsInInterpolation:
29
32
  EnforcedStyle: double_quotes
30
33
 
31
- Style/UseLambda:
34
+ Style/Lambda:
32
35
  Enabled: false
33
36
 
34
- Layout/MultilineMethodCallIndentation:
35
- Enabled: No
37
+ Layout/LineLength:
38
+ Enabled: false
36
39
 
37
40
  Layout/SpaceInLambdaLiteral:
38
41
  Enabled: No
@@ -43,69 +46,6 @@ Layout/SpaceInsideBlockBraces:
43
46
  Layout/FirstParameterIndentation:
44
47
  Enabled: No
45
48
 
46
- Metrics/AbcSize:
47
- Enabled: true
48
- Max: 54.28
49
-
50
- Metrics/BlockLength:
51
- Enabled: false
52
-
53
- Metrics/BlockNesting:
54
- Enabled: true
55
- Max: 4
56
-
57
- Metrics/ClassLength:
58
- Enabled: false
59
-
60
- Metrics/CyclomaticComplexity:
61
- Enabled: true
62
- Max: 13
63
-
64
- Metrics/LineLength:
65
- Enabled: false
66
-
67
- Metrics/MethodLength:
68
- Enabled: false
69
-
70
- Metrics/ModuleLength:
71
- Enabled: false
72
-
73
- Metrics/ParameterLists:
74
- Enabled: true
75
- Max: 8
76
-
77
- Metrics/PerceivedComplexity:
78
- Enabled: true
79
- Max: 14
80
-
81
- RSpec/AnyInstance:
82
- Enabled: false
83
-
84
- RSpec/BeEql:
85
- Enabled: true
86
-
87
- RSpec/BeforeAfterAll:
88
- Enabled: false
89
-
90
- RSpec/DescribeClass:
91
- Enabled: false
92
-
93
- RSpec/DescribeMethod:
94
- Enabled: false
95
-
96
- RSpec/DescribeSymbol:
97
- Enabled: true
98
-
99
- RSpec/DescribedClass:
100
- Enabled: true
101
-
102
- RSpec/EmptyExampleGroup:
103
- Enabled: true
104
-
105
- RSpec/ExampleLength:
106
- Enabled: false
107
- Max: 5
108
-
109
49
  RSpec/ExampleWording:
110
50
  Enabled: false
111
51
  CustomTransform:
@@ -114,63 +54,9 @@ RSpec/ExampleWording:
114
54
  not: does not
115
55
  IgnoredWords: []
116
56
 
117
- RSpec/ExpectActual:
118
- Enabled: true
119
-
120
- RSpec/ExpectOutput:
57
+ Lint/HashCompareByIdentity: # (new in 0.93)
121
58
  Enabled: true
122
-
123
- RSpec/FilePath:
59
+ Lint/RedundantSafeNavigation: # (new in 0.93)
124
60
  Enabled: true
125
- IgnoreMethods: true
126
-
127
- RSpec/Focus:
128
- Enabled: true
129
-
130
- RSpec/HookArgument:
131
- Enabled: true
132
- EnforcedStyle: implicit
133
-
134
- RSpec/ImplicitExpect:
135
- Enabled: true
136
- EnforcedStyle: is_expected
137
-
138
- RSpec/InstanceVariable:
139
- Enabled: false
140
-
141
- RSpec/LeadingSubject:
142
- Enabled: false
143
-
144
- RSpec/LetSetup:
145
- Enabled: false
146
-
147
- RSpec/MessageChain:
148
- Enabled: false
149
-
150
- RSpec/MessageSpies:
151
- Enabled: false
152
-
153
- RSpec/MultipleDescribes:
154
- Enabled: false
155
-
156
- RSpec/MultipleExpectations:
157
- Enabled: false
158
-
159
- RSpec/NamedSubject:
160
- Enabled: false
161
-
162
- RSpec/NestedGroups:
163
- Enabled: false
164
-
165
- RSpec/NotToNot:
166
- EnforcedStyle: not_to
61
+ Style/ClassEqualityComparison: # (new in 0.93)
167
62
  Enabled: true
168
-
169
- RSpec/RepeatedDescription:
170
- Enabled: false
171
-
172
- RSpec/SubjectStub:
173
- Enabled: false
174
-
175
- RSpec/VerifiedDoubles:
176
- Enabled: false
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,238 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2021-04-18 00:00:00 UTC using RuboCop version 0.93.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 51
10
+ # Cop supports --auto-correct.
11
+ CodeReuse/ActiveRecord:
12
+ Exclude:
13
+ - 'spec/labkit/correlation/grpc/client_interceptor_spec.rb'
14
+ - 'spec/labkit/correlation/grpc/server_interceptor_spec.rb'
15
+ - 'spec/labkit/middleware/rack_spec.rb'
16
+ - 'spec/labkit/middleware/sidekiq/client_spec.rb'
17
+ - 'spec/labkit/middleware/sidekiq/context/server_spec.rb'
18
+ - 'spec/labkit/middleware/sidekiq/server_spec.rb'
19
+ - 'spec/labkit/middleware/sidekiq/tracing/client_spec.rb'
20
+ - 'spec/labkit/middleware/sidekiq/tracing/server_spec.rb'
21
+ - 'spec/labkit/tracing/factory_spec.rb'
22
+ - 'spec/labkit/tracing/grpc/client_interceptor_spec.rb'
23
+ - 'spec/labkit/tracing/grpc/server_interceptor_spec.rb'
24
+ - 'spec/labkit/tracing_spec.rb'
25
+ - 'spec/support/tracing/shared_examples.rb'
26
+
27
+ # Offense count: 1
28
+ # Configuration parameters: Include.
29
+ # Include: **/*.gemspec
30
+ Gemspec/RequiredRubyVersion:
31
+ Exclude:
32
+ - 'gitlab-labkit.gemspec'
33
+
34
+ # Offense count: 1
35
+ # Cop supports --auto-correct.
36
+ # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
37
+ # SupportedHashRocketStyles: key, separator, table
38
+ # SupportedColonStyles: key, separator, table
39
+ # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
40
+ Layout/HashAlignment:
41
+ Exclude:
42
+ - 'spec/labkit/context_spec.rb'
43
+
44
+ # Offense count: 1
45
+ Lint/BinaryOperatorWithIdenticalOperands:
46
+ Exclude:
47
+ - 'spec/labkit/tracing/redis/redis_interceptor_helper_spec.rb'
48
+
49
+ # Offense count: 4
50
+ Lint/ConstantDefinitionInBlock:
51
+ Exclude:
52
+ - 'spec/labkit/middleware/sidekiq/client_spec.rb'
53
+ - 'spec/labkit/middleware/sidekiq/context/client_spec.rb'
54
+ - 'spec/labkit/middleware/sidekiq/context/server_spec.rb'
55
+ - 'spec/labkit/middleware/sidekiq/server_spec.rb'
56
+
57
+ # Offense count: 1
58
+ # Cop supports --auto-correct.
59
+ # Configuration parameters: AllowedMethods.
60
+ # AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?
61
+ Lint/RedundantSafeNavigation:
62
+ Exclude:
63
+ - 'lib/labkit/tracing.rb'
64
+
65
+ # Offense count: 1
66
+ # Cop supports --auto-correct.
67
+ # Configuration parameters: PreferredName.
68
+ Naming/RescuedExceptionsVariableName:
69
+ Exclude:
70
+ - 'lib/labkit/logging/grpc/server_interceptor.rb'
71
+
72
+ # Offense count: 2
73
+ Performance/MethodObjectAsBlock:
74
+ Exclude:
75
+ - 'lib/labkit/context.rb'
76
+
77
+ # Offense count: 1
78
+ # Configuration parameters: Prefixes.
79
+ # Prefixes: when, with, without
80
+ RSpec/ContextWording:
81
+ Exclude:
82
+ - 'spec/labkit/middleware/sidekiq/server_spec.rb'
83
+
84
+ # Offense count: 3
85
+ # Cop supports --auto-correct.
86
+ # Configuration parameters: SkipBlocks, EnforcedStyle.
87
+ # SupportedStyles: described_class, explicit
88
+ RSpec/DescribedClass:
89
+ Exclude:
90
+ - 'spec/labkit/tracing_spec.rb'
91
+
92
+ # Offense count: 2
93
+ # Configuration parameters: CustomTransform, IgnoreMethods, SpecSuffixOnly.
94
+ RSpec/FilePath:
95
+ Exclude:
96
+ - 'spec/labkit/httpclient_publisher_spec.rb'
97
+ - 'spec/logging/sanitizer_spec.rb'
98
+
99
+ # Offense count: 3
100
+ # Cop supports --auto-correct.
101
+ # Configuration parameters: EnforcedStyle.
102
+ # SupportedStyles: single_line_only, single_statement_only, disallow
103
+ RSpec/ImplicitSubject:
104
+ Exclude:
105
+ - 'spec/labkit/correlation/correlation_id_spec.rb'
106
+
107
+ # Offense count: 4
108
+ RSpec/LeakyConstantDeclaration:
109
+ Exclude:
110
+ - 'spec/labkit/middleware/sidekiq/client_spec.rb'
111
+ - 'spec/labkit/middleware/sidekiq/context/client_spec.rb'
112
+ - 'spec/labkit/middleware/sidekiq/context/server_spec.rb'
113
+ - 'spec/labkit/middleware/sidekiq/server_spec.rb'
114
+
115
+ # Offense count: 2
116
+ # Cop supports --auto-correct.
117
+ RSpec/LetBeforeExamples:
118
+ Exclude:
119
+ - 'spec/labkit/tracing_spec.rb'
120
+
121
+ # Offense count: 18
122
+ # Configuration parameters: AllowSubject.
123
+ RSpec/MultipleMemoizedHelpers:
124
+ Max: 7
125
+
126
+ # Offense count: 15
127
+ # Cop supports --auto-correct.
128
+ RSpec/ScatteredLet:
129
+ Exclude:
130
+ - 'spec/labkit/excon_publisher_spec.rb'
131
+ - 'spec/labkit/httpclient_publisher_spec.rb'
132
+ - 'spec/labkit/net_http_publisher_spec.rb'
133
+
134
+ # Offense count: 1
135
+ # Cop supports --auto-correct.
136
+ Rails/NegateInclude:
137
+ Exclude:
138
+ - 'spec/labkit/correlation/grpc/client_interceptor_spec.rb'
139
+
140
+ # Offense count: 3
141
+ # Cop supports --auto-correct.
142
+ # Configuration parameters: Include.
143
+ # Include: **/Rakefile, **/*.rake
144
+ Rails/RakeEnvironment:
145
+ Exclude:
146
+ - 'lib/capistrano/tasks/**/*.rake'
147
+ - 'Rakefile'
148
+
149
+ # Offense count: 1
150
+ # Configuration parameters: AllowedChars.
151
+ Style/AsciiComments:
152
+ Exclude:
153
+ - 'spec/support/grpc_service/test_service_impl.rb'
154
+
155
+ # Offense count: 1
156
+ # Cop supports --auto-correct.
157
+ Style/CaseLikeIf:
158
+ Exclude:
159
+ - 'lib/labkit/excon_publisher.rb'
160
+
161
+ # Offense count: 23
162
+ # Cop supports --auto-correct.
163
+ Style/ExplicitBlockArgument:
164
+ Exclude:
165
+ - 'lib/labkit/correlation/grpc/server_interceptor.rb'
166
+ - 'lib/labkit/logging/grpc/server_interceptor.rb'
167
+ - 'lib/labkit/middleware/sidekiq/client.rb'
168
+ - 'lib/labkit/middleware/sidekiq/context/server.rb'
169
+ - 'lib/labkit/middleware/sidekiq/server.rb'
170
+ - 'lib/labkit/middleware/sidekiq/tracing/server.rb'
171
+ - 'lib/labkit/tracing/grpc/client_interceptor.rb'
172
+ - 'lib/labkit/tracing/grpc/server_interceptor.rb'
173
+ - 'lib/labkit/tracing/redis/redis_interceptor_helper.rb'
174
+
175
+ # Offense count: 8
176
+ # Cop supports --auto-correct.
177
+ # Configuration parameters: EnforcedStyle.
178
+ # SupportedStyles: always, always_true, never
179
+ Style/FrozenStringLiteralComment:
180
+ Exclude:
181
+ - 'spec/labkit/tracing/rails/active_record/sql_instrumenter_spec.rb'
182
+ - 'spec/labkit/tracing/rails/active_support/cache_delete_instrumenter_spec.rb'
183
+ - 'spec/labkit/tracing/rails/active_support/cache_fetch_hit_instrumenter_spec.rb'
184
+ - 'spec/labkit/tracing/rails/active_support/cache_generate_instrumenter_spec.rb'
185
+ - 'spec/labkit/tracing/rails/active_support/cache_read_instrumenter_spec.rb'
186
+ - 'spec/labkit/tracing/rails/active_support/cache_write_instrumenter_spec.rb'
187
+ - 'spec/support/grpc_service/test_pb.rb'
188
+ - 'tools/update-changelog.rb'
189
+
190
+ # Offense count: 2
191
+ # Cop supports --auto-correct.
192
+ Style/GlobalStdStream:
193
+ Exclude:
194
+ - 'lib/labkit/tracing/jaeger_factory.rb'
195
+
196
+ # Offense count: 3
197
+ # Cop supports --auto-correct.
198
+ # Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
199
+ # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
200
+ Style/HashSyntax:
201
+ Exclude:
202
+ - 'spec/labkit/excon_publisher_spec.rb'
203
+
204
+ # Offense count: 16
205
+ # Cop supports --auto-correct.
206
+ # Configuration parameters: PreferredDelimiters.
207
+ Style/PercentLiteralDelimiters:
208
+ Exclude:
209
+ - 'spec/labkit/tracing/redis/redis_interceptor_helper_spec.rb'
210
+
211
+ # Offense count: 2
212
+ # Cop supports --auto-correct.
213
+ Style/RedundantBegin:
214
+ Exclude:
215
+ - 'Rakefile'
216
+ - 'spec/labkit/net_http_publisher_spec.rb'
217
+
218
+ # Offense count: 1
219
+ # Cop supports --auto-correct.
220
+ Style/RedundantRegexpEscape:
221
+ Exclude:
222
+ - 'lib/labkit/logging/sanitizer.rb'
223
+
224
+ # Offense count: 1
225
+ # Cop supports --auto-correct.
226
+ Style/StringConcatenation:
227
+ Exclude:
228
+ - 'lib/labkit/tracing/redis/redis_interceptor_helper.rb'
229
+
230
+ # Offense count: 28
231
+ # Cop supports --auto-correct.
232
+ # Configuration parameters: EnforcedStyleForMultiline.
233
+ # SupportedStylesForMultiline: comma, consistent_comma, no_comma
234
+ Style/TrailingCommaInArrayLiteral:
235
+ Exclude:
236
+ - 'spec/labkit/excon_publisher_spec.rb'
237
+ - 'spec/labkit/httpclient_publisher_spec.rb'
238
+ - 'spec/labkit/net_http_publisher_spec.rb'
data/Rakefile CHANGED
@@ -9,7 +9,9 @@ begin
9
9
  end
10
10
 
11
11
  require "rubocop/rake_task"
12
- RuboCop::RakeTask.new
12
+ RuboCop::RakeTask.new(:rubocop) do |task|
13
+ task.options = %w[--parallel]
14
+ end
13
15
 
14
16
  desc "Alias for `rake rufo:run`"
15
17
  task :format => ["rufo:run"]
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec|tools)/}) }
18
18
  spec.require_paths = ["lib"]
19
- spec.required_ruby_version = ">= 2.4.0"
19
+ spec.required_ruby_version = ">= 2.6.0"
20
20
 
21
21
  # Please maintain alphabetical order for dependencies
22
22
  spec.add_runtime_dependency "actionpack", ">= 5.0.0", "< 7.0.0"
@@ -24,12 +24,13 @@ Gem::Specification.new do |spec|
24
24
  spec.add_runtime_dependency "grpc", "~> 1.19" # Be sure to update the "grpc-tools" dev_depenency too
25
25
  spec.add_runtime_dependency "jaeger-client", "~> 1.1"
26
26
  spec.add_runtime_dependency "opentracing", "~> 0.4"
27
- spec.add_runtime_dependency "pg_query", "~> 1.3"
27
+ spec.add_runtime_dependency "pg_query", "~> 2.0"
28
28
  spec.add_runtime_dependency "redis", ">3.0.0", "<5.0.0"
29
29
 
30
30
  # Please maintain alphabetical order for dev dependencies
31
31
  spec.add_development_dependency "excon", "~> 0.78.1"
32
32
  spec.add_development_dependency "faraday", "~> 1.2.0"
33
+ spec.add_development_dependency "gitlab-styles", "~> 6.2.0"
33
34
  spec.add_development_dependency "grpc-tools", "~> 1.19"
34
35
  spec.add_development_dependency "httparty", "~> 0.17.3"
35
36
  spec.add_development_dependency "httpclient", "~> 2.8.3"
@@ -37,10 +38,8 @@ Gem::Specification.new do |spec|
37
38
  spec.add_development_dependency "rack", "~> 2.0"
38
39
  spec.add_development_dependency "rake", "~> 12.3"
39
40
  spec.add_development_dependency "rest-client", "~> 2.1.0"
40
- spec.add_development_dependency "rspec", "~> 3.8.0"
41
+ spec.add_development_dependency "rspec", "~> 3.10.0"
41
42
  spec.add_development_dependency "rspec-parameterized", "~> 0.4"
42
- spec.add_development_dependency "rubocop", "~> 0.65.0"
43
- spec.add_development_dependency "rubocop-rspec", "~> 1.22.1"
44
43
  spec.add_development_dependency "rufo", "0.9.0"
45
44
  spec.add_development_dependency "sidekiq", "~> 5.2.7"
46
45
  end
data/lib/gitlab-labkit.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  # rubocop:disable Naming/FileName
2
2
  # frozen_string_literal: true
3
3
 
4
- require "active_support/all"
5
-
6
4
  # LabKit is a module for handling cross-project
7
5
  # infrastructural concerns, partcularly related to
8
6
  # observability.
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "active_support/core_ext/module/delegation"
4
+ require "active_support/core_ext/string/starts_ends_with"
5
+
3
6
  module Labkit
4
7
  # A context can be used to provide structured information on what resources
5
8
  # GitLab is working on within a service.
@@ -2,9 +2,8 @@
2
2
 
3
3
  # Disable the UnusedMethodArgument linter, since we need to declare the kwargs
4
4
  # in the methods, but we don't actually use them.
5
- # rubocop:disable Lint/UnusedMethodArgument
6
-
7
5
  require "grpc"
6
+ require "singleton"
8
7
 
9
8
  module Labkit
10
9
  module Correlation
@@ -48,5 +47,3 @@ module Labkit
48
47
  end
49
48
  end
50
49
  end
51
-
52
- # rubocop:enable Lint/UnusedMethodArgument
@@ -2,7 +2,6 @@
2
2
 
3
3
  # Disable the UnusedMethodArgument linter, since we need to declare the kwargs
4
4
  # in the methods, but we don't actually use them.
5
- # rubocop:disable Lint/UnusedMethodArgument
6
5
 
7
6
  require "grpc"
8
7
 
@@ -51,5 +50,3 @@ module Labkit
51
50
  end
52
51
  end
53
52
  end
54
-
55
- # rubocop:enable Lint/UnusedMethodArgument
@@ -99,10 +99,12 @@ module Labkit
99
99
  query: generate_query_string(datum[:query]),
100
100
  start_time: ::Labkit::System.monotonic_time,
101
101
  }
102
+
102
103
  unless datum[:proxy].nil?
103
104
  payload[:proxy_host] = datum[:proxy][:host]
104
105
  payload[:proxy_port] = datum[:proxy][:port]
105
106
  end
107
+
106
108
  payload
107
109
  end
108
110
 
@@ -133,7 +135,7 @@ module Labkit
133
135
 
134
136
  def nil_or_int(int)
135
137
  int&.to_i
136
- rescue
138
+ rescue StandardError
137
139
  nil
138
140
  end
139
141
 
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "active_support/time_with_zone"
4
+ require "active_support/values/time_zone"
3
5
  require "grpc"
4
6
  require "json"
5
7
 
@@ -19,9 +19,7 @@ module Labkit
19
19
 
20
20
  def self.sanitize_field(content)
21
21
  content = content.gsub(URL_REGEXP) { |url| mask_url(url) }
22
- content = content.gsub(SCP_URL_REGEXP) { |scp_url| mask_scp_url(scp_url) }
23
-
24
- content
22
+ content.gsub(SCP_URL_REGEXP) { |scp_url| mask_scp_url(scp_url) }
25
23
  end
26
24
 
27
25
  def self.sanitize_sql(sql)
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "active_support/all"
4
-
5
3
  module Labkit
6
4
  # Tracing provides distributed tracing functionality
7
5
  module Tracing
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "opentracing"
4
- require "active_support/all"
5
4
 
6
5
  module Labkit
7
6
  module Tracing
@@ -21,10 +21,12 @@ module Labkit
21
21
  "path" => payload[:path],
22
22
  "scheme" => payload[:scheme],
23
23
  }
24
+
24
25
  unless payload[:proxy_host].nil?
25
26
  tags["proxy_host"] = payload[:proxy_host]
26
27
  tags["proxy_port"] = payload[:proxy_port]
27
28
  end
29
+
28
30
  tags
29
31
  end
30
32
  end
@@ -2,9 +2,9 @@
2
2
 
3
3
  # Disable the UnusedMethodArgument linter, since we need to declare the kwargs
4
4
  # in the methods, but we don't actually use them.
5
- # rubocop:disable Lint/UnusedMethodArgument
6
5
  require "opentracing"
7
6
  require "grpc"
7
+ require "singleton"
8
8
 
9
9
  module Labkit
10
10
  module Tracing
@@ -45,5 +45,3 @@ module Labkit
45
45
  end
46
46
  end
47
47
  end
48
-
49
- # rubocop:enable Lint/UnusedMethodArgument
@@ -2,7 +2,6 @@
2
2
 
3
3
  # Disable the UnusedMethodArgument linter, since we need to declare the kwargs
4
4
  # in the methods, but we don't actually use them.
5
- # rubocop:disable Lint/UnusedMethodArgument
6
5
 
7
6
  require "opentracing"
8
7
  require "grpc"
@@ -60,5 +59,3 @@ module Labkit
60
59
  end
61
60
  end
62
61
  end
63
-
64
- # rubocop:enable Lint/UnusedMethodArgument
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "opentracing"
4
- require "active_support/all"
5
4
  require "action_dispatch"
6
5
 
7
6
  module Labkit
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "active_support/all"
3
+ require "active_support/concern"
4
+ require "active_support/notifications"
4
5
 
5
6
  module Labkit
6
7
  module Tracing
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "active_support/core_ext/string/starts_ends_with"
3
4
  require "opentracing"
4
5
 
5
6
  module Labkit
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-labkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.2
4
+ version: 0.17.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Newdigate
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-17 00:00:00.000000000 Z
11
+ date: 2021-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -98,14 +98,14 @@ dependencies:
98
98
  requirements:
99
99
  - - "~>"
100
100
  - !ruby/object:Gem::Version
101
- version: '1.3'
101
+ version: '2.0'
102
102
  type: :runtime
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
106
  - - "~>"
107
107
  - !ruby/object:Gem::Version
108
- version: '1.3'
108
+ version: '2.0'
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: redis
111
111
  requirement: !ruby/object:Gem::Requirement
@@ -154,6 +154,20 @@ dependencies:
154
154
  - - "~>"
155
155
  - !ruby/object:Gem::Version
156
156
  version: 1.2.0
157
+ - !ruby/object:Gem::Dependency
158
+ name: gitlab-styles
159
+ requirement: !ruby/object:Gem::Requirement
160
+ requirements:
161
+ - - "~>"
162
+ - !ruby/object:Gem::Version
163
+ version: 6.2.0
164
+ type: :development
165
+ prerelease: false
166
+ version_requirements: !ruby/object:Gem::Requirement
167
+ requirements:
168
+ - - "~>"
169
+ - !ruby/object:Gem::Version
170
+ version: 6.2.0
157
171
  - !ruby/object:Gem::Dependency
158
172
  name: grpc-tools
159
173
  requirement: !ruby/object:Gem::Requirement
@@ -258,14 +272,14 @@ dependencies:
258
272
  requirements:
259
273
  - - "~>"
260
274
  - !ruby/object:Gem::Version
261
- version: 3.8.0
275
+ version: 3.10.0
262
276
  type: :development
263
277
  prerelease: false
264
278
  version_requirements: !ruby/object:Gem::Requirement
265
279
  requirements:
266
280
  - - "~>"
267
281
  - !ruby/object:Gem::Version
268
- version: 3.8.0
282
+ version: 3.10.0
269
283
  - !ruby/object:Gem::Dependency
270
284
  name: rspec-parameterized
271
285
  requirement: !ruby/object:Gem::Requirement
@@ -280,34 +294,6 @@ dependencies:
280
294
  - - "~>"
281
295
  - !ruby/object:Gem::Version
282
296
  version: '0.4'
283
- - !ruby/object:Gem::Dependency
284
- name: rubocop
285
- requirement: !ruby/object:Gem::Requirement
286
- requirements:
287
- - - "~>"
288
- - !ruby/object:Gem::Version
289
- version: 0.65.0
290
- type: :development
291
- prerelease: false
292
- version_requirements: !ruby/object:Gem::Requirement
293
- requirements:
294
- - - "~>"
295
- - !ruby/object:Gem::Version
296
- version: 0.65.0
297
- - !ruby/object:Gem::Dependency
298
- name: rubocop-rspec
299
- requirement: !ruby/object:Gem::Requirement
300
- requirements:
301
- - - "~>"
302
- - !ruby/object:Gem::Version
303
- version: 1.22.1
304
- type: :development
305
- prerelease: false
306
- version_requirements: !ruby/object:Gem::Requirement
307
- requirements:
308
- - - "~>"
309
- - !ruby/object:Gem::Version
310
- version: 1.22.1
311
297
  - !ruby/object:Gem::Dependency
312
298
  name: rufo
313
299
  requirement: !ruby/object:Gem::Requirement
@@ -348,6 +334,7 @@ files:
348
334
  - ".gitlab/CODEOWNERS"
349
335
  - ".rspec"
350
336
  - ".rubocop.yml"
337
+ - ".rubocop_todo.yml"
351
338
  - ".ruby-version"
352
339
  - ".rufo"
353
340
  - Gemfile
@@ -428,14 +415,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
428
415
  requirements:
429
416
  - - ">="
430
417
  - !ruby/object:Gem::Version
431
- version: 2.4.0
418
+ version: 2.6.0
432
419
  required_rubygems_version: !ruby/object:Gem::Requirement
433
420
  requirements:
434
421
  - - ">="
435
422
  - !ruby/object:Gem::Version
436
423
  version: '0'
437
424
  requirements: []
438
- rubygems_version: 3.0.3
425
+ rubygems_version: 3.1.6
439
426
  signing_key:
440
427
  specification_version: 4
441
428
  summary: Instrumentation for GitLab