Skip to content
Snippets Groups Projects

Refactor Ci::Commit and Ci::Build to have all builds for same :sha on single page

Merged Kamil Trzcińśki requested to merge refactor-build-service into master

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: Screen_Shot_2015-10-02_at_15.21.47

@dzaporozhets What do you think?

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • @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.

  • Kamil Trzcińśki Added 37 commits:

    Added 37 commits:

    • d6926b6a...0de7c83a - 35 commits from branch master
    • 546a3c65 - Refactor commit and build
    • 09bacdfd - Add user to Ci::Build to have pusher email address
  • Added 1 commit:

    • e3d870d7 - Add user to Ci::Build to have pusher email address
  • Kamil Trzcińśki Added 7 commits:

    Added 7 commits:

  • Kamil Trzcińśki Title changed from [WIP] Remove ref and push_data from ci_commit to [WIP] Refactor Ci::Commit and Ci::Build to have all builds for same :sha on single page

    Title changed from [WIP] Remove ref and push_data from ci_commit to [WIP] Refactor Ci::Commit and Ci::Build to have all builds for same :sha on single page

  • @dzaporozhets

    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.

  • Kamil Trzcińśki Added 2 commits:

    Added 2 commits:

  • @ayufan looks good. Merge when you finished it

  • Kamil Trzcińśki Added 4 commits:

    Added 4 commits:

    • c9853897 - Add stage tests
    • 29a7c679 - Fix GitLabCiService and remove ci_yaml_file from CI push data
    • 517815f4 - Fix gitlab_ci_yaml_processor specs
    • 06cdea86 - Fix create_trigger_request_service_spec
  • Reassigned to @ayufan

  • Kamil Trzcińśki Title changed from [WIP] Refactor Ci::Commit and Ci::Build to have all builds for same :sha on single page to Refactor Ci::Commit and Ci::Build to have all builds for same :sha on single page

    Title changed from [WIP] Refactor Ci::Commit and Ci::Build to have all builds for same :sha on single page to Refactor Ci::Commit and Ci::Build to have all builds for same :sha on single page

  • Added 1 commit:

    • 97a11136 - Fix create_trigger_request_service_spec
  • Kamil Trzcińśki Status changed to merged

    Status changed to merged

  • 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)
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading