Age | Commit message (Collapse) | Author |
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
Comment and a rough interface definition describing how commit statuses
should be updated and how Jenkins should be queried.
|
|
Empty stub modules that will be filled in with the communication code.
|