aboutsummaryrefslogtreecommitdiffstats
path: root/src/github.rs
AgeCommit message (Collapse)Author
2017-11-09`update_commit_status`: Remove `organization_name` argumentTeddy Wing
Now that the organisation name (rather, owner of a GitHub project) is stored in `CommitRef`, we don't need to pass it in explicitly.
2017-11-09CommitRef: Add `owner` fieldTeddy Wing
This field stores the "owner" of the commit on GitHub, in other words, a user or organisation. Storing that information in this struct makes it easier to pass around.
2017-11-09github.rs: `update_commit_status` needs organisation nameTeddy Wing
I wasn't thinking straight in 26b74edece4546378c8a853cc70f7388f20ff0c6. Instead of taking a repo name, we need to take an organisation/user name. The repo name we already have from `commit_ref.repo`. We were missing the org to be able to properly construct the GitHub API URL. Pass `organization_name` name around from `find_and_track_build_and_update_status`.
2017-11-09github.rs: `update_commit_status` should take a repo nameTeddy Wing
Pass a repo name explicitly in an argument to the function. We now have the values we need to be able to properly construct a URL to POST to. Update our HTTP request to send the params as JSON and include the "Accept" header that GitHub recommends adding (https://developer.github.com/v3/#current-version) based on the code examples in https://docs.rs/reqwest/0.8.1/reqwest/header/struct.Accept.html#examples.
2017-11-08github.rs: Fix compilation errors from e0dca75f9b2de9023ecb978a0f9c8a11bTeddy Wing
* Import 'reqwest' * Import `HashMap` * Insert `state` as string instead of `CommitStatus` (implement `fmt::Display` in order to do this) * Insert `description` as string instead of `Option` * Make test string arguments owned strings
2017-11-08Add rough code for `update_commit_status`Teddy Wing
This new function will make a request to the GitHub REST API to update the status of a commit using the given arguments. * Create a new `github` module for this to live in. * Uses `mockito` to check that the request was made. * The `API_URL` is necessary in order to set up 'mockito' to work properly. That pattern is lifted from an example in the crate's docs: http://lipanski.github.io/mockito/generated/mockito/index.html#example * Sort of make a POST request to the GitHub API to update the status. This doesn't actually work, though, of course, as it's incomplete. For one thing, we haven't even included the 'reqwest' library, and for another we need a way to get the GitHub owner name to build the API URL.