Skip to content

Commit 8fb2181

Browse files
committed
Add basic project view management
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c6f8ede6-efee-4191-900d-59a1bb0af000
1 parent eb088df commit 8fb2181

9 files changed

Lines changed: 1138 additions & 13 deletions

File tree

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,7 @@ The following sets of tools are available:
10971097
- `owner_type`: Owner type (user or org). If not provided, will be automatically detected. (string, optional)
10981098
- `project_number`: The project's number. (number, optional)
10991099
- `status_update_id`: The node ID of the project status update. Required for 'get_project_status_update' method. (string, optional)
1100+
- `view_id`: The node ID of the project view. Required for 'get_project_view' method. (string, optional)
11001101

11011102
- **projects_list** - List GitHub Projects resources
11021103
- **Required OAuth Scopes**: `read:project`
@@ -1109,21 +1110,24 @@ The following sets of tools are available:
11091110
- `owner`: The owner (user or organization login). The name is not case sensitive. (string, required)
11101111
- `owner_type`: Owner type (user or org). If not provided, will automatically try both. (string, optional)
11111112
- `per_page`: Results per page (max 50) (number, optional)
1112-
- `project_number`: The project's number. Required for 'list_project_fields', 'list_project_items', and 'list_project_status_updates' methods. (number, optional)
1113+
- `project_number`: The project's number. Required for 'list_project_fields', 'list_project_items', 'list_project_views', and 'list_project_status_updates' methods. (number, optional)
11131114
- `query`: Filter/query string. For list_projects: filter by title text and state (e.g. "roadmap is:open"). For list_project_items: advanced filtering using GitHub's project filtering syntax. (string, optional)
11141115

11151116
- **projects_write** - Manage GitHub Projects
11161117
- **Required OAuth Scopes**: `project`
11171118
- `body`: The body of the status update (markdown). Used for 'create_project_status_update' method. (string, optional)
11181119
- `field_name`: The name of the iteration field (e.g. 'Sprint'). Required for 'create_iteration_field' method. (string, optional)
1120+
- `filter`: The saved view filter. Optional for create and update; pass an empty string to clear it on update. (string, optional)
11191121
- `issue_number`: The issue number. Required for 'add_project_item' when item_type is 'issue'. Also accepted by 'update_project_item' to resolve the item by issue number (combine with item_owner and item_repo). (number, optional)
11201122
- `item_id`: The project item ID. Required for 'delete_project_item'. For 'update_project_item', provide either item_id, or (item_owner + item_repo + issue_number) to resolve the item by issue. (number, optional)
11211123
- `item_owner`: The owner (user or organization) of the repository containing the issue or pull request. Required for 'add_project_item' method. Also accepted by 'update_project_item' when resolving the item by issue number. (string, optional)
11221124
- `item_repo`: The name of the repository containing the issue or pull request. Required for 'add_project_item' method. Also accepted by 'update_project_item' when resolving the item by issue number. (string, optional)
11231125
- `item_type`: The item's type, either issue or pull_request. Required for 'add_project_item' method. (string, optional)
11241126
- `iteration_duration`: Duration in days for iterations of the field (e.g. 7 for weekly, 14 for bi-weekly). Required for 'create_iteration_field' method. (number, optional)
11251127
- `iterations`: Custom iterations for 'create_iteration_field' method. Only set this when you need iterations with varying durations, breaks between them, or specific titles. Otherwise omit it: GitHub auto-creates three iterations of 'iteration_duration' days starting on 'start_date', which is the right choice for most cases. (object[], optional)
1128+
- `layout`: The view layout. Required for 'create_project_view'; optional for 'update_project_view'. (string, optional)
11261129
- `method`: The method to execute (string, required)
1130+
- `name`: The view name. Required for 'create_project_view'; optional for 'update_project_view'. (string, optional)
11271131
- `owner`: The project owner (user or organization login). The name is not case sensitive. (string, required)
11281132
- `owner_type`: Owner type (user or org). Required for 'create_project' method. If not provided for other methods, will be automatically detected. (string, optional)
11291133
- `project_number`: The project's number. Required for all methods except 'create_project'. (number, optional)
@@ -1133,6 +1137,8 @@ The following sets of tools are available:
11331137
- `target_date`: The target date of the status update in YYYY-MM-DD format. Used for 'create_project_status_update' method. (string, optional)
11341138
- `title`: The project title. Required for 'create_project' method. (string, optional)
11351139
- `updated_field`: Object describing the field to update and its new value. Required for 'update_project_item'. Two shapes are accepted: (1) by ID — {"id": 123456, "value": "..."}; (2) by name — {"name": "Status", "value": "In Progress"}. For single-select fields, option-name resolution requires the by-name shape; on the by-ID shape, pass the option ID. Set value to null to clear the field. (object, optional)
1140+
- `view_id`: The project view node ID. Required for 'update_project_view' and 'delete_project_view'. (string, optional)
1141+
- `visible_fields`: Project field database IDs to display when creating a table or board view. Create-only; not supported for roadmap views. (string[], optional)
11361142

11371143
</details>
11381144

