Move webhook triggering to async worker
What does this MR do?
This MR moves build webhook triggering from an after_create callback to an async Sidekiq worker (Ci::ExecutePipelineBuildHooksWorker).
This is prep work for #588748. When we implement bulk insert using insert_all, callbacks will not fire. By moving webhook logic to an async worker now, we ensure webhooks continue to work correctly when bulk insert is implemented.
Current behavior: after_create callback triggers N ExecuteBuildHooksWorker jobs (one per build) with pre-constructed payloads during pipeline creation.
New behavior: One ExecutePipelineBuildHooksWorker job enqueued with pipeline_id, fetches all builds and constructs payloads asyn c.
Cleanup opportunity
Once this is fully rolled out and the feature flag is removed, we can delete the old Ci::ExecuteBuildHooksWorker entirely.
This is part of a sequence of MRs to fix long-running transactions:
-
!222881 (merged) - Move build tracking callbacks to
Chain::Metrics✅ - Follow-up: Move tracking to a worker: !224351 (merged) - in review
- Move webhook triggering to async worker
👈 YOU ARE HERE - Extract build_attributes_for_bulk_insert helper - in dev
- Implement bulk insert with insert_all