7e9b41896d
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 |
||
---|---|---|
.. | ||
ci | ||
concerns | ||
hooks | ||
members | ||
project_services | ||
ability_spec.rb | ||
abuse_report_spec.rb | ||
appearance_spec.rb | ||
application_setting_spec.rb | ||
award_emoji_spec.rb | ||
blob_spec.rb | ||
broadcast_message_spec.rb | ||
build_spec.rb | ||
commit_range_spec.rb | ||
commit_spec.rb | ||
commit_status_spec.rb | ||
compare_spec.rb | ||
deploy_key_spec.rb | ||
deploy_keys_project_spec.rb | ||
deployment_spec.rb | ||
diff_note_spec.rb | ||
email_spec.rb | ||
environment_spec.rb | ||
event_spec.rb | ||
external_issue_spec.rb | ||
forked_project_link_spec.rb | ||
generic_commit_status_spec.rb | ||
global_milestone_spec.rb | ||
group_spec.rb | ||
identity_spec.rb | ||
issue_spec.rb | ||
key_spec.rb | ||
label_link_spec.rb | ||
label_spec.rb | ||
legacy_diff_note_spec.rb | ||
member_spec.rb | ||
merge_request_diff_spec.rb | ||
merge_request_spec.rb | ||
milestone_spec.rb | ||
namespace_spec.rb | ||
note_spec.rb | ||
notification_setting_spec.rb | ||
personal_access_token_spec.rb | ||
project_group_link_spec.rb | ||
project_security_spec.rb | ||
project_snippet_spec.rb | ||
project_spec.rb | ||
project_team_spec.rb | ||
project_wiki_spec.rb | ||
protected_branch_spec.rb | ||
release_spec.rb | ||
repository_spec.rb | ||
service_spec.rb | ||
snippet_spec.rb | ||
spam_log_spec.rb | ||
todo_spec.rb | ||
tree_spec.rb | ||
user_spec.rb | ||
wiki_page_spec.rb |