Improve pipeline processing
What does this MR do?
This works on top of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5295 trying to solve some edge cases introduced by that Merge Request. The fix switches to a state machine which is already a part of
Ci::Pipeline and uses events with conditional transitions to switch between pipeline states.
This is approach is much more bullet proof and much easier to understand than a previous one where we were calling a
reload_status! which manually updated
status. Previous approach become confusing and prone to number of errors.
Why was this MR needed?
This improves changes introduced by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5295
What are the relevant issue numbers?
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
- CHANGELOG entry added (not needed since changelog for https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5295 is already introduced)
- Documentation created/updated
- API support added (not needed)
- Added for this feature/bug (most of tests do cover the triggering of Pipeline)
- All builds are passing
- Conform by the style guides
Branch has no merge conflicts with
master(if you do - rebase it please)
- Squashed related commits together