Skip to content

refactor!: Split CreateOrUpdateIssueTypesOptions into CreateIssueTypeRequest and UpdateIssueTypeRequest and pass by value - #4615

Open
jvm986 wants to merge 1 commit into
google:masterfrom
jvm986:refactor-issue-types-request
Open

jvm986 wants to merge 1 commit into
google:masterfrom
jvm986:refactor-issue-types-request

Conversation

@jvm986

@jvm986 jvm986 commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Updates #3644

This splits CreateOrUpdateIssueTypesOptions into two request types and passes them by value, matching the split done for custom repository roles in #4401.

Old New Method
CreateOrUpdateIssueTypesOptions CreateIssueTypeRequest CreateIssueType
CreateOrUpdateIssueTypesOptions UpdateIssueTypeRequest UpdateIssueType

Both create and update currently take the same body (name and is_enabled required, description and color optional), but they are split to keep the two operations independent, in line with the other request types under #3644. IsPrivate is removed because is_private is not in either request body schema. The type is removed from the body-allowed-pointer-types and body-allowed-wrong-names lists in .golangci.yml, and the UpdateIssueType doc comment, which described GitHub Pages, is corrected.

BREAKING CHANGE: CreateOrUpdateIssueTypesOptions is split into CreateIssueTypeRequest and UpdateIssueTypeRequest; OrganizationsService.CreateIssueType and UpdateIssueType now take them by value; IsPrivate is removed.

cc @JamBalaya56562 @ManavSharma142 for #3644 coordination.

…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.
@jvm986
jvm986 marked this pull request as ready for review October 13, 2026 08:07
@gmlewis gmlewis added NeedsReview PR is awaiting a review before merging. Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). labels Oct 13, 2026
@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.61%. Comparing base (e754d2c) to head (b31afcb).
⚠️ Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmlewis gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @jvm986!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

@stevehipwell - @Not-Dhananjay-Mishra - @JamBalaya56562

@JamBalaya56562 JamBalaya56562 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants