Stop populating p_ci_build_tags

⚠️ This MR is based on the pedropombeiro/569119/fix-tags-access branch, please change to master before merging ⚠️

What does this MR do and why?

This MR stops populating the p_ci_build_tags join table while continuing to populate the tags cell-local accelerant table (via Ci::Tag). This is part of the CI storage optimization effort to reduce database growth. It is behind the ci_stop_populating_p_ci_build_tags FF

Now that the ci_build_uses_job_definition_tag_list feature flag has been removed (in the parent MR), we can safely stop creating join records in p_ci_build_tags since all tag lookups use p_ci_job_definitions.

Changes:

  • Updates Ci::Build#taggings_join_model to return nil (only used in runner queries)
  • Updates Gitlab::Ci::Tags::BulkInsert::BuildsTagsConfiguration to skip creating join records
  • Updates Gitlab::Ci::Tags::BulkInsert to handle nil join models gracefully
  • Updates tests to verify that Ci::Tag records are created but Ci::BuildTag join records are not

References

Closes #580301

Related:

  • Blocked by: #579692 (closed) ([FF] ci_build_uses_job_definition_tag_list)
  • Blocked by: #569119 (closed) (Switch usage of tag_list to job definitions)
  • Rollout FF: ci_stop_populating_p_ci_build_tags
  • Blocks: #580302 (Drop ci_build_tags table)
  • Parent Epic: &18273 (CI storage optimization - Phase 4: further optimizations)

Screenshots or screen recordings

N/A

How to set up and validate locally

  1. Create a new CI pipeline with jobs that have tags
  2. Verify that ci_build_tags table is not being populated for new builds
  3. Verify that Ci::Tag records are still created correctly
  4. Ensure that tag-based job filtering continues to work as expected (runner matching via ci_job_definitions)
  5. Run the updated specs to verify behavior

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Pedro Pombeiro

Merge request reports

Loading