Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
45c68b4
Add discussion command group scaffolding
maxbeizer Apr 2, 2026
65f5b21
Merge pull request #13082 from maxbeizer/discussion-cmd
babakks Apr 2, 2026
90449b5
Implement `gh discussion list` command
maxbeizer Apr 2, 2026
e84ecb1
Address review feedback on discussion list PR
maxbeizer Apr 13, 2026
a08f5f2
Fix gofmt alignment in test file
maxbeizer Apr 13, 2026
1723805
Check hasDiscussionsEnabled in ListCategories
maxbeizer Apr 13, 2026
0687a29
Fix GQL schema: Discussion uses closed bool, not state string
maxbeizer Apr 13, 2026
3f52503
fix(discussion list): use separate list of fields
babakks Apr 14, 2026
236224d
fix(discussion list): replace state with closed in domain types
babakks Apr 14, 2026
15d3eea
fix(discussion/client): fetch body in list/search
babakks Apr 14, 2026
034e38f
fix(discussion/client): fetch author/answerChosenBy fields
babakks Apr 14, 2026
e6befd5
fix(discussion/client): simplify list query
babakks Apr 14, 2026
2a46a9d
fix(discussion/client): change list return type to pointer
babakks Apr 14, 2026
9afbd61
refactor(discussion/client): use strongly-typed query for search func…
babakks Apr 14, 2026
e403e82
refactor(discussion/client): use strongly-typed query for list function
babakks Apr 14, 2026
afb1b7d
fix(discussion/shared): print quoted category slugs
babakks Apr 14, 2026
9a42e90
fix(discussion/shared): deleted unused fields slice
babakks Apr 14, 2026
835d7f3
fix(discussion/client): remove reaction groups from list/search types
babakks Apr 14, 2026
2d1b1a7
fix(discussion list): only print remaining items in tty mode
babakks Apr 14, 2026
d45ce94
refactor(discussion list): inline printed messages
babakks Apr 14, 2026
8d70cc9
refactor(discussion list): encapsulate printing within `printDiscussi…
babakks Apr 14, 2026
f62875f
fix(discussion list): quote author qualifier in web mode
babakks Apr 14, 2026
2a4a982
fix(discussion list): include search keywords in web mode
babakks Apr 14, 2026
2bb24f9
Merge pull request #13084 from maxbeizer/discussion-list
babakks Apr 15, 2026
35e8cc9
test(discussion): add httpmock unit tests for DiscussionClient
maxbeizer Apr 21, 2026
aa080ad
refactor(discussion): convert client tests to table-driven
maxbeizer Apr 22, 2026
5db230b
test(discussion): assert GQL variables, add Bot actor and limit>100 c…
maxbeizer Apr 22, 2026
45de7db
style: run gofmt on client_impl_test.go
maxbeizer Apr 22, 2026
8111736
refactor(discussion/client): convert tests to httpStubs pattern
babakks Apr 24, 2026
2b794ed
refactor(discussion/client): remove redundant "first" variable init
babakks Apr 24, 2026
d7276c7
Merge pull request #13252 from maxbeizer/tests/discussion-client-http…
babakks Apr 24, 2026
d9e9751
Add `discussion view` command
maxbeizer Apr 3, 2026
d6e63f6
fix(discussion view): align with post-review list changes
maxbeizer Apr 16, 2026
ca84d4c
Add `discussion view --comments` with threaded display
maxbeizer Apr 17, 2026
dea54ab
fix: gofmt alignment in GetWithComments response struct
maxbeizer Apr 20, 2026
cd3b23b
docs(discussion view): add preview remark
babakks Apr 24, 2026
57b3e90
fix(discussion/shared): anchor discussion url regexp
babakks Apr 24, 2026
7603a0c
fix(discussion/shared): quote arg in errors
babakks Apr 24, 2026
ca8d878
docs(discussion/shared): explain why we accept http scheme
babakks Apr 24, 2026
f7a7968
test(discussion/shared): add test for ParseDiscussionArg
babakks Apr 24, 2026
6bd96ab
fix(gh discussion view): wrap arg parse error as flag error
babakks Apr 24, 2026
75b7150
refactor(discussion view): use slices package for label sorting
babakks Apr 24, 2026
d2e081b
feat(discussion view): add cursor-based pagination to comments
babakks Apr 24, 2026
9f3a31d
fix(discussion view): use GraphQL variables for cursor, fix --json co…
maxbeizer Apr 25, 2026
49a846a
docs(discussion view): use non-default behaviour in example
babakks Apr 27, 2026
72a6c98
refactor(discussion view): simplify mode check
babakks Apr 27, 2026
524a503
refactor(discussion/client): use strongly-typed query for fetching co…
babakks Apr 27, 2026
5946d1a
chore(discussion/client): apply formatting
babakks Apr 27, 2026
9baeaf2
Merge pull request #13214 from maxbeizer/discussion-view-comments
babakks Apr 27, 2026
b090b4d
feat(discussion/client): add GetCommentReplies with paginated reply f…
babakks Apr 27, 2026
56db9ee
feat(gh discussion view): add --replies flag for paginated reply viewing
babakks Apr 27, 2026
5970172
fix(discussion view): guard against empty comment slice in replies mode
babakks Apr 27, 2026
99a0999
Merge pull request #13295 from cli/babakks/discussion-view-replies
babakks Apr 27, 2026
11130fd
test(discussion view): add tests for view command client methods and …
maxbeizer Apr 27, 2026
45bd958
test(discussion/client): improve GetByNumber test coverage
babakks Apr 28, 2026
573f3f0
test(discussion/test): use nil next page to match API behaviour
babakks Apr 28, 2026
19369d0
test(discussion/client): improve GetWithComments test coverage
babakks Apr 28, 2026
e263abf
test(discussion/client): improve GetCommentReplies test coverage
babakks Apr 28, 2026
cf40f92
chore(discussion/client): polish and cleanup tests
babakks Apr 28, 2026
54ddede
test(discussion/view): consolidate NewCmdView flag parsing tests
babakks Apr 28, 2026
52f219a
test(discussion view): consolidate view run tests
babakks Apr 29, 2026
a92d0c6
Merge pull request #13299 from maxbeizer/discussion-view-tests
babakks Apr 29, 2026
2e56231
feat(discussion/client): implement Create mutation with tests
maxbeizer Apr 29, 2026
d78703e
fix(discussion/client): polish Create implementation
babakks May 1, 2026
d6b46f7
test(discussion/client): verify Create mutation variables and error p…
babakks May 1, 2026
fd06ad7
discussion create: add label support via two-step GraphQL
maxbeizer May 1, 2026
618dbf3
fix(discussion/client): improve label resolution error handling
babakks May 5, 2026
5d917f1
test(discussion/client): add label pagination and early-break tests
babakks May 5, 2026
41f74c4
Merge pull request #13316 from maxbeizer/discussion-create
babakks May 5, 2026
e471f3f
feat: add gh discussion create command
maxbeizer May 6, 2026
a1fd235
fix: label atomicity, validation order, blankAllowed, help text
maxbeizer May 6, 2026
3850cac
fix(discussion create): improve validation and output behavior
babakks May 7, 2026
bdceb21
fix(discussion create): allow `--repo` override
babakks May 7, 2026
47cabb2
fix(discussion create): remove success message from stderr
babakks May 7, 2026
0c0d316
test(discussion create): consolidate into TestCreateRun table test
babakks May 7, 2026
25778ce
docs(discussion create): add preview suffix
babakks May 7, 2026
c87d262
fix(discussion create): display spinner
babakks May 7, 2026
214885b
Merge pull request #13359 from maxbeizer/discussion-create-cmd
babakks May 7, 2026
3366cf9
Add gh discussion edit command
maxbeizer May 8, 2026
f3766aa
fix: skip Update API call when interactive user selects nothing to edit
maxbeizer May 9, 2026
4369ddb
refactor(discussion): wrap error
babakks May 26, 2026
0dd88dd
refactor(discussion/client): rename addLabelsToDiscussion to editDisc…
babakks May 26, 2026
905e8dd
fix(discussion/client): remove unused comments field
babakks May 26, 2026
4f640e5
fix(discussion/client): use strongly-typed query for updating discuss…
babakks May 26, 2026
4feb982
feat(discussion/client): add label mutation support to Update
babakks May 26, 2026
7c54f0c
fix(discussion/client): add ListLabels method to client
babakks May 26, 2026
a5afebd
fix(discussion/client): use label ids as input
babakks May 27, 2026
6c6390a
feat(discussion edit): support editing discussion labels
babakks May 27, 2026
4e3a173
fix(discussion edit): check body related flags changed state instead …
babakks May 28, 2026
b6d5f84
Merge pull request #13533 from cli/babakks/add-discussion-edit-cmd
babakks May 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions pkg/cmd/discussion/client/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Package client provides an abstraction layer for interacting with the
// GitHub Discussions GraphQL API. The DiscussionClient interface defines all
// supported operations and can be replaced with a mock in tests.
package client

import "github.com/cli/cli/v2/internal/ghrepo"

//go:generate moq -rm -out client_mock.go . DiscussionClient

// DiscussionClient defines operations for interacting with the GitHub Discussions API.
type DiscussionClient interface {
List(repo ghrepo.Interface, filters ListFilters, after string, limit int) (*DiscussionListResult, error)
Search(repo ghrepo.Interface, filters SearchFilters, after string, limit int) (*DiscussionListResult, error)
GetByNumber(repo ghrepo.Interface, number int) (*Discussion, error)
GetWithComments(repo ghrepo.Interface, number int, commentLimit int, after string, newest bool) (*Discussion, error)
GetCommentReplies(repo ghrepo.Interface, number int, commentID string, limit int, after string, newest bool) (*Discussion, error)
ListCategories(repo ghrepo.Interface) ([]DiscussionCategory, error)
ListLabels(repo ghrepo.Interface) ([]DiscussionLabel, error)
Create(repo ghrepo.Interface, input CreateDiscussionInput) (*Discussion, error)
Update(repo ghrepo.Interface, input UpdateDiscussionInput) (*Discussion, error)
Close(repo ghrepo.Interface, id string, reason CloseReason) (*Discussion, error)
Reopen(repo ghrepo.Interface, id string) (*Discussion, error)
AddComment(repo ghrepo.Interface, discussionID string, body string, replyToID string) (*DiscussionComment, error)
Lock(repo ghrepo.Interface, id string, reason string) error
Unlock(repo ghrepo.Interface, id string) error
MarkAnswer(repo ghrepo.Interface, commentID string) error
UnmarkAnswer(repo ghrepo.Interface, commentID string) error
}
Loading
Loading