Supports the updated starring API as mentioned in issue #188.
There is now a new struct called StarredRepository which holds a Repository and the new `starred_at` timestamp.
For now there is a special media type to request the new API. I've added a TODO for it to be deleted when the new API fully launches.
There's no way of serializing/requesting an empty required_contexts that
is needed for bypassing the commit status checks for the ref.
It's a breaking change but will allow to serialize an empty array and
omit empty value as expected.
Also:
- add PingHook to RepositoriesService
- move ListServiceHooks to Client, since hooks are no longer just for
repos. Leave behind Repositories.ListServiceHooks for backwards
compatibility
Fixes#178
The client_id and client_secret URL variables,
containing sensitive app information, are leaked
to users if the Go error is returned to them. To
prevent this, sanitizeURL redacts the fields from
ErrorResponse's Error method. Therefore making the
error message safe to expose to users.
The RepositoryContent struct doesn't quite map to the API because it is
missing a download link. This link is very useful because while the API
doesn't allow large files to be downloaded, the link allows the raw
files to be downloaded outside the API.
Unfortunately this is a breaking change, and having a pointer to a slice
is not very common, but is needed in this case to allow clearing an
issue's labels.
Fixes#181
this method actually returns RepositoryCommits (go-github's term for
this, not GitHub's) rather than Commits. They are very, very close in
structure (which is likely why this has gone unnoticed for so long), one
of the primary differences being that RepositoryCommits exposes the
GitHub identity of the commit author and committer if possible.
These changes are strictly violations of any style guide (I don't
think?), but are just to make tests in go-github more consistent,
particularly in use of 'got' and 'want' vars. In doing this, I found
several places where those two got reversed in the error message (hint:
'got' always comes first in go)
okay, so these aren't really that useful buy hey, why not? :)
MMM. .MMM
MMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMM __________
MMMMMMMMMMMMMMMMMMMMM | |
MMMMMMMMMMMMMMMMMMMMMMM | Ship It! |
MMMMMMMMMMMMMMMMMMMMMMMM |_ ______|
MMMM::- -:::::::- -::MMMM |/
MM~:~ ~:::::~ ~:~MM
.. MMMMM::. .::::. .::MMMMM ..
.MM::::: ._. :::::MM.
MMMM;:::::;MMMM
-MM MMMMMMM
^ M+ MMMMMMMMM
MMMMMMM MM MM MM
MM MM MM MM
MM MM MM MM
.~~MM~MM~MM~MM~~.
~~~~MM:~MM~~~MM~:MM~~~~
~~~~~~==~==~~~==~==~~~~~~
~~~~~~==~==~==~==~~~~~~
:~==~==~==~==~~
A recent update to the GitHub API changed some undocumented behavior. Previously
a nonexistent base_tree and an empty string base_tree were treated the same, but
now the empty string case will fail with "422 base_tree is not a valid oid".
The release assets are included in the release object, but they are not being
parsed currently. To get the list of release assets, one must use
ListReleaseAssets, which is one extra unnecessary HTTP request.
This commit adds Assets field to RepositoryRelease struct so that the release
assets are immediately available right after calling ListReleases.
Signed-off-by: Ondřej Kupka <ondra.cap@gmail.com>