Skip to content

Build project services in DB only when necessary

Right now when you create a project and view the project settings, Project#build_missing_services is run each time, presumably because this gives you a list of all the available services for the project that need to be used.

This has a number of problems:

  1. We bloat our services table for unused entries
  2. Downgrading from EE -> CE requires removing EE-only services that may never have been used
  3. Updating services when their fields change incurs a huge performance penalty (as noted in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2572#note_15197436)
  4. This slows down the project creation

I think I remember @yorickpeterse or someone looking into this a while ago. Is there a reason we didn't go ahead and fix this?