diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-05 14:12:00 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-05 14:12:00 +0300 |
commit | d2d2df0738f3cd8311963c34d90ebc8ce4081aa6 (patch) | |
tree | d3f342088131b73b62eb0e5cf494693fd80e5557 /app/models | |
parent | 361dc3641dd28c4ecefbda94f7a8dad299c349aa (diff) |
Fix next round of tests
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/project_services/ci/hip_chat_message.rb | 9 | ||||
-rw-r--r-- | app/models/project_services/ci/slack_message.rb | 23 | ||||
-rw-r--r-- | app/models/project_services/gitlab_ci_service.rb | 2 |
3 files changed, 10 insertions, 24 deletions
diff --git a/app/models/project_services/ci/hip_chat_message.rb b/app/models/project_services/ci/hip_chat_message.rb index 73fdbe801c0..0bf448d47f2 100644 --- a/app/models/project_services/ci/hip_chat_message.rb +++ b/app/models/project_services/ci/hip_chat_message.rb @@ -11,14 +11,7 @@ module Ci def to_s lines = Array.new lines.push("<a href=\"#{ci_project_url(project)}\">#{project.name}</a> - ") - - if commit.matrix? - lines.push("<a href=\"#{ci_project_commits_url(project, commit.sha)}\">Commit ##{commit.id}</a></br>") - else - first_build = commit.builds_without_retry.first - lines.push("<a href=\"#{ci_project_build_url(project, first_build)}\">Build '#{first_build.name}' ##{first_build.id}</a></br>") - end - + lines.push("<a href=\"#{ci_project_commits_url(project, commit.sha)}\">Commit ##{commit.id}</a></br>") lines.push("#{commit.short_sha} #{commit.git_author_name} - #{commit.git_commit_message}</br>") lines.push("#{humanized_status(commit_status)} in #{commit.duration} second(s).") lines.join('') diff --git a/app/models/project_services/ci/slack_message.rb b/app/models/project_services/ci/slack_message.rb index 7d254836fb5..a89c01517b7 100644 --- a/app/models/project_services/ci/slack_message.rb +++ b/app/models/project_services/ci/slack_message.rb @@ -23,15 +23,13 @@ module Ci def attachments fields = [] - if commit.matrix? - commit.builds_without_retry.each do |build| - next if build.allow_failure? - next unless build.failed? - fields << { - title: build.name, - value: "Build <#{ci_project_build_url(project, build)}|\##{build.id}> failed in #{build.duration.to_i} second(s)." - } - end + commit.builds_without_retry.each do |build| + next if build.allow_failure? + next unless build.failed? + fields << { + title: build.name, + value: "Build <#{ci_project_build_url(project, build)}|\##{build.id}> failed in #{build.duration.to_i} second(s)." + } end [{ @@ -47,12 +45,7 @@ module Ci def attachment_message out = "<#{ci_project_url(project)}|#{project_name}>: " - if commit.matrix? - out << "Commit <#{ci_project_commits_url(project, commit.sha)}|\##{commit.id}> " - else - build = commit.builds_without_retry.first - out << "Build <#{ci_project_build_url(project, build)}|\##{build.id}> " - end + out << "Commit <#{ci_project_commits_url(project, commit.sha)}|\##{commit.id}> " out << "(<#{commit_sha_link}|#{commit.short_sha}>) " out << "of <#{commit_ref_link}|#{commit.ref}> " out << "by #{commit.git_author_name} " if commit.git_author_name diff --git a/app/models/project_services/gitlab_ci_service.rb b/app/models/project_services/gitlab_ci_service.rb index 8e2b395494e..17d1ef71945 100644 --- a/app/models/project_services/gitlab_ci_service.rb +++ b/app/models/project_services/gitlab_ci_service.rb @@ -52,7 +52,7 @@ class GitlabCiService < CiService ci_project = Ci::Project.find_by(gitlab_id: project.id) if ci_project - Ci::CreateCommitService.new.execute(ci_project, data, current_user) + Ci::CreateCommitService.new.execute(ci_project, current_user, data) end end |