Update bulk_create method to also create metadata records
What does this MR do and why?
In order for us to deduplicate commit metadata from the merge_request_diff_commits table to the new merge_request_commits_metadata table, we need bulk creation logic to also create data on the new table. This applies to new MRDC records. A separate backfill migration will be done along when we start to partition MRDC table as well.
This is a temporary situation. Later on as we progress in implementing this deduplication approach, we will be removing the logic to write commit metadata on MRDC table.
This is behind merge_request_diff_commits_dedup feature flag.
References
https://gitlab.com/gitlab-org/gitlab/-/issues/527231
How to set up and validate locally
- Enable
merge_request_diff_commits_dedupfeature flag. - Create a MR.
- Add multiple commits to that MR.
- See the
Commitstab on the MR page and they should still display all commits. - Compare the
merge_request_diff_commitsandmerge_request_commits_metadatarecords of the MR and they should all have the same values for the following columns:commit_authorcommitterauthored_datecommitted_dateshamessagetrailers
-
merge_request_diff_commitsrecords should have appropriatemerge_request_commits_metadata_idset. -
merge_request_commits_metadatarecords should have appropriateproject_idset. This should be the project where the MR is created on.
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.