feat: Add simple CRUD endpoints for GitHub Copilot Spaces#4379
feat: Add simple CRUD endpoints for GitHub Copilot Spaces#4379Ackberry wants to merge 14 commits into
Conversation
|
@Ackberry - please run step 4 of CONTRIBUTING.md and push the changes to this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4379 +/- ##
=======================================
Coverage 97.52% 97.53%
=======================================
Files 193 193
Lines 19668 19737 +69
=======================================
+ Hits 19182 19251 +69
Misses 268 268
Partials 218 218 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
fixed lint errors. |
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @Ackberry!
Now please work through the official GitHub v3 API documentation and find the "required" fields for each struct and make them values instead of pointers, and remove the omitempty from the required fields. If fields are shared by multiple endpoints and sometimes they are optional and sometimes they are required, then we do actually want to leave them as pointers with omitempty as they are not ALWAYS required. However, if they are ALWAYS required, then please use values and no omitempty.
Here's an example of what I'm talking about:
|
okay, instead of all being optional at the moment, I would set the required ones intact as per github docs. on it! |
gmlewis
left a comment
There was a problem hiding this comment.
Whups, I didn't wait for the linter again.
Please follow step 4 of CONTRIBUTING.md and push the changes to this PR.
|
the workflow returned a 502 error, perhaps you can rerun the workflow? might be an issue on github api side |
Sorry about that... my bad! Reran and all is well. |
|
sounds good! will get to the next PR now. Will share my plan on the issue before proceeding |
|
I split the create and update endpoint structs, and also created a new metadata struct. For metadata tests, I only used the name and text because all other metadata fields use the same JSON struct-tag marshal/unmarshal path. That said, I can add a focused issue/PR metadata case if you’d prefer explicit coverage for those resource items. |
| Text *string `json:"text,omitempty"` | ||
| Name *string `json:"name,omitempty"` | ||
| Number *int `json:"number,omitempty"` | ||
| CopilotChatAttachmentID *string `json:"copilot_chat_attachment_id,omitempty"` |
There was a problem hiding this comment.
Looks like we should change *string to *int:
copilot_chat_attachment_id:
type: integer
format: int64
nullable: true
description: The unique identifier of the chat attachment for uploaded
files or media content.The same for other places in the PR.

Adds support for the core organization Copilot Spaces endpoints:
Solves #4238 partially.