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

Commit6043bec

Browse files
authored
Cleanup (#628)
* Remove unused function and add test script* Call test from the workflow
1 parent39109b3 commit6043bec

File tree

4 files changed

+4
-52
lines changed

4 files changed

+4
-52
lines changed

‎.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run:go mod download
2727

2828
-name:Run unit tests
29-
run:go test -race ./...
29+
run:script/test
3030

3131
-name:Build
3232
run:go build -v ./cmd/github-mcp-server

‎pkg/github/discussions.go

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -13,56 +13,6 @@ import (
1313
"github.com/shurcooL/githubv4"
1414
)
1515

16-
// GetAllDiscussionCategories retrieves all discussion categories for a repository
17-
// by paginating through all pages and returns them as a map where the key is the
18-
// category name and the value is the category ID.
19-
funcGetAllDiscussionCategories(ctx context.Context,client*githubv4.Client,owner,repostring) (map[string]string,error) {
20-
categories:=make(map[string]string)
21-
varafterstring
22-
hasNextPage:=true
23-
24-
forhasNextPage {
25-
// Prepare GraphQL query with pagination
26-
varqstruct {
27-
Repositorystruct {
28-
DiscussionCategoriesstruct {
29-
Nodes []struct {
30-
ID githubv4.ID
31-
Name githubv4.String
32-
}
33-
PageInfostruct {
34-
HasNextPage githubv4.Boolean
35-
EndCursor githubv4.String
36-
}
37-
}`graphql:"discussionCategories(first: 100, after: $after)"`
38-
}`graphql:"repository(owner: $owner, name: $repo)"`
39-
}
40-
41-
vars:=map[string]interface{}{
42-
"owner":githubv4.String(owner),
43-
"repo":githubv4.String(repo),
44-
"after":githubv4.String(after),
45-
}
46-
47-
iferr:=client.Query(ctx,&q,vars);err!=nil {
48-
returnnil,fmt.Errorf("failed to query discussion categories: %w",err)
49-
}
50-
51-
// Add categories to the map
52-
for_,category:=rangeq.Repository.DiscussionCategories.Nodes {
53-
categories[string(category.Name)]=fmt.Sprint(category.ID)
54-
}
55-
56-
// Check if there are more pages
57-
hasNextPage=bool(q.Repository.DiscussionCategories.PageInfo.HasNextPage)
58-
ifhasNextPage {
59-
after=string(q.Repository.DiscussionCategories.PageInfo.EndCursor)
60-
}
61-
}
62-
63-
returncategories,nil
64-
}
65-
6616
funcListDiscussions(getGQLClientGetGQLClientFn,t translations.TranslationHelperFunc) (tool mcp.Tool,handler server.ToolHandlerFunc) {
6717
returnmcp.NewTool("list_discussions",
6818
mcp.WithDescription(t("TOOL_LIST_DISCUSSIONS_DESCRIPTION","List discussions for a repository")),

‎script/lint

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ BINDIR="$(git rev-parse --show-toplevel)"/bin
77
BINARY=$BINDIR/golangci-lint
88
GOLANGCI_LINT_VERSION=v2.2.1
99

10-
1110
if [ ! -f "$BINARY" ]; then
1211
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s "$GOLANGCI_LINT_VERSION"
1312
fi

‎script/test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set -eu
2+
3+
go test -race ./...

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp