- Support the "rename branch" API
- Fix pagination for GitHub Enterprise #247
- Fix jsonwebtoken auth support #264
- Fix compile error with httpcache cargo feature #270
- Add repository contributor statistics api (#272)
- patch release just to update crates.io readme
- BREAKING CHANGE: Migrate from old
futures
crate futures to std library futures making it possible to useasync
/await
with this library. This puts this library in better compatibility with the current rust async ecosystem. Please see the examples directory for updated examples of how to use these. #254 - BREAKING CHANGE: replace
error_chain
derived errors withstd::error::Error
implementingError
enum. The motivation is that the error crate ecosystem is a moving target. Thestd::error
package is not. This also makes for a smaller crate and smaller surface area. This moves away from errors of the formError(ErrorKind::Codec(_), _)
to errors of the formError::Codec(_)
- Add support for Content create and update apis #253
- Add description field to label apis #252
- Make status fields
created_at
,updated_at
andtarget_url
optional #250 #249 - Mask sensitive information in the
Debug
impl ofCredentials
type #261
- BREAKING CHANGE: upgrade to hyper 0.12 and replace
tokio-core
withtokio
#136
This simplifies interfaces for constructing instances as it removes the need to pass a borrowed Handle
around
before
let mut core = Core::new().expect("failed to initilaize core");
Github::new(
concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")),
Credentials::Token(token),
&core.handle(),
);
after
Github::new(
concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")),
Credentials::Token(token)
);
This allows clients to keep a local cache of response data to avoid the need to download responses when data hasn't changed This features is currently behind a feature flag until its stabalized.
You can find an example in this repo with
$ cargo run --no-default-features --features tls,httpcache --example conditional_requests
To enable this feature in your application dependencies add the following to you're Cargo.toml
file
[dependencies.hubcaps]
version = "0.5.0"
default-features = false
features = ["tls","httpcache"]
- add
pull_request
field to issue struct #156 - improve contents API #155
- implement repository contributors api #154
- add release helper methods to get
latest
release andrelease_by_tag
#147 - add optional rustls support
- added ability to post review comments #142
- added interfaces for notifications apis #146
github.repo("you", "repo")
.activity()
.notifications()
.list(&Default::default())
- added interfaces for traffic apis #145
github.repo("you", "repo")
.traffic()
.clones(TimeUnit::Day)
- added interfaces for getting the latest release and release by tag #147
github.repo("you", "repo")
.releases()
.latest()
- add the ability to delete a git ref (tag, branch ect)
github.repo("you", "repo")
.git()
.delete_reference("heads/awesome-feature")
- fixed bug with
hubcaps::search::IssueItem.repo_tuple()
- added assignee manage interfaces to pull request and issues interfaces
- deserialize issue assignees
github.repo("you", "repo")
.pulls()
.get(number)
.assignees()
.add(vec!["your-github-login"])
- introduced a minor ergonomic improvement in Github instance creation. Credentials
are now provided as
Into<Option<Credentials>>
meaning you no longer have to wrap credentials withSome(...)
when providing credentials
before
let github = Github::new(
"my-cool-user-agent/0.1.0",
Some(Credentials::Token("personal-access-token")),
&core.handle()
);
after
let github = Github::new(
"my-cool-user-agent/0.1.0",
Credentials::Token("personal-access-token"),
&core.handle()
);
- add support for pull request label deserialization and pull request issue interaction
github.repo("you", "repo")
.pulls()
.get(number)
.get()
.inspect(|&pull| println!("{:#?}",pull.labels))
...
github.repo("you", "repo")
.pulls()
.get(number)
.labels()
.add(vec!["enhancement"])
- add support for iterating over a stream of repo issues
github.repo(.., ..).issues().iter(opts)
- support anonymous gist owners #111
- fix issue with stream pagination #108
- implement stream iter for repo labels #110
- issue body is now an
Option<String>
type #107 - upgrade log dependency
0.3
=>0.4
- fixed url bug with language looking for repositories
- fixed url bug with iter based pagination
- introduce new ErrorKind::RateLimit error for better rate limit detection
- add transparent handling of 307 temporary redirect
- add transparent handling of 301 permanent moves for repo renames
- upgrade to async hyper (0.11)
- begin stars interface
Hyper 0.11's switch to async APIs had a major impact to the API design choices in this release. The following are the major notable changes
- interfaces that previously returned
hubcaps::Result
types now returnhubcaps::Future
types. The semantics are the same, the difference is that these map to async computed values. To learn more about Futures and Future combinators see this documentation hubcaps::Client
's associated methods for creating new interfaces got a facelift. Thehyper::Client
previously required for constructor methods is provided by default ( customization is still supported ) with a default tls connector. Atokio_core::reactor::Handle
reference is required in order to construct this client. The motivation is that its the application responsibility to manageCore
resources.iter
methods previously returnedIter
types which provided a way to iterate over elements of paginated collections. The analog to iterators in the async worldhubcaps::Stream
types which are akin to an iterator in which values are computed asynchronously. To learn more about Streams and Stream combinators see this documentation- Credentials are now provided as an Option type removing the need for Credential::None
- added users api interfaces @dpc
- org team description is now an Option type
- fixed response parsing for adding branch protection
- updated branches interface to reflect branch API changes
- added
SearchIssuesOptions.per_page(n)
interface for limiting search results
- fixed issue with persistence of repo term permission
- fixed PUT vs PATCH issue with repo team adds
- add ability to add team to repository
- add support for fetching a single repo by name
- add support for org repo creation
- add support for updating a repository branch's protection
- added
per_page
to various repo list builder interfaces - fixed org list builder's type filter to use org repo type
- hubcaps::git::GitFile's now have an optional url because commits types don't have urls.
- added git tree and blob fetching interfaces
- added org repos interface
- use error_chain to generate error types
- add support for posting issue comments #71
- add support for repo teams
- add team permissions
- add iter support to branches, repos, pulls, and teams
- fix order of Iter traversal
- added support for repo hooks
Github::new
now takes an owned reference to a hyper::Client. this makes it possible to pass a github instance into a threaded context.- upgrade to serde 0.9 (and now unneeded build.rs machinery)
- sizable code restructure to support scalability in future growth. move foo.rs modules to foo/mod.rs files. moved respective rep.rs reps into mods
- the effect of the above is that everything may no longer be accessible via the top level
hubcaps
module. For instance, in the past you would be able to to accesshubcaps::Pull
directly, now you would access it via is api categoryhubcaps::pulls::Pull
. - update hyper to 0.10. the implications are that you now need to bring your own tls-configured hyper client
- expose more pub fields on pull commits
- added support for listing pull commits
- added support for returning an iterator over all pull commits
- added support for listing issue/pull comments
- added support for listing review comments
- added support for search issues api
- add partial support for new Iter type which serves as an transparent iterator over pages of results
Improved coverage of pull request api
- Pull.body is now represented as an
Option<String>
- Pull.assignees is now deserialized
- added
pull.files()
which returns aVec<FileDiff>
- added support for repo creation #38
- upgrade syntex build dependency to 0.35
- upgrade to hyper 0.8
- upgrade syntex build dependency to 0.33
- Added support for listing organization repositories via @carols10cents
- Fixed deserialization issue related to error response in release api calls issue #31
Many changes were made to transition into using serde as a serialization backend and to focus on making interfaces more consistent across the board. A more flexible interface for authenticating requests was added as well as a new interface for requesting organization repository listings. Relevant itemized changes are listed below.
- port serialization from
rustc-serialize
toserde
! - as a result of the serde port,
Error::{Decoding, Encoding}
which were wrappers around rustc-serialize error types, were removed and replaced with a unifiedError::Codec
which wraps serde's error type - renamed
hubcaps::statuses::State
tohubcaps::StatusState
- added
payload
field tohubcaps::Deployment
represented as aserde_json::Value
- added
content_type
field tohubcaps::GistFile
represented asString
- added
truncated
field tohubcaps::Gist
represented as anbool
and updatedtruncated
field ofhubcaps::GistFile
to beOption<bool>
(this field is omitted in gist listing responses) - introduces
hubcaps::Credentials
as the means of authenticating with the Github api. ACredentials
value is needed to instantiate aGithub
instance. This is a breaking change from the previousOption<String>
token api, with a more flexible set options.hubcaps::Credentials::{None, Token, Client}
.hubcaps::Credentials
implementsDefault
returninghubcaps::Credentials::None
hubcaps::Error
enum now implementsstd::error::Error
- pull request and issue listing fn's now both take options structs. This is a breaking change.
- repo listing fn's now take option structs. This is a breaking change.
- gist listing fn's now take option structs. This is a breaking change.
- added support for fetching organization repository listings via @carols10cents
- DeploymentStatusOptions now have an optional field for
target_url
anddescription
- initial release