32 Commits
Author SHA1 Message Date
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 4d45b7c496 refactor!: Rename PullRequestReviewDismissalRequest to PullRequestDismissReviewRequest, add PullRequestSubmitReviewRequest, and pass review request bodies by value (#4406)
BREAKING CHANGE: `PullRequestReviewDismissalRequest` is now `PullRequestDismissReviewRequest` with non-pointer `Message` and `PullRequestsService.DismissReview` takes it by value; `PullRequestsService.SubmitReview` now takes a new `PullRequestSubmitReviewRequest`.
2026-07-31 14:34:51 -04:00
Oleksandr Redko f53fbae913 test: Replace &x variables with inline Ptr(value) calls (#4289) 2026-06-10 09:33:24 -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
Oleksandr Redko 233fe03e17 test: Use t.Context() instead of context.Background() (#3750) 2025-10-03 08:09:47 -04:00
Iehana Fu cd80b0a575 refactor: Use errors package to compare and assert error types (#3739) 2025-09-30 09:15:20 -04:00
Oleksandr Redko f68f136d3c chore: Format code with gofumpt (#3689) 2025-09-22 14:16:47 -04:00
Oleksandr Redko ff1666c906 refactor: Fix revive.unnecessary-format lint issues (#3629) 2025-07-19 14:01:40 -04:00
Oleksandr Redko 3a3f51bc7c chore: Remove redundant in Go 1.22 loop variables (#3537) 2025-04-02 08:52:10 -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
Victory Osikwemhe cdecead485 Change all fields from time.Time to github.Timestamp (#2646) 2023-01-26 16:39:42 -05:00
Sagar Sonwane df53835949 Add test cases for JSON resource marshaling (#2003) 2021-07-16 07:50:04 -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
Renjith R ff3975e723 Add JSON marshaling tests (#1799)
Helps #55.
2021-02-12 13:56:56 -05:00
Glenn Lewis 8d06e8e47d Improve pulls_reviews.go coverage (#1769) 2020-12-26 11:36:32 -05:00
Glenn Lewis 81b7f62aef Improve pulls_reviews.go coverage (#1738) 2020-12-25 18:56:54 -05:00
Glenn Lewis 460db534b8 Refactor context.Background in tests (#1672) 2020-12-16 05:58:28 -05:00
Matt Moore 3d244d3d49 Add support for multi-line comments (#1566) 2020-06-24 19:19:06 -04:00
thomaslanghorst a291ecb5d8 added test for JSON marshalling for Reviewers - relates to (#55) (#1309) 2019-10-13 16:00:17 -04:00
Joshua Bezaleel Abednego 0ab167c7d8 Add method for updating a pull request review (#1177)
Fixes: #1174.
2019-05-29 22:02:27 -04: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
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
haya14busa f6abac9979 Support commit_id for "Create a pull request review" (#683)
Support commit_id for "Create a pull request review"

https://developer.github.com/v3/pulls/reviews/#create-a-pull-request-review
2017-08-09 10:20:42 -07:00
avr2j 11516601ad Remove custom media type for Pull Request Reviews API. (#641)
The Pull Request Reviews API (include Review Requests) has become an
official part of GitHub API v3, so the preview API media type is no
longer needed. See announcement at
https://developer.github.com/changes/2017-05-09-end-black-cat-preview/.

Resolves #638.
2017-05-15 15:45:53 -04:00
Sam Minnée fc60e1f520 Add *ListOptions parameter to 7 methods that support pagination. (#635)
This is an unavoidable breaking API change. To update to new version
without changing behavior, you can provide nil value for *ListOptions.

Bump libraryVersion to 7.

This adds a *ListOptions parameter to 7 methods that support pagination,
but inadvertently omitted this parameter:

-	AuthorizationsService.ListGrants
-	GistsService.ListCommits
-	PullRequestsService.ListReviewers
-	PullRequestsService.ListReviews
-	PullRequestsService.ListReviewComments
-	RepositoriesService.ListPagesBuilds
-	UsersService.ListInvitations

This is needed to support pagination. Without this parameter, it’s not
possible to fetch anything other than the first page (of default size)
of results.

Add _withOptions tests for each of the methods, that ignore the result
but ensure that ?page=2 is added to the API requests.
2017-05-11 21:42:59 -04: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
Sahil Dua 27c7c32b6d Add support for new pull request review API
Fixes #495.
Closes #497.

Change-Id: If266972e7a20f83afaa842d54c22846bbb435328
2017-02-02 16:04:50 -08:00