Bulk insert tags when creating CI pipelines
What does this MR do and why?
Related to #322386 (closed)
We're generating a lot of queries for each build to persist its tags. This tries to bulk insert all of them.
Screenshots or screen recordings
Before
Note: This can be a lot worse because we allow up to 50 tags for each job and tags
and taggings
are inserted 1 by 1:
- https://github.com/mbleigh/acts-as-taggable-on/blob/v7.0.0/lib/acts_as_taggable_on/taggable/core.rb#L273-L276
- https://github.com/mbleigh/acts-as-taggable-on/blob/4c49575fdfd938a33047ab6719ae6125d237110a/lib/acts_as_taggable_on/tag.rb#L74-L79
After
there are no tags
related queries between persisting the builds and there are only 2 queries at the end of the transaction to load the tags
from all the builds and one to insert the taggings
relationship.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Marius Bobin