From a05849f435d72c342671c53ef6f1bd8b87ff25a7 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 9 Nov 2017 00:57:46 +0100 Subject: jenkins.rs: Take repo name in `find_and_track...` This function should take a repo name so we can pass that information to `get_jobs`, as well as `update_commit_status`. Also add types to the parameters which I apparently didn't think to do the first time. --- src/jenkins.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/jenkins.rs b/src/jenkins.rs index d87c508..b6a10a5 100644 --- a/src/jenkins.rs +++ b/src/jenkins.rs @@ -31,6 +31,7 @@ use self::reqwest::header::{Authorization, Basic}; use self::url::Url; use af83; +use github; use pull_request::CommitRef; #[cfg(not(test))] @@ -63,8 +64,11 @@ impl Job { } } -pub fn find_and_track_build_and_update_status(commit_ref) { - let jobs = get_jobs(); +pub fn find_and_track_build_and_update_status( + repo_name: String, + commit_ref: CommitRef +) { + let jobs = get_jobs(repo_name); for job_url in jobs { let job = request_job(job_url); @@ -75,6 +79,7 @@ pub fn find_and_track_build_and_update_status(commit_ref) { // Start timer github::update_commit_status( + repo_name, commit_ref, job.commit_status().result, job_url, -- cgit v1.2.3