[PATCH v1 compass-ci] lib/mail_bisect_result: bisect email use new content

1. Add software name and first error message in subject 2. Add gcc version, error messages and job url in mail body Signed-off-by: Cao Xueliang <caoxl78320@163.com> --- lib/git_bisect.rb | 2 +- lib/mail_bisect_result.rb | 20 +++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/git_bisect.rb b/lib/git_bisect.rb index 189edb8..97ad467 100644 --- a/lib/git_bisect.rb +++ b/lib/git_bisect.rb @@ -95,7 +95,7 @@ class GitBisect error_messages = ErrorMessages.new(@build_pkg_dir).obtain_error_messages_by_errorid(@error_id) return Hash['repo' => @upstream_repo, 'commit' => first_bad_commit, - 'error_messages' => error_messages.join("\n")] + 'error_messages' => error_messages] end # first search the good commit in db diff --git a/lib/mail_bisect_result.rb b/lib/mail_bisect_result.rb index 5a208c4..c0a2731 100644 --- a/lib/mail_bisect_result.rb +++ b/lib/mail_bisect_result.rb @@ -19,23 +19,21 @@ class MailBisectResult end def compose_mail - subject = "[Compass-CI] #{@repo}.git: bisect result" + subject = "[Compass-CI][#{@repo.split('/')[1]}]: #{@error_messages[0]}" + job_url = "job url: #{ENV['SRV_HTTP_HOST']}:#{ENV['SRV_HTTP_PORT']}/#{ENV['result_root']}\n" ? ENV['result_root'] : '' body = <<~BODY Hi #{@git_commit.author_name}, - Bisect completed for + git url: #{@git_commit.url} + git commit: #{@commit_id[0..11]} ("#{@git_commit.subject}") - url: #{@git_commit.url} - - This is a bisect email from compass-ci. We met some problems when test with new commits. - Would you help to check what happend? - After submitting a job we noticed an error response due to the commit: - - commit: #{@commit_id[0..11]} ("#{@git_commit.subject}") + gcc version: 7.3.0 error_messages: - #{@error_messages} + #{@error_messages.join("\n")} - https://gitee.com/openeuler/compass-ci + #{job_url} + Regards, + Compass CI team BODY to = 'caoxl@crystal.ci' @hash = { 'to' => to, 'body' => body, 'subject' => subject } -- 2.23.0
participants (1)
-
Cao Xueliang