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

Add tool for project fields and items#1145

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 14 commits intomainfromadd-discussion-tools
Sep 29, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
14 commits
Select commitHold shift + click to select a range
5b25f55
Add get project fields tool
JoannaaKLSep 26, 2025
e76e309
Data types
JoannaaKLSep 26, 2025
fe1dab5
Docs
JoannaaKLSep 26, 2025
822c930
Update projectNumber's type
JoannaaKLSep 26, 2025
ad5f75c
Add list_project_items tool
JoannaaKLSep 29, 2025
3521c35
Add get_project_item tool
JoannaaKLSep 29, 2025
6112541
Merge branch 'main' into add-discussion-tools
JoannaaKLSep 29, 2025
004edc0
Return minimal project
JoannaaKLSep 29, 2025
7eabb43
Merge remote-tracking branch 'refs/remotes/upstream/add-discussion-to…
JoannaaKLSep 29, 2025
4f1fd45
Merge remote-tracking branch 'refs/remotes/upstream/add-discussion-to…
JoannaaKLSep 29, 2025
6750eb0
Merge remote-tracking branch 'refs/remotes/upstream/add-discussion-to…
JoannaaKLSep 29, 2025
d95c154
Merge remote-tracking branch 'refs/remotes/upstream/add-discussion-to…
JoannaaKLSep 29, 2025
b24bcd9
Merge remote-tracking branch 'refs/remotes/upstream/add-discussion-to…
JoannaaKLSep 29, 2025
32d7809
Remove unused per_page
JoannaaKLSep 29, 2025
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
21 changes: 20 additions & 1 deletionREADME.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -663,11 +663,30 @@ The following sets of tools are available (all are on by default):
- `owner_type`: Owner type (string, required)
- `project_number`: The project's number (number, required)

- **get_project_field** - Get project field
- `field_id`: The field's id. (number, required)
- `owner`: If owner_type == user it is the handle for the GitHub user account. If owner_type == org it is the name of the organization. The name is not case sensitive. (string, required)
- `owner_type`: Owner type (string, required)
- `project_number`: The project's number. (number, required)

- **get_project_item** - Get project item
- `item_id`: The item's ID. (number, required)
- `owner`: If owner_type == user it is the handle for the GitHub user account. If owner_type == org it is the name of the organization. The name is not case sensitive. (string, required)
- `owner_type`: Owner type (string, required)
- `project_number`: The project's number. (number, required)

- **list_project_fields** - List project fields
- `owner`: If owner_type == user it is the handle for the GitHub user account. If owner_type == org it is the name of the organization. The name is not case sensitive. (string, required)
- `owner_type`: Owner type (string, required)
- `per_page`: Number of results per page (max 100, default: 30) (number, optional)
- `projectNumber`: The project's number. (string, required)
- `project_number`: The project's number. (number, required)

- **list_project_items** - List project items
- `owner`: If owner_type == user it is the handle for the GitHub user account. If owner_type == org it is the name of the organization. The name is not case sensitive. (string, required)
- `owner_type`: Owner type (string, required)
- `per_page`: Number of results per page (max 100, default: 30) (number, optional)
- `project_number`: The project's number. (number, required)
- `query`: Search query to filter items (string, optional)

- **list_projects** - List projects
- `owner`: If owner_type == user it is the handle for the GitHub user account. If owner_type == org it is the name of the organization. The name is not case sensitive. (string, required)
Expand Down
39 changes: 39 additions & 0 deletionspkg/github/__toolsnaps__/get_project_field.snap
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
{
"annotations": {
"title": "Get project field",
"readOnlyHint": true
},
"description": "Get Project field for a user or org",
"inputSchema": {
"properties": {
"field_id": {
"description": "The field's id.",
"type": "number"
},
"owner": {
"description": "If owner_type == user it is the handle for the GitHub user account. If owner_type == org it is the name of the organization. The name is not case sensitive.",
"type": "string"
},
"owner_type": {
"description": "Owner type",
"enum": [
"user",
"org"
],
"type": "string"
},
"project_number": {
"description": "The project's number.",
"type": "number"
}
},
"required": [
"owner_type",
"owner",
"project_number",
"field_id"
],
"type": "object"
},
"name": "get_project_field"
}
39 changes: 39 additions & 0 deletionspkg/github/__toolsnaps__/get_project_item.snap
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
{
"annotations": {
"title": "Get project item",
"readOnlyHint": true
},
"description": "Get a specific Project item for a user or org",
"inputSchema": {
"properties": {
"item_id": {
"description": "The item's ID.",
"type": "number"
},
"owner": {
"description": "If owner_type == user it is the handle for the GitHub user account. If owner_type == org it is the name of the organization. The name is not case sensitive.",
"type": "string"
},
"owner_type": {
"description": "Owner type",
"enum": [
"user",
"org"
],
"type": "string"
},
"project_number": {
"description": "The project's number.",
"type": "number"
}
},
"required": [
"owner_type",
"owner",
"project_number",
"item_id"
],
"type": "object"
},
"name": "get_project_item"
}
6 changes: 3 additions & 3 deletionspkg/github/__toolsnaps__/list_project_fields.snap
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,15 +22,15 @@
"description": "Number of results per page (max 100, default: 30)",
"type": "number"
},
"projectNumber": {
"project_number": {
"description": "The project's number.",
"type": "string"
"type": "number"
}
},
"required": [
"owner_type",
"owner",
"projectNumber"
"project_number"
],
"type": "object"
},
Expand Down
42 changes: 42 additions & 0 deletionspkg/github/__toolsnaps__/list_project_items.snap
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
{
"annotations": {
"title": "List project items",
"readOnlyHint": true
},
"description": "List Project items for a user or org",
"inputSchema": {
"properties": {
"owner": {
"description": "If owner_type == user it is the handle for the GitHub user account. If owner_type == org it is the name of the organization. The name is not case sensitive.",
"type": "string"
},
"owner_type": {
"description": "Owner type",
"enum": [
"user",
"org"
],
"type": "string"
},
"per_page": {
"description": "Number of results per page (max 100, default: 30)",
"type": "number"
},
"project_number": {
"description": "The project's number.",
"type": "number"
},
"query": {
"description": "Search query to filter items",
"type": "string"
}
},
"required": [
"owner_type",
"owner",
"project_number"
],
"type": "object"
},
"name": "list_project_items"
}
89 changes: 89 additions & 0 deletionspkg/github/minimal_types.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -114,8 +114,97 @@ type MinimalResponse struct {
URL string `json:"url"`
}

