71 Commits
Author SHA1 Message Date
Jam Balaya 70b9759927 refactor!: Rename LockIssueOptions, PullRequestBranchUpdateOptions, and UserSuspendOptions to ...Request and pass them by value (#4612)
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`.
2026-10-13 07:32:08 -04:00
Yahia Mohamed e21f24469b feat: Add MergeAsync and GetMergeAsyncResult support (#4491) 2026-08-29 06:49:06 -04:00
Ajay Kemparaj f9fec07de4 feat: Require Go 1.26 and use new(expr) for pointer literals (#4481) 2026-08-28 12:18:49 -04:00
Jam Balaya f15206a0a1 refactor!: Rename NewPullRequest to CreatePullRequest and pass it by value (#4395)
BREAKING CHANGE: `NewPullRequest` is renamed to `CreatePullRequest`, `PullRequests.Create` now takes it by value, and `CreatePullRequest.Head` and `CreatePullRequest.Base` are now `string`.
2026-07-20 08:59:34 -04:00
Oleksandr Redko e4ea9e72c1 test: Use testJSONBody helper for request body assertions (#4283) 2026-06-05 09:27:14 -04:00
Oleksandr Redko 3215e0320e test: Remove redundant Marshal tests (#4266) 2026-06-04 09:22:07 -04:00
Dhananjay Mishra 0a16e22eba refactor: Use testJSONBody helper for request body assertions in tests (#4183) 2026-05-01 08:13:24 -04:00
Glenn Lewis a2063a76fb chore: Remove unnecessary use of new and &SomeStruct{} and add new extraneousnew custom linter (#4106) 2026-03-18 17:12:53 -04:00
Manav Sharma 3eb539b5a3 chore: Enable unparam linter and cover unused *Response results (#3955) 2026-02-02 07:47:33 -05:00
Glenn Lewis 4505771989 Prefer %v over %d,%s and add fmtpercentv custom linter (#3756) 2025-10-05 21:39:53 -04:00
Oleksandr Redko 233fe03e17 test: Use t.Context() instead of context.Background() (#3750) 2025-10-03 08:09:47 -04:00
Oleksandr Redko 9493278195 refactor: fix revive.unused-parameter lint issues (#3603) 2025-06-25 11:44:09 -04:00
Oleksandr Redko f66ed85955 feat: Deprecate and replace Bool,Int,Int64,String with Ptr using generics (#3355) 2024-12-10 21:36:09 -05:00
Glenn Lewis dc884c26ca Add t.Parallel to unit tests (#3297) 2024-10-05 07:29:05 -04:00
Glenn Lewis e56d378b96 refactor: Do not call teardown manually in tests (#3296) 2024-10-01 11:52:30 -04:00
WillAbides fd33b81221 Fix linting (#2903) 2023-09-08 08:55:37 -04:00
Rafael Aramizu Gomes 0c10d670aa Adding missing field important to find branch in fork from same owner (#2873)
Fixes: #2872.
2023-08-15 14:45:00 -04:00
nxya 9f7124cc09 Fix ListPullRequestsWithCommit option type (#2822)
Fixes: #2815.
2023-07-03 09:25:52 -04:00
Victory Osikwemhe cdecead485 Change all fields from time.Time to github.Timestamp (#2646) 2023-01-26 16:39:42 -05:00
Sagar Sonwane 6f70acc87f Add test cases for JSON resource marshaling (#2004) 2021-07-16 07:49:12 -04:00
Sagar Sonwane 51e7595f87 fix: Updated comparisons in test files (#1875)
Replaced all reflect.DeepEqual comparisons in test files with cmp.Equal.

Fixes: #1851
2021-05-26 11:49:24 -07:00
John Liu c99a09ea58 Support empty string as a commit message when merging a pull request (#1816)
Fixes: #1815.
2021-03-05 10:39:27 -05:00
Glenn Lewis 71e0960b10 Improve pulls.go coverage (#1726) 2020-12-25 19:21:23 -05:00
Glenn Lewis 460db534b8 Refactor context.Background in tests (#1672) 2020-12-16 05:58:28 -05:00
Vikky Omkar 8e1859fece Remove graduated GitHub v3 API preview headers (#1618)
Fixes: #1616.
2020-09-17 11:18:51 -04:00
Weslei Juan Moser Pereira 4ca0dcc089 Remove graduated custom media headers (#1493)
Fixes #1488.
2020-04-19 16:02:45 -04:00
Glenn Lewis e4b511744f Add pointers to structs in slices (#1443) 2020-02-28 09:37:37 -05:00
kadern0 69231319df Change opt param to opts (#1417)
Fixes #1415.
2020-02-09 20:01:54 -05:00
Vaibhav Singh 40fcc261cf Remove custom preview headers from "graduated" APIs (#1355)
Fixes #1351.
2019-12-26 10:09:21 -05:00
Emory Ruscus 85279f51b0 Fix 'Reqest' -> 'Request' (add back the 'u'). (#1262) 2019-09-07 20:06:59 -04:00
Shrikrishna Singh 361256aa6e Add preview support to list branches or PRs for a commit (#1186)
Fixes #1151.
2019-06-10 16:18:44 -04:00
Wasim Thabraze 6a358807e1 Added update branch API (#1187)
Fixes #1183.
2019-06-09 17:02:41 -04:00
David c22c8e3046 Add draft field to NewPullRequest struct (#1145) 2019-04-05 15:58:05 -04:00
Joshua Bezaleel Abednego 4e1a504644 Add support for Draft Pull Requests Preview API
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.
2019-02-15 12:35:18 -05:00
Palash Nigam 9650f9402d tests: Replace all occurences of acceptHeaders with wantAcceptHeaders (#1088) 2019-01-03 11:09:22 -08:00
Palash Nigam c40b4abe46 GitHub Signing API: Remove custom media type (#1067)
Fixes #761.
2018-12-12 20:21:07 -05:00
Radliński Ignacy 3e48b156a3 Add links to pull request struct (#1008)
Fixes #1001.
2018-09-24 12:01:07 -04:00
Sandeep Sukhani aeb5071237 Added support for preview Lock Reason (#828) (#910)
Fixes #828.
2018-08-10 11:54:05 -04:00
Shagun Khemka 29a3681d05 Remove custom media type for global node IDs (#925)
Fixes #919.
2018-08-10 11:23:19 -04:00
Guillaume Jacquet 64f8f21e24 Add support for label description
Closes #866
2018-04-16 07:45:54 -07:00
Kshitij Saraogi e48060a28f Migrate IDs to int64 type (#816)
A helper function "Int64" is also implemented to assist the migration of
unit tests.

Refer #597.
2018-01-25 10:59:44 -08:00
John Barton 7cbc150568 Add NodeID for grapqhl preview to PullRequest (#833) 2018-01-22 09:57:02 -08:00
Chris King df88dd9538 Remove global test variables in favor of local. (#766)
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.
2017-12-02 14:34:41 -05:00
Dmitri Shuralyov 724ae38c50 Add RepositoriesService.GetCommitRaw method. (#767)
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).
2017-10-30 17:24:40 -04:00
RaviTeja Pothana e2cc29a3d2 Set Git signing preview API header in PullRequestsService.ListCommits. (#686)
This change causes the Repository.License field to be populated.

Fixes #685.
2017-08-10 18:31:43 -04:00
Ahmed Hagy 35d38108ba Remove custom media type for Merge Methods API. (#621)
The Merge Methods API has become an official part of GitHub API v3,
so the 'application/vnd.github.polaris-preview' preview API media type
is no longer needed.

GitHub Announcement: https://developer.github.com/changes/2017-04-07-end-merge-methods-api-preview/

Fixes #616.
2017-07-25 11:51:12 -04:00
Glenn Lewis 8a99328032 Document Git.CreateCommit and PullRequests.Edit arguments (#539)
Document Git.CreateCommit and PullRequests.Edit arguments

Additionally, protect code from potential panic in CreateCommit.

Fixes #531.
2017-03-08 12:45:55 -08:00
Dmitri Shuralyov 23d6cb9cac Add support for context package to all endpoints. (#529)
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.
2017-02-20 16:05:42 -05:00
Abhinav Gupta 1d8328d1dd Add support for editing base branch of a PR. (#528)
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.
2017-01-31 20:29:59 -05:00
Dmitri Shuralyov 9afd83c1e1 Add test for PullRequests.Merge body payload for various options.
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+.
2016-12-22 13:06:43 -05:00