Dmitri Shuralyov
136ef5cdab
Put sync.Mutex on top of variables it protects.
This change makes the code more consistent with the rateMu below.
This is a followup to https://github.com/google/go-github/pull/390#discussion_r68863652 .
Closes #396 .
Change-Id: I0fc8b280911f9171fb4d8e3fa60cf6d53b64a65b
10 years ago
Glenn Lewis
53a129e94c
Sync doc.go and README.md
Fixes #397 .
Change-Id: I30ce336e3a36cf5758b9bf52b9dd77f7c1df5f27
10 years ago
Carlos Alexandro Becker
878df980b6
Add missing ID fields to PullRequest and Issue structs
In
[events](https://developer.github.com/v3/activity/events/types/#pullrequestevent ),
the `id` field is present both in the Issue and PullRequest objects.
This PR adds them.
10 years ago
Glenn Lewis
2d3520b585
add unit tests for #342 - CreateImpersonation and DeleteImpersonation
Change-Id: Ib5fd4e99b88ff01e3363e049177326b7ee97be93
10 years ago
Hanno Hecker
07a1059646
add (AuthorizationsService) CreateImpersonation/DeleteImpersonation
Closes #342 .
10 years ago
Will Norris
92234e5677
add missing license headers in a few files
10 years ago
Yannick Utard
8468db8b74
Add ReadOnly boolean field to deploy keys
Closes #391 .
Change-Id: Ie5bca9e80c5d1a1348f640a1a75063bac63f539a
10 years ago
Matthew Dempsky
8808be6605
Avoid unnecessary FooService allocations
Fixes #389
Fixes #390
10 years ago
Billy Lynch
087a452730
add support for OAuth Grant Authorizations API
GitHub API docs: https://developer.github.com/v3/oauth_authorizations
Fixes #348 .
Closes #388 .
Change-Id: I795b1c0e10bde10a1bc9aaa4594af4c91e07962d
10 years ago
Beshr Kayali
e4b1c2870f
add support for list commits endpoint
Use Timestamp type for GistCommit CommitedAt field.
Add support for ListForks endpoint.
Add missing fields for GistCommit and GistFork types.
Closes #385 .
Change-Id: If1379d83173d52c974bb5834a834d97aee2f0ad8
10 years ago
Billy Lynch
45cbf2313c
Add support for affiliation and visibility in RepositoryListOptions.
Also updates comments in RepositoryListOptions to match the Github API docs
(https://developer.github.com/v3/repos/#list-your-repositories ).
Fixes #231
10 years ago
Dmitri Shuralyov
c31236d1f3
Remove issue locking/unlocking preview media type.
These changes are now official, so the custom media type is no longer
needed.
Fixes #381 .
Fixes #382 .
Updates #279 .
Change-Id: I33cad47c6645c5292f699826ae117b94260a3044
10 years ago
Glenn Lewis
bdd0f40310
better support both Events API and Webhook events in PushEventCommit
Fixes #370 .
Change-Id: I0a8567ae352bd2e9e973ac73383894d2b4cdfb9d
10 years ago
Glenn Lewis
5c1b3a05b4
add support for new repository invitations
Fixes #371 .
Change-Id: I97f2fc28ce048442ee8af3bd11c48b5b2084e09b
10 years ago
Glenn Lewis
4ea1b10b74
replace []Issue with []*Issue and for other large structs as well
Note that this is an API-breaking change but should have minimal
impact on users of this package due to the nice inference
properties of the Go programming language.
Bumped `libraryVersion` to `2` due to API-breaking change as
discussed in #376 .
Fixes #180 .
Change-Id: Ib386135e6b8f306d1f54278968c576f3ceccc4e7
10 years ago
Dmitri Shuralyov
1c08387e4c
Remove leading slash from ReactionsService.DeleteReaction URL.
It's harmless, but inconsistent. All other such URLs in this package do not use a leading slash.
See 09a37d57ac (commitcomment-17927607) .
10 years ago
Glenn Lewis
3e167707c0
remove unnecessary newlines
Change-Id: I7bf843b42a0d8869e72b6d0606bdc99893b10bdb
10 years ago
Glenn Lewis
b240c2dfee
add support for Issue Timeline API
Fixes #360 .
Change-Id: I69846ddeb5fd289ec81712cccaefde3f3931fd09
10 years ago
Glenn Lewis
e1bc3a7920
move examples to github_test package in examples_test.go
See #367 for discussion.
Change-Id: I10e26bddebeea2a1485fc4389caab1ff12421382
10 years ago
Glenn Lewis
71e65bb773
document 'since' pagination for Users.ListAll
Fixes #278 .
Change-Id: Ia1d0c1f6b395d493714d91e0f6e79dc2506f8fde
10 years ago
Glenn Lewis
0237c55854
add support for multiple issue assignees
Fixes #362 .
Change-Id: I39d142b4ef54bf514140a56b5fcbbcfa784f0c7f
10 years ago
Glenn Lewis
a8b8751f9d
add utilities for processing payload messages
Fixes #361 .
Change-Id: I1c80b8eb7816efc9b83e6b8be956430c68809d5e
10 years ago
Hanno Hecker
d2e7389fc1
add Message field for "custom" errors
See https://developer.github.com/v3/#client-errors
Fixes #359 .
Change-Id: I9be617cb55e304f8f91675ce46f0726f548b742e
10 years ago
Glenn Lewis
a6edb1171a
add support for git signing API methods
Fixes #334 .
Change-Id: I9b10ae5e7679f5196778d9eb3ded6168d7facfc3
10 years ago
Garrett Squire
796cdb74b6
Add squashing capability to the pull request merge function.
Fixes #324 .
Fixes #353 .
Change-Id: If176b98b951db7f2e45ad7578bb8eeac13ffdbc2
10 years ago
Glenn Lewis
8e80839766
remove org permission content type
Additionally, change preview media type to documented custom media type
for https://developer.github.com/v3/orgs/teams/#check-if-a-team-manages-a-repository
Fixes #262 .
Change-Id: Ie9acf859346fce6b797b039d35b17e46f404e2a3
10 years ago
Bryan Boreham
c2beba44cf
Add missing ListOptions to various structs
Make it possible for callers of IssuesService.ListMilestones() and
similar to step through pages of results.
10 years ago
Dmitri Shuralyov
66d9f2f653
Update Reactions API (preview) for breaking change.
Reactions API now includes user information.
See https://developer.github.com/changes/2016-06-07-reactions-api-update/ .
Fixes #364 .
Updates #356 .
10 years ago
Joe Tsai
a69fa76cb5
fix unit tests for go1.7 release
An upcoming change to Go 1.7 allows the json package to be able to encode maps
with the integer keys. Thus, this is no longer a good way to generate intentional
JSON failures.
Reference:
f05c3aa24d
10 years ago
Glenn Lewis
09a37d57ac
add support for Reactions API
Fixes #356 .
Change-Id: Iecc8d7d7c11a8ce9ed38c6d024683815495cb8b4
10 years ago
Will Norris
a68a8707f3
Add support for the Source Import API
Fixes #291
Fixes #351
10 years ago
Glenn Lewis
842c551fde
add more payloads to event.Payload
Closes #349
Change-Id: I733568c73e1bc2cd748c5c5cd3d16654c7dd7828
10 years ago
Dmitri Shuralyov
4c532303a6
Simplify Bool, Int, String helpers.
Code simplification suggestion by @gmlewis .
Closes #350
10 years ago
Dmitri Shuralyov
491489e7d7
Fix Int helper documentation.
This change makes it accurate and consistent with others.
10 years ago
Dmitri Shuralyov
13c2701463
Deprecate Client.Rate() method in favor of Response.Rate.
Client.Rate() method is unreliable in situations when API calls are made
by others that may hit different rate limit categories (core and search).
Each API call already returns a Response struct that contains an accurate
Rate, so that's a better mechanism to access this information.
See relevant discussion at https://github.com/google/go-github/pull/347#discussion_r61920849 .
10 years ago
Dmitri Shuralyov
b07f95ef93
Predict *RateLimitError, return immediately without network call.
When possible to do so reliably, i.e., the client knows that the rate
limit is exceeded and reset time is in the future, immediately return
*RateLimitError without making network calls to GitHub API.
Add a unit test covering RateLimits method populating client.rateLimits.
Remove commented out code.
Helps #152 and #153 .
10 years ago
Dmitri Shuralyov
bbe5f62e3f
Keep track of all rate limits in client.
In GitHub API, there are currently two categories of rate limits: core
and search. Previously, the client only tracked the rate limit from the
most recent API call. This change makes it track both rate limit
categories.
This will be useful in the following commit.
10 years ago
Dmitri Shuralyov
81ea1e5cb3
Fix formatting directive issues in tests.
As detected with go vet.
Simplify code slightly by removing unnecessary brackets around a
variable.
10 years ago
Dmitri Shuralyov
0e3941cd1f
Improve test error message.
Print the actual value that doesn't match.
Minor followup fix for c3f5683ad1 (#277 ).
10 years ago
Chris Roche
4e358c5270
Correctly handle API errors when downloading Release Assets
If `RepositoriesService.DownloadReleaseAsset` encounters an error from
the GitHub API (e.g., 404 Not Found), The error would not be returned
by the method and instead the error payload would be delivered as the
`io.ReadCloser`. This patch resolves this with `CheckResponse`.
Fixes #343
10 years ago
Glenn Lewis
bf7dc3b893
add support for new webhook changes
Fixes #339 .
Change-Id: Iec93b108e86e5aa8662d160567ee136eedea9700
10 years ago
Glenn Lewis
576fece59c
change custom accept header for support of commit reference SHA-1 API
See: https://developer.github.com/changes/2016-04-12-commit-reference-sha-api-is-now-official/
Fixes #297 .
Change-Id: I9cc3c4a2e143c6b3ca4677d8d27ea7af96341dd9
10 years ago
Hanno Hecker
d3e4ce6fe5
Add "assignee" field
On webhooks, when the PR is assigned you get
{
"action": "assigned",
"number": 73,
"pull_request": {
"url":
...
"body": "",
"created_at": "2016-04-13T13:51:23Z",
"updated_at": "2016-04-13T13:51:37Z",
"closed_at": null,
"merged_at": null,
"merge_commit_sha": "333a18e2215ec59bfd09fefd730f71492a52f983",
"assignee": {
"login": "someuser",
"id": ...
10 years ago
Andrew Ryabchun
eea6140a0a
Add support for Activities.ListStargazers response with timestamp.
Add custom header to request to get an alternate response with star creation timestamp.
Solves #319
Closes #320
10 years ago
Quinn Slack
1acbd99794
Add UsersService.GetByID method.
Note: GetByID uses the undocumented GitHub API endpoint /user/:id.
Resolves #329 (assuming #332 is also merged).
Closes #333
12 years ago
Quinn Slack
8f139c86ab
Add RepositoriesService.GetByID method.
Note: GetByID uses the undocumented GitHub API endpoint /repositories/:id.
Include license preview Accept header.
Helps #329 .
12 years ago
Matt Brender
61c6c14bbe
Clarify use of RepositoryContent encoded content
It's not obvious from reading the GitHub API docs or the go-github docs
that RepositoryContent.Content may be base64 encoded. This adds
clarifying docs for that as well as the String method.
Also add an example of using the GetReadme method.
Fixes #322
Fixes #323
10 years ago
Glenn Lewis
b5479d6bf2
add support for Deployment and DeploymentStatus API enhancements
Fixes #328 .
Change-Id: I2f93fb89eb46e9d341e9a9aada8de1b3339d1ffd
10 years ago
Will Norris
d5f0be217b
add RepoContent.GetContent to replace Decode
Decode only works if r.Content is actually encoded, which I'm not sure
that it always will be. GetContent will return the content, decoding it
only if necessary. Deprecate the old Decode method.
Also expand and cleanup the tests for both of these methods.
Related to #323
10 years ago
Neil O'Toole
3f4539c62a
Update AuthorizationsService
- add new Scope type with values for each of GitHub's current scopes
- add String method to Authorization types
- doc updates
10 years ago