type MinimalProject struct {
ID *int64 `json:"id,omitempty"`
NodeID *string `json:"node_id,omitempty"`
Owner *MinimalUser `json:"owner,omitempty"`
Creator *MinimalUser `json:"creator,omitempty"`
Title *string `json:"title,omitempty"`
Description *string `json:"description,omitempty"`
Public *bool `json:"public,omitempty"`
ClosedAt *github.Timestamp `json:"closed_at,omitempty"`
CreatedAt *github.Timestamp `json:"created_at,omitempty"`
UpdatedAt *github.Timestamp `json:"updated_at,omitempty"`
DeletedAt *github.Timestamp `json:"deleted_at,omitempty"`
Number *int `json:"number,omitempty"`
ShortDescription *string `json:"short_description,omitempty"`
DeletedBy *MinimalUser `json:"deleted_by,omitempty"`
}

type MinimalProjectItem struct {
ID *int64 `json:"id,omitempty"`
NodeID *string `json:"node_id,omitempty"`
ProjectNodeID *string `json:"project_node_id,omitempty"`
ContentNodeID *string `json:"content_node_id,omitempty"`
ProjectURL *string `json:"project_url,omitempty"`
ContentType *string `json:"content_type,omitempty"`
Creator *MinimalUser `json:"creator,omitempty"`
CreatedAt *github.Timestamp `json:"created_at,omitempty"`
UpdatedAt *github.Timestamp `json:"updated_at,omitempty"`
ArchivedAt *github.Timestamp `json:"archived_at,omitempty"`
ItemURL *string `json:"item_url,omitempty"`
Fields []*projectV2Field `json:"fields,omitempty"`
}

// Helper functions

func convertToMinimalProject(fullProject *github.ProjectV2) *MinimalProject {
if fullProject == nil {
return nil
}

return &MinimalProject{
ID: github.Ptr(fullProject.GetID()),
NodeID: github.Ptr(fullProject.GetNodeID()),
Owner: convertToMinimalUser(fullProject.GetOwner()),
Creator: convertToMinimalUser(fullProject.GetCreator()),
Title: github.Ptr(fullProject.GetTitle()),
Description: github.Ptr(fullProject.GetDescription()),
Public: github.Ptr(fullProject.GetPublic()),
ClosedAt: github.Ptr(fullProject.GetClosedAt()),
CreatedAt: github.Ptr(fullProject.GetCreatedAt()),
UpdatedAt: github.Ptr(fullProject.GetUpdatedAt()),
DeletedAt: github.Ptr(fullProject.GetDeletedAt()),
Number: github.Ptr(fullProject.GetNumber()),
ShortDescription: github.Ptr(fullProject.GetShortDescription()),
DeletedBy: convertToMinimalUser(fullProject.GetDeletedBy()),
}
}

func convertToMinimalUser(user *github.User) *MinimalUser {
if user == nil {
return nil
}

return &MinimalUser{
Login: user.GetLogin(),
ID: user.GetID(),
ProfileURL: user.GetHTMLURL(),
AvatarURL: user.GetAvatarURL(),
}
}

func convertToMinimalProjectItem(item *projectV2Item) *MinimalProjectItem {
if item == nil {
return nil
}

return &MinimalProjectItem{
ID: item.ID,
NodeID: item.NodeID,
ProjectNodeID: item.ProjectNodeID,
ContentNodeID: item.ContentNodeID,
ProjectURL: item.ProjectURL,
ContentType: item.ContentType,
Creator: convertToMinimalUser(item.Creator),
CreatedAt: item.CreatedAt,
UpdatedAt: item.UpdatedAt,
ArchivedAt: item.ArchivedAt,
ItemURL: item.ItemURL,
Fields: item.Fields,
}
}

// convertToMinimalCommit converts a GitHub API RepositoryCommit to MinimalCommit
func convertToMinimalCommit(commit *github.RepositoryCommit, includeDiffs bool) MinimalCommit {
minimalCommit := MinimalCommit{
Expand Down
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp