Repository navigation
refactor!: Split CreateOrUpdateIssueTypesOptions into CreateIssueTypeRequest and UpdateIssueTypeRequest and pass by value - #4615
Conversation
…ypeRequest` and `UpdateIssueTypeRequest` and pass by value BREAKING CHANGE: `CreateOrUpdateIssueTypesOptions` is split into `CreateIssueTypeRequest` and `UpdateIssueTypeRequest`; `OrganizationsService.CreateIssueType` and `UpdateIssueType` now take these request types by value. The `IsPrivate` field is removed as it is not part of either endpoint's documented request body.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4615 +/- ##
=======================================
Coverage 98.61% 98.61%
=======================================
Files 199 199
Lines 18693 18693
=======================================
Hits 18435 18435
Misses 258 258 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
JamBalaya56562
left a comment
There was a problem hiding this comment.
LGTM. I checked both request types against the organization-create-issue-type / organization-update-issue-type schemas (required name/is_enabled, optional description/color, no is_private), and the branch also merges cleanly onto current master with tests and lint passing.
Nit (non-blocking): the Color comment still lists "null" as a value, but the API rejects it — sending "color": "null" returns 422 Invalid property /color: `null` is not a possible value. Must be one of the following: gray, blue, green, yellow, orange, red, pink, purple. — so it may be clearer to drop "null" from the list.
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @JamBalaya56562! I added your suggestions, since I think it would be best to address those findings now rather than later.
| IsPrivate *bool `json:"is_private,omitempty"` // Whether or not the issue type is restricted to issues in private repositories. (Optional.) | ||
| Description *string `json:"description,omitempty"` // Description of the issue type. (Optional.) | ||
| Color *string `json:"color,omitempty"` // Color for the issue type. Can be one of "gray", "blue", green "orange", "red", "pink", "purple", "null". (Optional.) | ||
| Color *string `json:"color,omitempty"` // Color for the issue type. Can be one of "gray", "blue", "green", "yellow", "orange", "red", "pink", "purple", "null". (Optional.) |
There was a problem hiding this comment.
| Color *string `json:"color,omitempty"` // Color for the issue type. Can be one of "gray", "blue", "green", "yellow", "orange", "red", "pink", "purple", "null". (Optional.) | |
| Color *string `json:"color,omitempty"` // Color for the issue type. Can be one of "gray", "blue", "green", "yellow", "orange", "red", "pink", "purple". (Optional.) |
| Name string `json:"name"` // Name of the issue type. (Required.) | ||
| IsEnabled bool `json:"is_enabled"` // Whether or not the issue type is enabled at the organization level. (Required.) | ||
| Description *string `json:"description,omitempty"` // Description of the issue type. (Optional.) | ||
| Color *string `json:"color,omitempty"` // Color for the issue type. Can be one of "gray", "blue", "green", "yellow", "orange", "red", "pink", "purple", "null". (Optional.) |
There was a problem hiding this comment.
| Color *string `json:"color,omitempty"` // Color for the issue type. Can be one of "gray", "blue", "green", "yellow", "orange", "red", "pink", "purple", "null". (Optional.) | |
| Color *string `json:"color,omitempty"` // Color for the issue type. Can be one of "gray", "blue", "green", "yellow", "orange", "red", "pink", "purple". (Optional.) |
Updates #3644
This splits
CreateOrUpdateIssueTypesOptionsinto two request types and passes them by value, matching the split done for custom repository roles in #4401.CreateOrUpdateIssueTypesOptionsCreateIssueTypeRequestCreateIssueTypeCreateOrUpdateIssueTypesOptionsUpdateIssueTypeRequestUpdateIssueTypeBoth create and update currently take the same body (
nameandis_enabledrequired,descriptionandcoloroptional), but they are split to keep the two operations independent, in line with the other request types under #3644.IsPrivateis removed becauseis_privateis not in either request body schema. The type is removed from thebody-allowed-pointer-typesandbody-allowed-wrong-nameslists in.golangci.yml, and theUpdateIssueTypedoc comment, which described GitHub Pages, is corrected.BREAKING CHANGE:
CreateOrUpdateIssueTypesOptionsis split intoCreateIssueTypeRequestandUpdateIssueTypeRequest;OrganizationsService.CreateIssueTypeandUpdateIssueTypenow take them by value;IsPrivateis removed.cc @JamBalaya56562 @ManavSharma142 for #3644 coordination.