From ad9537963fe3eb6589ecdec0c6f9f001a483f5e2 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 17 Nov 2017 01:33:26 +0100 Subject: find_and_track_build_and_update_status(): Send Jenkins console URL When adding a GitHub commit status, instead of using the job "home" URL, use the URL of its "Console" page. This page shows the build log and is much more useful than the other one. If there's a build failure in particular, you'd be going to this page anyway to see what the problem was, so using this `target_url` saves a click. --- src/jenkins.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/jenkins.rs b/src/jenkins.rs index 67e6c20..72d375e 100644 --- a/src/jenkins.rs +++ b/src/jenkins.rs @@ -127,11 +127,13 @@ pub fn find_and_track_build_and_update_status( let commit_status = job.result.commit_status(); + let job_console_url = jenkins_console_url_path(&job_url); + github::update_commit_status( &github_token, &commit_ref, &commit_status, - job_url.clone(), + job_console_url.clone(), None, "continuous-integration/jenkins".to_owned() ).expect( @@ -161,7 +163,7 @@ pub fn find_and_track_build_and_update_status( &github_token, &commit_ref, &github::CommitStatus::Error, - job_url.clone(), + job_console_url.clone(), Some("The status checker timed out.".to_owned()), "continuous-integration/jenkins".to_owned() ).expect( @@ -191,7 +193,7 @@ pub fn find_and_track_build_and_update_status( &github_token, &commit_ref, &updated_job.result.commit_status(), - job_url.clone(), + job_console_url.clone(), None, "continuous-integration/jenkins".to_owned() ).expect( -- cgit v1.2.3