Skip to content

Add support for GitHub discussions #346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 30 additions & 0 deletions pkg/github/discussions.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package github

import (
"context"
"github.com/google/go-github/v69/github"
)

// ListDiscussions lists discussions in a repository.
func ListDiscussions(ctx context.Context, client *github.Client, owner, repo string) ([]*github.Discussion, error) {
// Implementation here
return nil, nil
}

// GetDiscussion retrieves a specific discussion by ID.
func GetDiscussion(ctx context.Context, client *github.Client, owner, repo string, discussionID int64) (*github.Discussion, error) {
// Implementation here
return nil, nil
}

// CreateDiscussion creates a new discussion in a repository.
func CreateDiscussion(ctx context.Context, client *github.Client, owner, repo, title, body string) (*github.Discussion, error) {
// Implementation here
return nil, nil
}

// AddDiscussionComment adds a comment to a discussion.
func AddDiscussionComment(ctx context.Context, client *github.Client, owner, repo string, discussionID int64, body string) (*github.DiscussionComment, error) {
// Implementation here
return nil, nil
}
28 changes: 28 additions & 0 deletions pkg/github/discussions_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package github

import (
"context"

Check failure on line 4 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (macos-latest)

"context" imported and not used

Check failure on line 4 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / lint

"context" imported and not used

Check failure on line 4 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

"context" imported and not used

Check failure on line 4 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / lint

"context" imported and not used

Check failure on line 4 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (macos-latest)

"context" imported and not used

Check failure on line 4 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (windows-latest)

"context" imported and not used

Check failure on line 4 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

"context" imported and not used

Check failure on line 4 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (windows-latest)

"context" imported and not used
"net/http"

Check failure on line 5 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (macos-latest)

"net/http" imported and not used

Check failure on line 5 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / lint

"net/http" imported and not used

Check failure on line 5 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

"net/http" imported and not used

Check failure on line 5 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / lint

"net/http" imported and not used

Check failure on line 5 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (macos-latest)

"net/http" imported and not used

Check failure on line 5 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (windows-latest)

"net/http" imported and not used

Check failure on line 5 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

"net/http" imported and not used

Check failure on line 5 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (windows-latest)

"net/http" imported and not used
"testing"

"github.com/google/go-github/v69/github"

Check failure on line 8 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (macos-latest)

"github.com/google/go-github/v69/github" imported and not used

Check failure on line 8 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / lint

"github.com/google/go-github/v69/github" imported and not used

Check failure on line 8 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

"github.com/google/go-github/v69/github" imported and not used

Check failure on line 8 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / lint

"github.com/google/go-github/v69/github" imported and not used

Check failure on line 8 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (macos-latest)

"github.com/google/go-github/v69/github" imported and not used

Check failure on line 8 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (windows-latest)

"github.com/google/go-github/v69/github" imported and not used

Check failure on line 8 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

"github.com/google/go-github/v69/github" imported and not used

Check failure on line 8 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (windows-latest)

"github.com/google/go-github/v69/github" imported and not used
"github.com/migueleliasweb/go-github-mock/src/mock"

Check failure on line 9 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (macos-latest)

"github.com/migueleliasweb/go-github-mock/src/mock" imported and not used

Check failure on line 9 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / lint

"github.com/migueleliasweb/go-github-mock/src/mock" imported and not used

Check failure on line 9 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

"github.com/migueleliasweb/go-github-mock/src/mock" imported and not used

Check failure on line 9 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / lint

"github.com/migueleliasweb/go-github-mock/src/mock" imported and not used

Check failure on line 9 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (macos-latest)

"github.com/migueleliasweb/go-github-mock/src/mock" imported and not used

Check failure on line 9 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (windows-latest)

"github.com/migueleliasweb/go-github-mock/src/mock" imported and not used

Check failure on line 9 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

"github.com/migueleliasweb/go-github-mock/src/mock" imported and not used

Check failure on line 9 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (windows-latest)

"github.com/migueleliasweb/go-github-mock/src/mock" imported and not used
"github.com/stretchr/testify/assert"

Check failure on line 10 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (macos-latest)

"github.com/stretchr/testify/assert" imported and not used

Check failure on line 10 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / lint

"github.com/stretchr/testify/assert" imported and not used

Check failure on line 10 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

"github.com/stretchr/testify/assert" imported and not used

Check failure on line 10 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / lint

"github.com/stretchr/testify/assert" imported and not used

Check failure on line 10 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (macos-latest)

"github.com/stretchr/testify/assert" imported and not used

Check failure on line 10 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (windows-latest)

"github.com/stretchr/testify/assert" imported and not used

Check failure on line 10 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

"github.com/stretchr/testify/assert" imported and not used

Check failure on line 10 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (windows-latest)

"github.com/stretchr/testify/assert" imported and not used
"github.com/stretchr/testify/require"

Check failure on line 11 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (macos-latest)

"github.com/stretchr/testify/require" imported and not used

Check failure on line 11 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / lint

"github.com/stretchr/testify/require" imported and not used (typecheck)

Check failure on line 11 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

"github.com/stretchr/testify/require" imported and not used

Check failure on line 11 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / lint

"github.com/stretchr/testify/require" imported and not used (typecheck)

Check failure on line 11 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (macos-latest)

"github.com/stretchr/testify/require" imported and not used

Check failure on line 11 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (windows-latest)

"github.com/stretchr/testify/require" imported and not used

Check failure on line 11 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

"github.com/stretchr/testify/require" imported and not used

Check failure on line 11 in pkg/github/discussions_test.go

View workflow job for this annotation

GitHub Actions / build (windows-latest)

"github.com/stretchr/testify/require" imported and not used
)

func Test_ListDiscussions(t *testing.T) {
// Test implementation here
}

func Test_GetDiscussion(t *testing.T) {
// Test implementation here
}

func Test_CreateDiscussion(t *testing.T) {
// Test implementation here
}

func Test_AddDiscussionComment(t *testing.T) {
// Test implementation here
}
Loading