gitlab-exporter 11.18.2 → 11.19.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5bb85649c03d72472315136401ebb234618c2350a5e75e5f426619aed2c97286
4
- data.tar.gz: f0f0f46b1cbfea992e7b171ed7a1877af7c232a5e0e1a549666d5086d8e72087
3
+ metadata.gz: 386af9238448d41f015fd10a4ae29d4e6b42913078cb0d86cbb862909bc2b7e0
4
+ data.tar.gz: 98e064fe309955646d3879528743528646b1bb57122a5237660b7be772cac359
5
5
  SHA512:
6
- metadata.gz: ed4f5b1dfa84d713c4c2246fa3e77ca604fe49d616d11f0ddc6cf80d1a5d87bc79f62115e4abec9e7d18ef1f50b5f6a654a329d9477464c83f3884cbb06d960f
7
- data.tar.gz: c10bb0f6452deff8a9f7615a8d7379d30e1c9cc428b50b8092f5f007db87b97ac12c6567b8db75f321a0c749686329931b6fa49ab2e1e63ae335b85341b5ee7b
6
+ metadata.gz: 415c5e84efdc17ebd72e7bc870fba4bb0f0052992390737c8d6cc64e397185f92f4deb3ffd6809700ea308719ad00061cafd44bd7c30f224144b4a5eec0926df
7
+ data.tar.gz: 740a3e32681f861ad5503b7605f2de60cef9a99d8fa64b2530c0aa5599462dce67fddbb1b4312fbd316881915d207d762e1d88215cbdf7f20d7cc7d20aa56897
data/.gitlab-ci.yml CHANGED
@@ -43,8 +43,19 @@ rspec:
43
43
  before_script: *before_scripts
44
44
  parallel:
45
45
  matrix:
46
- - RUBY_VERSION: "2.7"
47
- - RUBY_VERSION: "3.0"
46
+ - RUBY_VERSION: ["2.7", "3.0"]
47
+
48
+ rspec_integration:
49
+ script:
50
+ - bundle exec rspec spec -t integration -f d -c
51
+ before_script: *before_scripts
52
+ services:
53
+ - redis:latest
54
+ variables:
55
+ REDIS_URL: "redis://redis"
56
+ parallel:
57
+ matrix:
58
+ - RUBY_VERSION: ["2.7", "3.0"]
48
59
 
49
60
  rubocop:
50
61
  script:
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-exporter (11.18.2)
4
+ gitlab-exporter (11.19.0)
5
5
  connection_pool (= 2.2.5)
6
6
  faraday (~> 1.8.0)
7
7
  pg (= 1.2.3)
8
8
  puma (= 5.6.5)
9
9
  quantile (= 0.2.1)
10
10
  redis (= 4.4.0)
11
- redis-namespace (= 1.6.0)
11
+ redis-namespace (= 1.9.0)
12
12
  sidekiq (= 6.4.0)
13
13
  sinatra (~> 2.2.0)
14
14
 
@@ -53,8 +53,8 @@ GEM
53
53
  rack
54
54
  rainbow (3.0.0)
55
55
  redis (4.4.0)
56
- redis-namespace (1.6.0)
57
- redis (>= 3.0.4)
56
+ redis-namespace (1.9.0)
57
+ redis (>= 4)
58
58
  regexp_parser (2.0.3)
59
59
  rexml (3.2.4)
60
60
  rspec (3.7.0)
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  s.add_runtime_dependency "puma", "5.6.5"
27
27
  s.add_runtime_dependency "quantile", "0.2.1"
28
28
  s.add_runtime_dependency "redis", "4.4.0"
29
- s.add_runtime_dependency "redis-namespace", "1.6.0"
29
+ s.add_runtime_dependency "redis-namespace", "1.9.0"
30
30
  s.add_runtime_dependency "sidekiq", "6.4.0"
31
31
  s.add_runtime_dependency "sinatra", "~> 2.2.0"
32
32
 
@@ -1,5 +1,5 @@
1
1
  module GitLab
2
2
  module Exporter
3
- VERSION = "11.18.2".freeze
3
+ VERSION = "11.19.0".freeze
4
4
  end
5
5
  end
@@ -2,7 +2,6 @@ require "sinatra/base"
2
2
  require "English"
3
3
  require "cgi"
4
4
 
5
- require_relative "rack_vulndb_255039_patch"
6
5
  require_relative "tls_helper"
7
6
 
8
7
  module GitLab
