Refactor Ci::Commit and Ci::Build to have all builds for same :sha on single page
This makes Ci::Commit to have only :sha and simplifies routing to have only :sha in path. The :ref and :push_data is now parameter of Ci::Build.
All commit related data (git author, message and .gitlab-ci.yml) is read directly from repository.
All code related for creating builds is moved to CreateBuildsService.
Status deduction is rewritten to make if more efficient and easier to integrate with Commit Status API.
This is partially working, tests are not yet touched.
This slightly changes view of Commit:
@dzaporozhets What do you think?
Merge request reports
Activity
@ayufan looks good. With removed
push_data
it would be even better :)@dzaporozhets any concept how to fix the pusher_email? :)
@ayufan we can find out pusher email from
Event
table or pass just it to build model.Added 1 commit:
- e3d870d7 - Add user to Ci::Build to have pusher email address
It appeared to be quite big refactor, because of
push_data
removal. This did brake a lot of tests.Please take a look and let me know what do you think about it.
@ayufan looks good. Merge when you finished it
Reassigned to @ayufan
Added 1 commit:
- 97a11136 - Fix create_trigger_request_service_spec
mentioned in commit 3eef0e18
19 19 tag = origin_ref.start_with?('refs/tags/') 20 push_data = { 21 before: before_sha, 22 after: sha, 23 ref: ref, 24 user_name: params[:user_name], 25 user_email: params[:user_email], 26 repository: params[:repository], 27 commits: params[:commits], 28 total_commits_count: params[:total_commits_count], 29 ci_yaml_file: params[:ci_yaml_file] 30 } 31 32 20 commit = project.gl_project.ensure_ci_commit(sha) 33 21 commit.update_committed! 34 commit.create_builds(ref, tag, push_data) bug of before_sha = null #3537 (moved)