gitlab-org--gitlab-foss/app/services/projects
Douwe Maan 4e63411daa Merge branch 'adam-build-missing-services-when-necessary' into 'master'
Defer saving project services to the database if there are no user changes

## What does this MR do?

It defers saving project services to the database as long as it is possible. It creates a project service when creating a project only if this project service has an active template. After that project services are saved on the first edit.

## Are there points in the code the reviewer needs to double check?

- tests that used `build_missing_services` before the change
- number of queries executed

## Why was this MR needed?

Motivation in #22281

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

Fixes #22281

See merge request !6958
2016-11-16 16:27:54 +00:00
..
import_export squashed - added avatar saver/restorer and specs 2016-07-19 13:06:06 +02:00
autocomplete_service.rb Limit autocomplete to currently selected items 2016-11-15 21:41:40 +00:00
create_service.rb Defer saving project services to the database if there are no user changes 2016-11-16 12:46:07 +01:00
destroy_service.rb Before deleting project if forked unlink fork 2016-09-13 14:40:05 +02:00
download_service.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
enable_deploy_key_service.rb Namespace EnableDeployKeyService under Projects 2016-08-08 20:59:51 +02:00
fork_service.rb Enforce the fork_project permission in Projects::CreateService 2016-09-27 13:17:56 +01:00
housekeeping_service.rb Refine Git garbage collection 2016-11-04 14:30:11 +01:00
import_service.rb Check if repository already exists before trying to re-import it 2016-10-28 11:12:48 +02:00
participants_service.rb shows user avatar in mention autocomplete in editor 2016-11-16 00:03:24 +06:00
transfer_service.rb Recreates missing group labels when moving project to another group 2016-10-19 14:58:24 -02:00
unlink_fork_service.rb Fix incorrect variable name 2016-04-04 14:41:01 +00:00
update_service.rb Fix Project#to_param to keep invalid project suitable for use in URLs 2016-07-27 13:52:45 -03:00
upload_service.rb DRY up upload and download services 2016-01-08 17:38:53 +01:00