We should show the upstream url in the bisect report, but the git url is our git server url, so, replace git url to the upstream url.
Signed-off-by: Cao Xueliang caoxl78320@163.com --- lib/git_bisect.rb | 8 ++++++++ lib/mail_bisect_result.rb | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/lib/git_bisect.rb b/lib/git_bisect.rb index 5d13074..40f6b49 100644 --- a/lib/git_bisect.rb +++ b/lib/git_bisect.rb @@ -23,6 +23,7 @@ class GitBisect set_build_pkg_dir set_upstream set_pkgbuild_repo + set_upstream_url set_work_dir set_bad_commit set_good_commit @@ -56,6 +57,12 @@ class GitBisect @upstream_repo_git = "git://#{GIT_MIRROR_HOST}/#{@upstream_repo}" end
+ def set_upstream_url + @upstream_url = @bad_job['upstream_url'] + puts "upstream_url: #{@upstream_url}" + raise 'upstream url is null' unless @upstream_url + end + def set_work_dir @work_dir = Utils.clone_repo(@upstream_repo_git, @upstream_commit) puts "work_dir: #{@work_dir}" @@ -106,6 +113,7 @@ class GitBisect 'work_dir' => @work_dir, 'bisect_error' => bisect_error, 'all_errors' => all_errors, + 'upstream_url' => @upstream_url 'pkgbuild_repo' => @pkgbuild_repo, 'first_bad_commit_result_root' => first_bad_commit_result_root] end diff --git a/lib/mail_bisect_result.rb b/lib/mail_bisect_result.rb index 637c008..5e1103c 100644 --- a/lib/mail_bisect_result.rb +++ b/lib/mail_bisect_result.rb @@ -16,6 +16,7 @@ class MailBisectResult @commit_id = bisect_info['commit'] @all_errors = bisect_info['all_errors'] @bisect_error = bisect_info['bisect_error'] + @upstream_url = bisect_info['upstream_url'] @pkgbuild_repo = bisect_info['pkgbuild_repo'] @first_bad_commit_result_root = bisect_info['first_bad_commit_result_root'] @git_commit = GitCommit.new(@work_dir, @commit_id) @@ -46,7 +47,7 @@ class MailBisectResult Hi #{@git_commit.author_name},
We found some error/warning(s) and the first bad commit in the below project: - git url: #{@git_commit.url} + git url: #{@upstream_url/@commit_id} git commit: #{@commit_id} ("#{@git_commit.subject}")
All error/warning(s) (new ones prefixed by >>):