@@ -0,0 +1,20 @@
1
+ require "spec_helper"
2
+ require "gitlab_exporter/cli"
3
+
4
+ module GitLab
5
+ module Exporter
6
+ module CLI
7
+ describe SidekiqRunner, :integration do
8
+ let(:redis_url) { ENV.fetch("REDIS_URL", "redis://localhost:6379") }
9
+ let(:io) { StringIO.new }
10
+
11
+ it "can properly reach out to redis" do
12
+ args = CLIArgs.new([io], options: { /^--redis-url/ => redis_url })
13
+ runner = SidekiqRunner.new(args)
14
+
15
+ expect { runner.run }.not_to raise_error
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
data/spec/spec_helper.rb CHANGED
@@ -7,6 +7,10 @@ require "tmpdir"
7
7
  $LOAD_PATH.unshift File.expand_path(".")
8
8
  Dir["spec/support/**/*.rb"].each do |f| require f end
9
9
 
10
+ RSpec.configure do |config|
11
+ config.filter_run_excluding integration: true
12
+ end
13
+
10
14
  class GitRepoBuilder
11
15
  def origin
12
16
  @origin ||= create_origin
@@ -41,19 +45,30 @@ class GitRepoBuilder
41
45
  end
42
46
 
43
47
  class CLIArgs
44
- def initialize(args)
48
+ def initialize(args, options: {})
45
49
  @arguments = args
50
+ @options = options
46
51
  end
47
52
 
48
53
  def options
49
54
  yield self
55
+
56
+ self
50
57
  end
51
58
 
52
- def on(*args); end
59
+ def on(flag, *_)
60
+ match = @options.find { |regex, _| regex.match?(flag) }
61
+
62
+ yield match[1] if match
63
+ end
53
64
 
54
65
  def banner=(banner); end
55
66
 
56
67
  def parse!
57
68
  @arguments
58
69
  end
70
+
71
+ def shift
72
+ @arguments.shift
73
+ end
59
74
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-exporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.18.2
4
+ version: 11.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pablo Carranza
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 1.6.0
103
+ version: 1.9.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 1.6.0
110
+ version: 1.9.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: sidekiq
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -202,7 +202,6 @@ files:
202
202
  - lib/gitlab_exporter/prober.rb
203
203
  - lib/gitlab_exporter/process.rb
204
204
  - lib/gitlab_exporter/prometheus.rb
205
- - lib/gitlab_exporter/rack_vulndb_255039_patch.rb
206
205
  - lib/gitlab_exporter/ruby.rb
207
206
  - lib/gitlab_exporter/sidekiq.rb
208
207
  - lib/gitlab_exporter/tls_helper.rb
@@ -217,6 +216,7 @@ files:
217
216
  - spec/fixtures/smaps/sample.txt
218
217
  - spec/git_process_proper_spec.rb
219
218
  - spec/git_spec.rb
219
+ - spec/integration/cli_spec.rb
220
220
  - spec/memstats_spec.rb
221
221
  - spec/prometheus_metrics_spec.rb
222
222
  - spec/ruby_spec.rb
@@ -254,6 +254,7 @@ test_files:
254
254
  - spec/fixtures/smaps/sample.txt
255
255
  - spec/git_process_proper_spec.rb
256
256
  - spec/git_spec.rb
257
+ - spec/integration/cli_spec.rb
257
258
  - spec/memstats_spec.rb
258
259
  - spec/prometheus_metrics_spec.rb
259
260
  - spec/ruby_spec.rb
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- if Gem.loaded_specs["rack"].version >= Gem::Version.new("3.0.0")
4
- fail <<~ERR
5
- This patch is unnecessary in Rack versions 3.0.0 or newer.
6
- Please remove this file and the associated spec.
7
-
8
- See https://github.com/rack/rack/blob/main/CHANGELOG.md#security (issue #1733)
9
- ERR
10
- end
11
-
12
- # Patches a cache poisoning attack vector in Rack by not allowing semicolons
13
- # to delimit query parameters.
14
- # See https://github.com/rack/rack/issues/1732.
15
- #
16
- # Solution is taken from the same issue.
17
- #
18
- # The actual patch is due for release in Rack 3.0.0.
19
- module Rack
20
- class Request # rubocop:disable Style/Documentation
21
- Helpers.module_eval do
22
- # rubocop: disable Naming/MethodName
23
- def GET
24
- if get_header(RACK_REQUEST_QUERY_STRING) == query_string
25
- get_header(RACK_REQUEST_QUERY_HASH)
26
- else
27
- query_hash = parse_query(query_string, "&") # only allow ampersand here
28
- set_header(RACK_REQUEST_QUERY_STRING, query_string)
29
- set_header(RACK_REQUEST_QUERY_HASH, query_hash)
30
- end
31
- end
32
- # rubocop: enable Naming/MethodName
33
- end
34
- end
35
- end