63 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
Ajay Kemparaj f9fec07de4 feat: Require Go 1.26 and use new(expr) for pointer literals (#4481) 2026-08-28 12:18:49 -04:00
James Maguire a3951f5143 refactor!: Rename EditLabel to UpdateLabel, Split Label into CreateLabelRequest & UpdateLabelRequest and pass by value (#4400)
BREAKING CHANGE: `IssuesService.CreateLabel` now takes `CreateLabelRequest` by value (with required non-pointer `Name`); `IssuesService.EditLabel` renamed to `UpdateLabel`, taking an `UpdateLabelRequest` by value.
2026-07-22 14:32:59 -04:00
James Maguire 9549a7a99a refactor!: Split IssueRequest into CreateIssueRequest & UpdateIssueRequest and pass by value (#4396)
BREAKING CHANGE: `IssueService.Edit` is renamed to `IssueService.Update`.
2026-07-21 07:21:51 -04:00
Glenn Lewis 595de3d4b8 chore: Replace time.Date with referenceTime (#4325) 2026-06-24 15:42:55 -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 a2d86b0d3e fix!: Fix opts for methods listing issues and sub-issues (#4016)
BREAKING CHANGE: Split `IssuesService.List` into `IssuesService.ListAllIssues` and `IssuesService.ListUserIssues`. `IssuesService.ListByOrg` now accepts `IssueListByOrgOptions`. `SubIssueService.ListByIssue` now accepts `ListOptions`.
2026-02-17 09:19:33 -05:00
Shivam Kumar e0c53bf40f fix!: Fix pagination support for IssuesService list methods (#3984)
BREAKING CHANGE: `ListCursorOptions` is removed from `IssueListOptions`.
2026-02-11 14:00:59 -05:00
Svyatoslav Pidgorny ae3fff0df7 Add ParentIssueURL field to Issue struct (#3841) 2025-11-19 20:19:04 -05:00
Oleksandr Redko 233fe03e17 test: Use t.Context() instead of context.Background() (#3750) 2025-10-03 08:09:47 -04:00
Oleksandr Redko f68f136d3c chore: Format code with gofumpt (#3689) 2025-09-22 14:16:47 -04:00
Jan Berger 6a2c098e78 Add ListCursorOptions to list Issues methods (#3570) 2025-05-08 07:58:15 -04:00
Carlos Tadeu Panato Junior c9e1ad0d3b Add issue Type to IssueRequest (#3567) 2025-04-30 08:27:35 -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
Oleksandr Redko 77dcbf366e refactor: Enable revive linter and fix up lint issues (#3345) 2024-11-11 19:37:16 -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
Tatsuhiro Tsujikawa e7a3cc7ba3 Add MergedAt field to PullRequestLinks (#3053)
Fixes: #3052.
2024-01-19 08:11:29 -05: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
Glenn Lewis 3e8a7f0fbe Clean up method return consistency (#2318) 2022-03-24 23:16:22 -04:00
Allan Guwatudde 07267ab1f6 Add new RemoveMilestone method on IssuesService (#2195)
Fixes: #236.
2021-11-03 20:18:58 -04:00
Sagar Sonwane d65bf1a02d Add test cases for JSON resource marshaling (#1984) 2021-07-13 14:50:31 -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
Glenn Lewis f14da42782 Improve issues.go coverage (#1743) 2020-12-25 18:54:01 -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
Vikky Omkar 5baa174a7d Added AuthorAssociation field in issue struct (#1462)
Fixes #1458.
2020-03-18 09:14:24 -04:00
Glenn Lewis e4b511744f Add pointers to structs in slices (#1443) 2020-02-28 09:37:37 -05:00
Vaibhav Singh 40fcc261cf Remove custom preview headers from "graduated" APIs (#1355)
Fixes #1351.
2019-12-26 10:09:21 -05:00
Palash Nigam 9650f9402d tests: Replace all occurences of acceptHeaders with wantAcceptHeaders (#1088) 2019-01-03 11:09:22 -08:00
Brandon Cook 3dd825b438 Fixes wrong Accept media type that was causing a 500 (#977) 2018-08-29 16:28:52 -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
Anubha Kushwaha cbeb72eaf5 Support preview GraphQL API v4 Node IDs. (#817)
Add NodeID field to objects that now expose it.

Reference: https://developer.github.com/changes/2017-12-19-graphql-node-id/.
2018-01-09 16:35:34 -05: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
Elliott Beach 3a960f412f Add Issue.IsPullRequest helper method. (#737)
Add a helper method for checking whether a github.Issue represents
an issue or PR by using the approach documented in GitHub API docs at
https://developer.github.com/v3/issues/#list-issues, which is to check
whether PullRequestLinks is nil or not.

Using this method is optional, and previous code that manually checks
whether PullRequestLinks is nil continues to be valid. The helper may
be used for convenience or to improve readability of user code.

Fix minor spelling issues in comments.
2017-10-02 17:05:52 -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
Glenn Lewis dc287189c0 Stop using custom media type for Multiple Assignees.
Fixes #399.
Fixes #401.

Change-Id: I97be757ad8672c649076ecbb0a51d60576d29164
2016-07-14 07:34:07 -07:00
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
2016-06-23 09:32:35 -07:00
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
2016-06-19 19:42:35 -07:00
Glenn Lewis 3e167707c0 remove unnecessary newlines
Change-Id: I7bf843b42a0d8869e72b6d0606bdc99893b10bdb
2016-06-17 10:34:55 -07:00
Glenn Lewis 0237c55854 add support for multiple issue assignees
Fixes #362.

Change-Id: I39d142b4ef54bf514140a56b5fcbbcfa784f0c7f
2016-06-16 11:08:24 -07:00
Glenn Lewis 09a37d57ac add support for Reactions API
Fixes #356.

Change-Id: Iecc8d7d7c11a8ce9ed38c6d024683815495cb8b4
2016-05-14 12:28:10 -07:00
Glenn Lewis ac77c93f2b go-github: add support for issue locking / unlocking
Fixes #279.

Change-Id: I55ffdadfe5970d664ac94048e8bc2b8f5d935903
2016-02-16 12:10:04 -08:00
Will Norris a5a2cf2688 fix broken test when switching IssuesRequest.Labels to slice pointer 2015-04-28 07:55:15 -07:00
Alex Bramley 143bda55a3 IssueRequest struct for create/edit. Fixes #75.
Using an *Issue in IssuesService.{Create,Edit} means that the Labels
and Assignee fields do not serialize to the correct JSON representation
for the GitHub API. This change introduces an IssueRequest struct to
use instead, allowing labels and assignees to be set on create or edit.
2013-12-23 14:32:15 +00:00