gitlab-org--gitlab-foss/spec/models/project_services
Rémy Coutable 7e9b41896d Merge branch 'refactor-builds-creation-service' into 'master'
Refactor pipeline creation service

## What does this MR do?
This refactors GitLab CI build processing: all builds for pipeline are pre-created when a pipeline object is created. 
The builds are created with a new introduced status `created`.
The builds are then automatically promoted to `pending` when a previous stage do succeed.
This significantly simplifies pipeline processing code solving a lot of problems of lazily initialisation of previous approach (builds were created on-demand).

## Why was this MR needed?
The previous mechanism had a lot of flows (shown in related issues) in how it work, but also in code design. Removing cross model-service-library dependencies.

The current approach moves a build creation to single place `CreatePipelineService` and removes a dynamic dependency on `config_processor` significantly simplifying a build creation and pipeline processing. Pipeline processing is implemented in `ProcessPipelineService`.

This also allows to easily extend GitLab with Manual Actions which is part of 8.10 direction issue.

## Migration problem
~~This MR removes the a on-demand creation of builds in pipelines.
 Pipelines that are running and are in mid-stage (some stages started, but not all) will not be fully evaluated after application restart. 
This happens, because the code responsible for on-demand creation is removed. 
There's no easy way to migrate existing pipelines, other than doing offline migration and putting pipeline processing in migration code (which seems to be a really bad idea).~~

To support old pipelines I added a lazy initialization of builds if none is found.

## What are the relevant issue numbers?
Fixes: https://gitlab.com/gitlab-org/gitlab-ce/issues/12839
Solves: https://gitlab.com/gitlab-org/gitlab-ce/issues/18644 https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/289
Allows to easily implement: https://gitlab.com/gitlab-org/gitlab-ce/issues/17010

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [x] API support added
- Tests
  - [x] Added for this feature/bug
  - [ ] All builds are passing
- [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 you do - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)


See merge request !5295
2016-08-11 14:27:42 +00:00
..
slack_service adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
asana_service_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
assembla_service_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
bamboo_service_spec.rb Factorize duplicated code into a method in BambooService and update specs 2016-06-14 10:07:37 +02:00
bugzilla_service_spec.rb Added Bugzilla as external issue tracker option 2016-06-29 06:01:54 -04:00
buildkite_service_spec.rb Avoid describe-ing symbols in specs 2016-07-12 10:27:58 -05:00
builds_email_service_spec.rb Allow build email service to be tested 2016-07-15 20:38:27 -03:00
campfire_service_spec.rb Replace the tinder gem by bare HTTP requests 2016-08-11 08:52:13 +02:00
custom_issue_tracker_service_spec.rb Ensure URL in all Service subclasses are valid 2016-04-25 15:28:24 -04:00
drone_ci_service_spec.rb Ensure URL in all Service subclasses are valid 2016-04-25 15:28:24 -04:00
emails_on_push_service_spec.rb Ensure URL in all Service subclasses are valid 2016-04-25 15:28:24 -04:00
external_wiki_service_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
flowdock_service_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
gemnasium_service_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
gitlab_issue_tracker_service_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
hipchat_service_spec.rb Pre-create all builds for Pipeline when a trigger is received 2016-08-11 15:22:35 +02:00
irker_service_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
jira_service_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
pivotaltracker_service_spec.rb Ensure URL in all Service subclasses are valid 2016-04-25 15:28:24 -04:00
pushover_service_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
redmine_service_spec.rb Ensure URL in all Service subclasses are valid 2016-04-25 15:28:24 -04:00
slack_service_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
teamcity_service_spec.rb Fix broken URI joining for teamcity_url with suffixes 2016-06-14 10:07:37 +02:00