pkg/github/__toolsnaps__/projects_get.snap

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"readOnlyHint": true,
55
"title": "Get details of GitHub Projects resources"
66
},
7-
"description": "Get details about specific GitHub Projects resources.\nUse this tool to get details about individual projects, project fields, and project items by their unique IDs.\n",
7+
"description": "Get details about specific GitHub Projects resources.\nUse this tool to get details about individual projects, project fields, project items, and project views by their unique IDs.\n",
88
"inputSchema": {
99
"properties": {
1010
"field_id": {
@@ -35,7 +35,8 @@
3535
"get_project",
3636
"get_project_field",
3737
"get_project_item",
38-
"get_project_status_update"
38+
"get_project_status_update",
39+
"get_project_view"
3940
],
4041
"type": "string"
4142
},
@@ -58,6 +59,10 @@
5859
"status_update_id": {
5960
"description": "The node ID of the project status update. Required for 'get_project_status_update' method.",
6061
"type": "string"
62+
},
63+
"view_id": {
64+
"description": "The node ID of the project view. Required for 'get_project_view' method.",
65+
"type": "string"
6166
}
6267
},
6368
"required": [

pkg/github/__toolsnaps__/projects_list.snap

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"readOnlyHint": true,
55
"title": "List GitHub Projects resources"
66
},
7-
"description": "Tools for listing GitHub Projects resources.\nUse this tool to list projects for a user or organization, or list project fields and items for a specific project.\n",
7+
"description": "Tools for listing GitHub Projects resources.\nUse this tool to list projects for a user or organization, or list project fields, items, views, and status updates for a specific project.\n",
88
"inputSchema": {
99
"properties": {
1010
"after": {
@@ -35,7 +35,8 @@
3535
"list_projects",
3636
"list_project_fields",
3737
"list_project_items",
38-
"list_project_status_updates"
38+
"list_project_status_updates",
39+
"list_project_views"
3940
],
4041
"type": "string"
4142
},
@@ -56,7 +57,7 @@
5657
"type": "number"
5758
},
5859
"project_number": {
59-
"description": "The project's number. Required for 'list_project_fields', 'list_project_items', and 'list_project_status_updates' methods.",
60+
"description": "The project's number. Required for 'list_project_fields', 'list_project_items', 'list_project_views', and 'list_project_status_updates' methods.",
6061
"type": "number"
6162
},
6263
"query": {

pkg/github/__toolsnaps__/projects_write.snap

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"readOnlyHint": false,
66
"title": "Manage GitHub Projects"
77
},
8-
"description": "Create and manage GitHub Projects: create projects, add/update/delete items, create status updates, and add iteration fields.",
8+
"description": "Create and manage GitHub Projects: create projects, manage items and views, create status updates, and add iteration fields.",
99
"inputSchema": {
1010
"properties": {
1111
"body": {
@@ -16,6 +16,10 @@
1616
"description": "The name of the iteration field (e.g. 'Sprint'). Required for 'create_iteration_field' method.",
1717
"type": "string"
1818
},
19+
"filter": {
20+
"description": "The saved view filter. Optional for create and update; pass an empty string to clear it on update.",
21+
"type": "string"
22+
},
1923
"issue_number": {
2024
"description": "The issue number. Required for 'add_project_item' when item_type is 'issue'. Also accepted by 'update_project_item' to resolve the item by issue number (combine with item_owner and item_repo).",
2125
"type": "number"
@@ -71,18 +75,34 @@
7175
},
7276
"type": "array"
7377
},
78+
"layout": {
79+
"description": "The view layout. Required for 'create_project_view'; optional for 'update_project_view'.",
80+
"enum": [
81+
"table",
82+
"board",
83+
"roadmap"
84+
],
85+
"type": "string"
86+
},
7487
"method": {
7588
"description": "The method to execute",
7689
"enum": [
7790
"add_project_item",
7891
"update_project_item",
7992
"delete_project_item",
8093
"create_project_status_update",
94+
"create_project_view",
95+
"update_project_view",
96+
"delete_project_view",
8197
"create_project",
8298
"create_iteration_field"
8399
],
84100
"type": "string"
85101
},
102+
"name": {
103+
"description": "The view name. Required for 'create_project_view'; optional for 'update_project_view'.",
104+
"type": "string"
105+
},
86106
"owner": {
87107
"description": "The project owner (user or organization login). The name is not case sensitive.",
88108
"type": "string"
@@ -129,6 +149,17 @@
129149
"updated_field": {
130150
"description": "Object describing the field to update and its new value. Required for 'update_project_item'. Two shapes are accepted: (1) by ID — {\"id\": 123456, \"value\": \"...\"}; (2) by name — {\"name\": \"Status\", \"value\": \"In Progress\"}. For single-select fields, option-name resolution requires the by-name shape; on the by-ID shape, pass the option ID. Set value to null to clear the field.",
131151
"type": "object"
152+
},
153+
"view_id": {
154+
"description": "The project view node ID. Required for 'update_project_view' and 'delete_project_view'.",
155+
"type": "string"
156+
},
157+
"visible_fields": {
158+
"description": "Project field database IDs to display when creating a table or board view. Create-only; not supported for roadmap views.",
159+
"items": {
160+
"type": "string"
161+
},
162+
"type": "array"
132163
}
133164
},
134165
"required": [

pkg/github/minimal_types.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,15 @@ type MinimalProject struct {
351351
OwnerType string `json:"owner_type,omitempty"`
352352
}
353353

354+
type MinimalProjectView struct {
355+
ID string `json:"id"`
356+
Number int `json:"number"`
357+
Name string `json:"name"`
358+
Layout string `json:"layout"`
359+
Filter string `json:"filter"`
360+
VisibleFields []int64 `json:"visible_fields,omitempty"`
361+
}
362+
354363
type MinimalProjectItem struct {
355364
ID int64 `json:"id"`
356365
NodeID string `json:"node_id,omitempty"`

0 commit comments

Comments
 (0)