Fix creation of Ci::Commit object which can lead to pending, failed in some scenarios
What does this MR do?
If we use a new project.ci_commits
it will add it to array, and some other services which can do a save on a project can lead to a scenario when ci_commit
will be saved, where it should not be.
What are the relevant issue numbers?
https://gitlab.com/gitlab-com/support-forum/issues/717 https://gitlab.com/gitlab-com/support-forum/issues/715 https://gitlab.com/gitlab-org/gitlab-ce/issues/17596 https://gitlab.com/gitlab-com/support-forum/issues/714 https://gitlab.com/gitlab-org/gitlab-ce/issues/13402
cc @rymai