gitlab_quality-test_tooling 3.21.2 → 3.21.3

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: 0ae21eb1d647c738006ae06faef24f5268d61fe30d0b72bd9aeebaa6b4b7d93e
4
- data.tar.gz: 934cd5bd6d0bdac314f7209d9fa212dafa4b14ec1daffb1f0dff77106bcbd0b0
3
+ metadata.gz: 200252eb5e20a931ca64bd835400572bc3f059428834a377fce3edce25cdfbfc
4
+ data.tar.gz: aa0a9707d616d5c8a86736ddada7f65721ffc7ea7f37b80ab69c41c1e62ec5c3
5
5
  SHA512:
6
- metadata.gz: 0b2c9ab4651163565cda4e146487bfa7ffec5b9e4d47a289431d4427926e35a8b92d81f759f6838169b2d2572a5fcac6c7c48fc9250cd572219f77a60f96e5aa
7
- data.tar.gz: 69479474c04e85f4ba6da8748af8d58fb7b85e7175ddae13c524fd2303f5e324af9c9d1dd9e07220509c52e107cb155545d0515ae4e49b9d75cb77df855a5a9b
6
+ metadata.gz: 439bd19bf631d9f9416acbefd77ae5ebad551ff2a06840527c2b5af0072d481b98cf89a42565e98165f2b78a2bfcf484f22826a202ce3b8f7cdaf4e19e48db14
7
+ data.tar.gz: 1af8b9ed7eee499fb9c9ac09d2a697da53e3d608944799070c7ec40e5078ff4c96bc7cf15b6487cedc7e3402e799c57f3448ebcbc71feb988a28184cdbc7fef6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab_quality-test_tooling (3.21.2)
4
+ gitlab_quality-test_tooling (3.21.3)
5
5
  activesupport (>= 7.0)
6
6
  amatch (~> 0.4.1)
7
7
  fog-google (~> 1.25)
@@ -15,8 +15,10 @@ module GitlabQuality
15
15
 
16
16
  KNOWN_UNOWNED = %w[shared not_owned tooling].freeze
17
17
 
18
- # SQL query to get the latest ownership record for each unique category+ownership combination
19
- # Partitions by the full composite key to handle cases where a category has multiple ownerships
18
+ # Every owner a category has ever had, including ones it has moved off, one row per
19
+ # distinct owner and in no particular order. Only `push` reads this, to skip rows it
20
+ # has already stored. Deduping to one row per category here would make it re-insert
21
+ # old owners on every run.
20
22
  LATEST_RECORDS_QUERY = <<~SQL
21
23
  SELECT category, group, stage, section
22
24
  FROM (
@@ -27,6 +29,18 @@ module GitlabQuality
27
29
  WHERE rn = 1
28
30
  SQL
29
31
 
32
+ # The current owner of each category, one row per category, which is what `owners`
33
+ # and `owner_records` serve to callers. The table keeps every past owner as well, so
34
+ # the newest timestamp is what picks the current one. The owner columns after the
35
+ # timestamp in the ORDER BY break ties, so two rows sharing a category's newest
36
+ # timestamp always resolve the same way.
37
+ LATEST_OWNERS_QUERY = <<~SQL
38
+ SELECT category, group, stage, section
39
+ FROM %{table_name}
40
+ ORDER BY category, timestamp DESC, group, stage, section
41
+ LIMIT 1 BY category
42
+ SQL
43
+
30
44
  # Insert only new category ownership records that don't already exist
31
45
  # This avoids needing TRUNCATE permission
32
46
  def push(data)
@@ -71,7 +85,7 @@ module GitlabQuality
71
85
  private
72
86
 
73
87
  def records
74
- @records ||= fetch_latest_records.each_with_object({}) do |record, hsh|
88
+ @records ||= fetch_latest_owners.each_with_object({}) do |record, hsh|
75
89
  hsh[record["category"]] = record.slice("group", "stage", "section")
76
90
  end
77
91
  end
@@ -114,6 +128,11 @@ module GitlabQuality
114
128
  client.query(query)
115
129
  end
116
130
 
131
+ def fetch_latest_owners
132
+ query = format(LATEST_OWNERS_QUERY, table_name: table_name)
133
+ client.query(query)
134
+ end
135
+
117
136
  def sanitized_data_record(record)
118
137
  {
119
138
  timestamp: time,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GitlabQuality
4
4
  module TestTooling
5
- VERSION = "3.21.2"
5
+ VERSION = "3.21.3"
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: 3.21.2
4
+ version: 3.21.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab Quality
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-09-01 00:00:00.000000000 Z
11
+ date: 2026-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control