Normalize source paths before inserting test file mappings

What does this MR do and why?

The coverage exporter sent absolute CI build paths as source_file, which violate the table's valid_source_file_format constraint. ClickHouse evaluates that per insert, so it rejected the whole 100,000-row batch rather than the offending row, and Client#insert_json_data commits its clean batches before raising. Runs were writing partial exports with nothing marking the gap.

The exporter now strips the CI project directory prefix and any leading ./. It skips anything that still matches either half of the constraint, and anything that normalizes to nothing.

It also reports skipped paths once per run rather than once per record, and raises when a run loses every mapping. A CI_PROJECT_DIR that does not match the artifact drops everything, which would otherwise write 100,000 warn lines and then finish green against an empty insert.

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

Verification

Once this is released and bumped in gitlab-org/gitlab, Code 469 should stop appearing for shared.test_file_mappings in system.query_log, and per-run row counts should stop landing on exact multiples of 100,000.

Merge request reports

Loading
Loading