Stop writing ownership columns to test_file_mappings

What does this MR do and why?

The coverage export writes group, stage and section onto every row of shared.test_file_mappings. Those describe the feature category, not the mapping, and they change whenever stages.yml is reorganised. section and stage sit in the sort key, so a re-owned mapping is stored as a new row and the old one survives until the TTL expires it.

Emit only test_file, source_file and category, and compare only category when deciding what needs writing. Readers resolve the owner from shared.category_owners through category.

There is no re-insert burst. Neither side of the surviving comparison changed, so unchanged mappings are skipped exactly as before. Old rows convert gradually, as the three-month TTL expires them.

It also collapses a fork that exists today. 10.8M pairs flip-flop between a blank and a real category, which flips the sort key, so the two versions never merge. Once the owner columns are constant, they do.

Requires gitlab-com/runbooks!11425 (merged) merged and deployed first, since four dashboards read these columns today.

Related: gitlab-org/quality/analytics/team#789 (closed)

Verification

Full suite and whole-repo rubocop pass on the pinned Ruby 3.3.9: 1232 examples, 0 failures; 245 files, no offenses.

The read-back SQL is not something specs can prove, so I ran the exact statement against production: EXPLAIN header = 1 resolves all three columns, and executing it returns 17,786,168 rows against ~17,789,671 distinct pairs, one row per pair. A new spec pins the SELECT list, mutation-checked by re-adding group and confirming it fails.

Merge request reports

Loading
Loading