aboutsummaryrefslogtreecommitdiffstats
path: root/src/jenkins.rs
AgeCommit message (Collapse)Author
2017-11-08jenkins.rs: Add `job_for_commit`Teddy Wing
Fill in this function, which returns a boolean whether a given job matches a `CommitRef`. It does this based on the display name of the job. Needed to make the `Job` struct public in order to use it here.
2017-11-08jenkins.rs: Add `Job::new` function to create Job from JSON payloadTeddy Wing
Now we can parse the JSON payload in a single place and extract the values from it into a new `Job`. Change `Job.result`'s type to `JobStatus` because that makes more sense. Now, `result_from_job` gets called in `Job::new` to give us the `JobStatus` directly on the `Job`. Modify `result_from_job` to fit into its new responsibility, working for `Job::new`. Update the tests accordingly.
2017-11-08jenkins.rs: Add a `Job` typeTeddy Wing
This will avoid having to parse a job JSON payload multiple times. We should do the parsing once, extract the data we need, and pass the resulting struct around instead.
2017-11-08jenkins.rs: Add `update_commit_status` outlineTeddy Wing
Outline for the main function that will integrate everything here. It carries out the algorithm described at the top of the file. So far it's incomplete, but wanted to get the idea down in code somewhere. Also, this method might make more sense in a different module.
2017-11-08jenkins.rs: Add `result_from_job`Teddy Wing
This method will take a job JSON payload returned from the Jenkins API (http://jenkins/job/:project/:id/api/json), and return its status, success, failed, or pending. A new `JobStatus` type represents the status of jobs.
2017-11-07jenkins.rs: Add `get_jobs`, test HTTP requestTeddy Wing
Try making our first HTTP request to the Jenkins API. Use Basic authentication with our name and access token. The 'reqwest' format is based on https://doc.rust-lang.org/stable/std/string/struct.String.html Eventually this method should return a `Vec` of jobs, actually job URLs, but at least we know it works and gives us a 200.
2017-11-07jenkins.rs: Outline commit status update algorithmTeddy Wing
Comment and a rough interface definition describing how commit statuses should be updated and how Jenkins should be queried.
2017-11-07Add modules for GitHub and Jenkins interactionTeddy Wing
Empty stub modules that will be filled in with the communication code.