Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cleanup#628

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JoannaaKL merged 2 commits intogithub:mainfromJoannaaKL:cleanup
Jul 2, 2025
Merged
Show file tree
Hide file tree
Changes fromall 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
2 changes: 1 addition & 1 deletion.github/workflows/go.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ jobs:
run: go mod download

- name: Run unit tests
run:go test -race ./...
run:script/test

- name: Build
run: go build -v ./cmd/github-mcp-server
50 changes: 0 additions & 50 deletionspkg/github/discussions.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,56 +13,6 @@ import (
"github.com/shurcooL/githubv4"
)

// GetAllDiscussionCategories retrieves all discussion categories for a repository
// by paginating through all pages and returns them as a map where the key is the
// category name and the value is the category ID.
func GetAllDiscussionCategories(ctx context.Context, client *githubv4.Client, owner, repo string) (map[string]string, error) {
categories := make(map[string]string)
var after string
hasNextPage := true

for hasNextPage {
// Prepare GraphQL query with pagination
var q struct {
Repository struct {
DiscussionCategories struct {
Nodes []struct {
ID githubv4.ID
Name githubv4.String
}
PageInfo struct {
HasNextPage githubv4.Boolean
EndCursor githubv4.String
}
} `graphql:"discussionCategories(first: 100, after: $after)"`
} `graphql:"repository(owner: $owner, name: $repo)"`
}

vars := map[string]interface{}{
"owner": githubv4.String(owner),
"repo": githubv4.String(repo),
"after": githubv4.String(after),
}

if err := client.Query(ctx, &q, vars); err != nil {
return nil, fmt.Errorf("failed to query discussion categories: %w", err)
}

// Add categories to the map
for _, category := range q.Repository.DiscussionCategories.Nodes {
categories[string(category.Name)] = fmt.Sprint(category.ID)
}

// Check if there are more pages
hasNextPage = bool(q.Repository.DiscussionCategories.PageInfo.HasNextPage)
if hasNextPage {
after = string(q.Repository.DiscussionCategories.PageInfo.EndCursor)
}
}

return categories, nil
}

func ListDiscussions(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (tool mcp.Tool, handler server.ToolHandlerFunc) {
return mcp.NewTool("list_discussions",
mcp.WithDescription(t("TOOL_LIST_DISCUSSIONS_DESCRIPTION", "List discussions for a repository")),
Expand Down
1 change: 0 additions & 1 deletionscript/lint
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,6 @@ BINDIR="$(git rev-parse --show-toplevel)"/bin
BINARY=$BINDIR/golangci-lint
GOLANGCI_LINT_VERSION=v2.2.1


if [ ! -f "$BINARY" ]; then
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s "$GOLANGCI_LINT_VERSION"
fi
Expand Down
3 changes: 3 additions & 0 deletionsscript/test
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
set -eu

go test -race ./...

[8]ページ先頭

©2009-2025 Movatter.jp