truncate_build_names - confirm imported builds are excluded
From Fabio:
I was looking at https://gitlab.com/gitlab-org/gitlab/-/blob/7b97a918855dda8f940c34c7fb7672dea44521e8/ee/app/workers/ci/cleanup_build_name_worker.rb#L49 to understand how we implement retention policies for ci_build_names. It seems that the logic is based on the assumption that created_at and build id follow the same incremental pattern. While this is true for organic build creation, we recently noticed that ~8% of the jobs come from imports. In the case of imports we retain the original created_at but assign a new/recent id : https://gitlab.com/gitlab-com/gl-infra/capacity-planning-trackers/gitlab-com/-/issues/2442#note_2701175170So, for the cleanup of ci_build_names we might pick an old build (by created_at) which has a recent ID. Then we delete records where build_id is recent. Is this a problem based on how we expect to use ci_build_names?
https://gitlab.slack.com/archives/C0470TMUPBL/p1755792059055279