gitlab-exporter 7.0.4 → 7.0.5

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: 871a04f90ba88d0584d1378778d84fa495e3d258824ca5af41c89eddcc7f6d68
4
- data.tar.gz: d394f2f50050049ac4d1156ee6bfb79f5fcf422980989599afabf3eec4f2b210
3
+ metadata.gz: de89f0131cde7415ce666ec09c4da388b53f4cbf57b8e7872f3e5538be257e30
4
+ data.tar.gz: 4b84a64c0d3b26306628ec04dc2ce7b56b36eda349385a43855b1a968c2a8560
5
5
  SHA512:
6
- metadata.gz: 8f2fa49fd5423c9fcf0d47512949b8ec93d95b2c1b48e48693fe1ad273af8053cdae42392b48740bc925e4d8e701254f815089a25f1311c9ecdba7e139e5d3f8
7
- data.tar.gz: f9e8f5e8d42ba861bd297d0b0b9caae6b0729007ac3674fd637be7d091c8ca300cb0ff8cf6b084a07a7903e479381e2d58dceb770dfb829df585fd0d6395b6d8
6
+ metadata.gz: a292b9c5c4f24fab3014e6bc9ae5f3b86c86ff47d5034fce9280d1fa75372cbcd18e5d75a6e130c9de77fc662b1ef2fa6d1dd9f390a004236c727e311a9e02a3
7
+ data.tar.gz: 6f1309c2abeeeca930d0485d66b9b714006f1d97814141fba7f6a2b4db063ee41f0181857de0044435d8e3b14d10e844d2ed595a5ce2505fe63a02ef6abce466
@@ -26,3 +26,11 @@ rspec:
26
26
  rubocop:
27
27
  script:
28
28
  - bundle exec rubocop
29
+
30
+ include:
31
+ - template: Security/DAST.gitlab-ci.yml # https://gitlab.com/gitlab-org/gitlab-foss/blob/master/lib/gitlab/ci/templates/Security/DAST.gitlab-ci.yml
32
+ - template: Security/Container-Scanning.gitlab-ci.yml # https://gitlab.com/gitlab-org/gitlab-foss/blob/master/lib/gitlab/ci/templates/Security/Container-Scanning.gitlab-ci.yml
33
+ - template: Security/Dependency-Scanning.gitlab-ci.yml # https://gitlab.com/gitlab-org/gitlab-foss/blob/master/lib/gitlab/ci/templates/Security/Dependency-Scanning.gitlab-ci.yml
34
+ - template: Security/License-Scanning.gitlab-ci.yml # https://gitlab.com/gitlab-org/gitlab-foss/blob/master/lib/gitlab/ci/templates/Security/License-Scanning.gitlab-ci.yml
35
+ - template: Security/SAST.gitlab-ci.yml # https://gitlab.com/gitlab-org/gitlab-foss/blob/master/lib/gitlab/ci/templates/Security/SAST.gitlab-ci.yml
36
+
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-exporter (7.0.4)
4
+ gitlab-exporter (7.0.5)
5
5
  connection_pool (~> 2.2.1)
6
6
  pg (~> 1.1)
7
7
  quantile (~> 0.2.0)
@@ -16,18 +16,17 @@ GEM
16
16
  ast (2.4.0)
17
17
  connection_pool (2.2.2)
18
18
  diff-lcs (1.3)
19
- mustermann (1.1.1)
20
- ruby2_keywords (~> 0.0.1)
19
+ mustermann (1.0.3)
21
20
  parser (2.5.1.0)
22
21
  ast (~> 2.4.0)
23
- pg (1.2.3)
22
+ pg (1.2.2)
24
23
  powerpack (0.1.1)
25
24
  quantile (0.2.1)
26
- rack (2.0.9)
27
- rack-protection (2.0.8.1)
25
+ rack (2.0.7)
26
+ rack-protection (2.0.7)
28
27
  rack
29
28
  rainbow (2.1.0)
30
- redis (4.1.4)
29
+ redis (4.1.3)
31
30
  redis-namespace (1.6.0)
32
31
  redis (>= 3.0.4)
33
32
  rspec (3.7.0)
@@ -50,18 +49,17 @@ GEM
50
49
  ruby-progressbar (~> 1.7)
51
50
  unicode-display_width (~> 1.0, >= 1.0.1)
52
51
  ruby-progressbar (1.8.1)
53
- ruby2_keywords (0.0.2)
54
- sidekiq (5.2.8)
52
+ sidekiq (5.2.7)
55
53
  connection_pool (~> 2.2, >= 2.2.2)
56
- rack (< 2.1.0)
54
+ rack (>= 1.5.0)
57
55
  rack-protection (>= 1.5.0)
58
56
  redis (>= 3.3.5, < 5)
59
- sinatra (2.0.8.1)
57
+ sinatra (2.0.7)
60
58
  mustermann (~> 1.0)
61
59
  rack (~> 2.0)
62
- rack-protection (= 2.0.8.1)
60
+ rack-protection (= 2.0.7)
63
61
  tilt (~> 2.0)
64
- tilt (2.0.10)
62
+ tilt (2.0.9)
65
63
  unicode-display_width (1.6.0)
66
64
 
67
65
  PLATFORMS
@@ -144,9 +144,9 @@ module GitLab
144
144
  ci_builds.trigger_request_id
145
145
  SQL
146
146
 
147
- MIRROR_COLUMN_QUERY =
147
+ EE_CHECK_QUERY =
148
148
  <<~SQL.freeze
149
- SELECT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name='projects' AND column_name='mirror')
149
+ SELECT COUNT(*) FROM licenses
150
150
  SQL
151
151
 
