BREAKING CHANGE: `LockIssueOptions`, `PullRequestBranchUpdateOptions`, and `UserSuspendOptions` are renamed to `LockIssueRequest`, `UpdatePullRequestBranchRequest`, and `SuspendUserRequest` and are passed by value to `IssuesService.Lock`, `PullRequestsService.UpdateBranch`, and `UsersService.Suspend`; `LockIssueRequest.LockReason` is now `*string`.
BREAKING CHANGE: `NewPullRequest` is renamed to `CreatePullRequest`, `PullRequests.Create` now takes it by value, and `CreatePullRequest.Head` and `CreatePullRequest.Base` are now `string`.
This change implements support for a preview of a new Draft Pull
Requests API, announced at
https://developer.github.com/changes/2019-02-14-draft-pull-requests/.
• Add new media type constant.
• Use that media type in "list pull requests" and "get pull request"
endpoints.
• Add Draft struct field to the PullRequest struct.
The "create pull request" and "update pull request" endpoints don't set
the new media type yet, but that can be dealt with in a future change.
Fixes#1120.
This refactor removes the global test variables used by all tests,
replacing them with local variables that are independent in each test.
This is better style, easier to read and be confident about correctness,
and allows tests to be parallelized in the future.
Resolves#762.
Follows the same high-level pattern as set out in PR #481 with
PullRequestsService.GetRaw method.
Improve documentation wording.
Improve style of PullRequestsService.GetRaw and its tests to be more
consistent.
Fix minor typo in GitHub documentation URL (2 slashes instead of 1).
This is a large breaking API change. It is unavoidable and necessary
to resolve#526. This breaking change is part of bump to libraryVersion 3.
It adds ctx context.Context as first parameter to all endpoint methods,
including Do.
Updating for this API change should be easy and the compiler will help
catch instances that need to be updated. For example:
main.go:193: not enough arguments in call to gh.Activity.MarkRepositoryNotificationsRead
have (string, string, time.Time)
want (context.Context, string, string, time.Time)
...
You should pass the available context as first parameter. If your code
does not have context.Context available and you want to maintain previous
normal behavior, use context.Background(). Don't pass nil context; use
context.TODO() instead if you wish to delay figuring out the best context
to use. Then you can address the TODO at a later time.
Refer to documentation of package context at https://godoc.org/context
for more information.
This commit also changes ./tests/fields to use context.Background()
instead of deprecated oauth2.NoContext.
Resolves#526.
As per the discussion in #421, the PullRequest parameter is converted into
an unexported type pullRequestUpdate which matches the shape expected by
the pulls PATCH endpoint.
Resolves#421.
All 3 options are optional, and should not be sent as part of the JSON
payload when they're left as empty strings.
Don't use subtests for now because they're 1.7+, and this project
currently supports versions of Go as 1.4+.