Stop populating p_ci_build_tags
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_modelto returnnil(only used in runner queries) - Updates
Gitlab::Ci::Tags::BulkInsert::BuildsTagsConfigurationto skip creating join records - Updates
Gitlab::Ci::Tags::BulkInsertto handleniljoin models gracefully - Updates tests to verify that
Ci::Tagrecords are created butCi::BuildTagjoin 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_listto job definitions) - Rollout FF: ci_stop_populating_p_ci_build_tags
- Blocks: #580302 (Drop
ci_build_tagstable) - Parent Epic: &18273 (CI storage optimization - Phase 4: further optimizations)
Screenshots or screen recordings
N/A
How to set up and validate locally
- Create a new CI pipeline with jobs that have tags
- Verify that
ci_build_tagstable is not being populated for new builds - Verify that
Ci::Tagrecords are still created correctly - Ensure that tag-based job filtering continues to work as expected (runner matching via
ci_job_definitions) - 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.