152
152
  REPEATED_COMMANDS_QUERY_EE =
@@ -289,7 +289,7 @@ module GitLab
289
289
  def builds(status)
290
290
  results = []
291
291
 
292
- query = mirror_column? ? BUILDS_QUERY_EE : BUILDS_QUERY_CE
292
+ query = ee? ? BUILDS_QUERY_EE : BUILDS_QUERY_CE
293
293
  query = query % [status] # rubocop:disable Style/FormatString
294
294
  exec_query_with_custom_random_page_cost(query).each do |row|
295
295
  results << transform_builds_row_to_values(row)
@@ -318,7 +318,7 @@ module GitLab
318
318
  def per_runner_builds
319
319
  results = []
320
320
 
321
- query = mirror_column? ? PER_RUNNER_QUERY_EE : PER_RUNNER_QUERY_CE
321
+ query = ee? ? PER_RUNNER_QUERY_EE : PER_RUNNER_QUERY_CE
322
322
  exec_query_with_custom_random_page_cost(query).each do |row|
323
323
  results << transform_per_runners_builds_row_to_values(row)
324
324
  end
@@ -341,7 +341,7 @@ module GitLab
341
341
  def repeated_commands
342
342
  results = []
343
343
 
344
- query = mirror_column? ? REPEATED_COMMANDS_QUERY_EE : REPEATED_COMMANDS_QUERY_CE
344
+ query = ee? ? REPEATED_COMMANDS_QUERY_EE : REPEATED_COMMANDS_QUERY_CE
345
345
  query = query % [allowed_repeated_commands_count] # rubocop:disable Style/FormatString
346
346
  exec_query_with_custom_random_page_cost(query).each do |row|
347
347
  results << transform_repeated_commands_row_to_values(row)
@@ -406,11 +406,11 @@ module GitLab
406
406
  end
407
407
  end
408
408
 
409
- def mirror_column?
410
- @mirror_column ||=
409
+ def ee?
410
+ @ee ||=
411
411
  begin
412
412
  with_connection_pool do |conn|
413
- conn.exec(MIRROR_COLUMN_QUERY)[0]["exists"] == "t"
413
+ conn.exec(EE_CHECK_QUERY)[0]["count"].to_i > 0 # rubocop:disable Style/NumericPredicate
414
414
  end
415
415
  rescue PG::UndefinedColumn
416
416
  false
@@ -1,5 +1,5 @@
1
1
  module GitLab
2
2
  module Exporter
3
- VERSION = "7.0.4".freeze
3
+ VERSION = "7.0.5".freeze
4
4
  end
5
5
  end
@@ -9,7 +9,7 @@ describe GitLab::Exporter::Database do
9
9
  let(:stale_builds_query) { "SELECT NOT UPDATED RUNNING" }
10
10
  let(:per_runner_query_ee) { "SELECT ALL RUNNING PER RUNNER EE" }
11
11
  let(:per_runner_query_ce) { "SELECT ALL RUNNING PER RUNNER CE" }
12
- let(:mirror_column_query) { "SELECT DOES MIRROR COLUMN EXISTS" }
12
+ let(:ee_check_query) { "SELECT COUNT(*) FROM licenses" }
13
13
  let(:repeated_commands_query_ee) { "SELECT EE REPEATED COMNANDS %d" }
14
14
  let(:repeated_commands_query_ce) { "SELECT CE REPEATED COMNANDS %d" }
15
15
  let(:unarchived_traces_query) { "SELECT UNARCHIVED TRACES %s LIST" }
@@ -22,11 +22,11 @@ describe GitLab::Exporter::Database do
22
22
  let(:unarchived_traces_offset_minutes) { 60 }
23
23
 
24
24
  def stub_ee
25
- allow(connection).to receive(:exec).with(mirror_column_query).and_return([{ "exists" => "t" }])
25
+ allow(connection).to receive(:exec).with(ee_check_query).and_return([{ "count" => 1 }])
26
26
  end
27
27
 
28
28
  def stub_ce
29
- allow(connection).to receive(:exec).with(mirror_column_query).and_return([{ "exists" => "f" }])
29
+ allow(connection).to receive(:exec).with(ee_check_query).and_return([{ "count" => 0 }])
30
30
  end
31
31
 
32
32
  def builds_query_row_ee(shared_runners_enabled, status, namespace_id, has_minutes, count)
@@ -86,7 +86,7 @@ describe GitLab::Exporter::Database do
86
86
  stub_const("GitLab::Exporter::Database::CiBuildsCollector::STALE_BUILDS_QUERY", stale_builds_query)
87
87
  stub_const("GitLab::Exporter::Database::CiBuildsCollector::PER_RUNNER_QUERY_EE", per_runner_query_ee)
88
88
  stub_const("GitLab::Exporter::Database::CiBuildsCollector::PER_RUNNER_QUERY_CE", per_runner_query_ce)
89
- stub_const("GitLab::Exporter::Database::CiBuildsCollector::MIRROR_COLUMN_QUERY", mirror_column_query)
89
+ stub_const("GitLab::Exporter::Database::CiBuildsCollector::EE_CHECK_QUERY", ee_check_query)
90
90
  stub_const("GitLab::Exporter::Database::CiBuildsCollector::REPEATED_COMMANDS_QUERY_EE", repeated_commands_query_ee)
91
91
  stub_const("GitLab::Exporter::Database::CiBuildsCollector::REPEATED_COMMANDS_QUERY_CE", repeated_commands_query_ce)
92
92
  stub_const("GitLab::Exporter::Database::CiBuildsCollector::UNARCHIVED_TRACES_QUERY", unarchived_traces_query)
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: 7.0.4
4
+ version: 7.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pablo Carranza