feat: Add issue field values support for write and read#4200
feat: Add issue field values support for write and read#4200gmlewis merged 1 commit intogoogle:masterfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4200 +/- ##
=======================================
Coverage 93.71% 93.71%
=======================================
Files 209 209
Lines 19772 19772
=======================================
Hits 18529 18529
Misses 1046 1046
Partials 197 197 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @iulia-b and @alondahari!
LGTM.
Merging.
|
|
||
| // IssueFieldValueSingleSelectOption represents a single-select option for an issue field value. | ||
| // | ||
| // GitHub API docs: https://docs.github.com/rest/issues/issues#get-an-issue |
There was a problem hiding this comment.
| // GitHub API docs: https://docs.github.com/rest/issues/issues#get-an-issue | |
| // GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#get-an-issue |
| // The Value field contains a string for text, single_select, and date fields, | ||
| // or a number for numeric fields. | ||
| // | ||
| // GitHub API docs: https://docs.github.com/rest/issues/issues#get-an-issue |
There was a problem hiding this comment.
| // GitHub API docs: https://docs.github.com/rest/issues/issues#get-an-issue | |
| // GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#get-an-issue |
| ID *int64 `json:"id,omitempty"` | ||
| Name *string `json:"name,omitempty"` | ||
| Color *string `json:"color,omitempty"` |
There was a problem hiding this comment.
These fields are all required:
| ID *int64 `json:"id,omitempty"` | |
| Name *string `json:"name,omitempty"` | |
| Color *string `json:"color,omitempty"` | |
| ID int64 `json:"id"` | |
| Name string `json:"name"` | |
| Color string `json:"color"` |
See
"single_select_option": {
"description": "Details about the selected option (only present for single_select fields)",
"type": [
"object",
"null"
],
"properties": {
"id": {
"description": "Unique identifier for the option.",
"type": "integer",
"format": "int64"
},
"name": {
"description": "The name of the option",
"type": "string"
},
"color": {
"description": "The color of the option",
"type": "string"
}
},
"required": [
"id",
"name",
"color"
]
}
| IssueFieldID *int64 `json:"issue_field_id,omitempty"` | ||
| NodeID *string `json:"node_id,omitempty"` | ||
| DataType *string `json:"data_type,omitempty"` | ||
| Value any `json:"value,omitempty"` |
There was a problem hiding this comment.
All these fields are required according to the schema:
| IssueFieldID *int64 `json:"issue_field_id,omitempty"` | |
| NodeID *string `json:"node_id,omitempty"` | |
| DataType *string `json:"data_type,omitempty"` | |
| Value any `json:"value,omitempty"` | |
| IssueFieldID int64 `json:"issue_field_id"` | |
| NodeID string `json:"node_id"` | |
| DataType string `json:"data_type"` | |
| Value any `json:"value"` |
|
Whups, my bad. I apologize. @iulia-b - can you please open a new PR to address these issues? |
| Milestone *int `json:"milestone,omitempty"` | ||
| Assignees *[]string `json:"assignees,omitempty"` | ||
| Type *string `json:"type,omitempty"` | ||
| IssueFieldValues []*IssueFieldValue `json:"issue_field_values,omitempty"` |
There was a problem hiding this comment.
I don't think we can add []*IssueFieldValue to IssueRequest, We should create a new struct for it bcuz
IssueFieldValue have these field -
- issue_field_id (required)
- node_id (required)
- data_type (required)
- value (required)
- single_select_option
Whereas issue_field_values only accepts the following fields in the array
- field_id (required)
- value (required)
https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#update-an-issue
Issue Fields are a new feature that is about to GA for GitHub. The Rest API provides support for reading fields on an issue or setting them, as mentioned in #4194.
Updating the structures in this lib will enable support for fields for all the consumers, enabling discovery of this feature.