gitlab_quality-test_tooling 2.25.1 → 2.26.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: 2c4f4d94f6b20e886a63d66dfa3d5a83c3148157f5f6f1f9cd636584bc91725c
4
- data.tar.gz: 6364dc1082fa13c109bf69fafab81f8b80e6a9737a0d5b40a72e9f109fa5e282
3
+ metadata.gz: 125bc8b9a38435053e2e82849dd2a41c241d05d47784626234f01702c5619671
4
+ data.tar.gz: 56255580e30a0fd8896a456e4f079bea4a8de9c2a363d73263dc641f613df786
5
5
  SHA512:
6
- metadata.gz: d2116ba2746a0e91c3a299899c939b2c85cb70349c20174266ef4fb8ce5a4a09906af15b688a7fb3b3d5f7d19da8f387d3e58540a3c7ec253f4665fa406704c8
7
- data.tar.gz: 7ac75026422eaf93c582e0e09fc291bd111f83c55d13ea2fe0cb86446e84608303610003685826cdd8e8b83a01a029b42d934b082d55b013fc7bc7d5f6f9830b
6
+ metadata.gz: 041e97993894d0edc5d61c0e5e4c5bba688f81fdd92d6bec8d06e19787b3219daad4400d2aedc6c9da2a35e44f526bc8cc4960dce8016ad269f769be482c6ee5
7
+ data.tar.gz: eb2eef2912be06edf872af18ef1ff8ae1722462b694aa07f57f7a42e138ae8a0327aaa35914a778472e9104b9d08d407075026d2a48ac7ca9b0a5a9ad64944ad
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab_quality-test_tooling (2.25.1)
4
+ gitlab_quality-test_tooling (2.26.0)
5
5
  activesupport (>= 7.0, < 7.3)
6
6
  amatch (~> 0.4.1)
7
7
  fog-google (~> 1.24, >= 1.24.1)
@@ -9,6 +9,8 @@ module GitlabQuality
9
9
  class CategoryOwnersTable < GitlabQuality::TestTooling::CodeCoverage::ClickHouse::Table
10
10
  TABLE_NAME = "category_owners"
11
11
 
12
+ MissingMappingError = Class.new(StandardError)
13
+
12
14
  # Creates the ClickHouse table, if it doesn't exist already
13
15
  # @return [nil]
14
16
  def create
@@ -40,8 +42,24 @@ module GitlabQuality
40
42
  logger.info("#{LOG_PREFIX} Successfully truncated table #{full_table_name}")
41
43
  end
42
44
 
45
+ # Owners of particular category as group, stage and section
46
+ #
47
+ # @param category_name [String]
48
+ # @return [Hash]
49
+ def owners(category_name)
50
+ records.fetch(category_name)
51
+ rescue KeyError
52
+ raise(MissingMappingError, "Category '#{category_name}' not found in table '#{table_name}'")
53
+ end
54
+
43
55
  private
44
56
 
57
+ def records
58
+ @records ||= client
59
+ .query("SELECT category, group, stage, section FROM #{table_name}")
60
+ .each_with_object({}) { |record, hsh| hsh[record["category"]] = record.slice("group", "stage", "section") }
61
+ end
62
+
45
63
  # @return [Boolean] True if the record is valid, false otherwise
46
64
  def valid_record?(record)
47
65
  required_fields = %i[category group stage section]
@@ -67,7 +67,8 @@ module GitlabQuality
67
67
  ci_pipeline_id: env('CI_PIPELINE_ID')&.to_i,
68
68
  ci_merge_request_iid: (env('CI_MERGE_REQUEST_IID') || env('TOP_UPSTREAM_MERGE_REQUEST_IID'))&.to_i,
69
69
  ci_branch: env("CI_COMMIT_REF_NAME"),
70
- ci_target_branch: env("CI_MERGE_REQUEST_TARGET_BRANCH_NAME")
70
+ ci_target_branch: env("CI_MERGE_REQUEST_TARGET_BRANCH_NAME"),
71
+ ci_server_url: env("CI_SERVER_URL")
71
72
  }
72
73
  end
73
74
 
@@ -63,7 +63,7 @@ module GitlabQuality
63
63
  location String,
64
64
  quarantined Bool,
65
65
  test_retried Bool,
66
- feature_category LowCardinality(String) DEFAULT '',
66
+ feature_category LowCardinality(String) DEFAULT 'unknown',
67
67
  run_type LowCardinality(String) DEFAULT 'unknown',
68
68
  ci_project_id UInt32,
69
69
  ci_job_name LowCardinality(String),
@@ -73,6 +73,7 @@ module GitlabQuality
73
73
  ci_project_path LowCardinality(String),
74
74
  ci_branch String,
75
75
  ci_target_branch LowCardinality(String),
76
+ ci_server_url LowCardinality(String) DEFAULT 'https://gitlab.com',
76
77
  exception_class String DEFAULT '',
77
78
  failure_exception String DEFAULT ''
78
79
  )
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GitlabQuality
4
4
  module TestTooling
5
- VERSION = "2.25.1"
5
+ VERSION = "2.26.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_quality-test_tooling
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.25.1
4
+ version: 2.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab Quality
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-10-31 00:00:00.000000000 Z
11
+ date: 2025-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control