refactor!: Rename EditLabel to UpdateLabel, Split Label into CreateLabelRequest & UpdateLabelRequest and pass by value#4400
Merged
gmlewis merged 3 commits intoJul 22, 2026
Conversation
…est` and pass by value Towards google#3644. BREAKING CHANGE: `IssuesService.CreateLabel` now takes a `CreateLabelRequest` by value (with a required non-pointer `Name`), and `IssuesService.EditLabel` takes an `UpdateLabelRequest` by value instead of a `*Label`. The update endpoint expects the rename field as `new_name`, not `name`.
Label into CreateLabelRequest & UpdateLabelRequest and pass by valueEditLabel to UpdateLabel, Split Label into CreateLabelRequest & UpdateLabelRequest and pass by value
Towards: google#3644 BREAKING CHANGE: `Issues.EditLabel` renamed to `UpdateLabel`
alexandear
suggested changes
Jul 22, 2026
alexandear
left a comment
Contributor
There was a problem hiding this comment.
Please also fix the Label struct according to the schema.
Comment on lines
+28
to
+36
| // CreateLabelRequest represents a request to create a label. | ||
| type CreateLabelRequest struct { | ||
| Name string `json:"name"` | ||
| Color *string `json:"color,omitempty"` | ||
| Description *string `json:"description,omitempty"` | ||
| } | ||
|
|
||
| // UpdateLabelRequest represents a request to update a label. | ||
| type UpdateLabelRequest struct { |
Contributor
There was a problem hiding this comment.
CreateLabelRequest, UpdateLabelRequest are too broad. Let's add a prefix:
Suggested change
| // CreateLabelRequest represents a request to create a label. | |
| type CreateLabelRequest struct { | |
| Name string `json:"name"` | |
| Color *string `json:"color,omitempty"` | |
| Description *string `json:"description,omitempty"` | |
| } | |
| // UpdateLabelRequest represents a request to update a label. | |
| type UpdateLabelRequest struct { | |
| // IssueCreateLabelRequest represents a request to create a label. | |
| type CreateLabelRequest struct { | |
| Name string `json:"name"` | |
| Color *string `json:"color,omitempty"` | |
| Description *string `json:"description,omitempty"` | |
| } | |
| // IssueUpdateLabelRequest represents a request to update a label. | |
| type UpdateLabelRequest struct { |
Contributor
Author
There was a problem hiding this comment.
I left the verb at the start, as that seems to align more with the rest of the repository. Always happy to be challenged here.
…struct with schema Towards google#3644. BREAKING CHANGE: - Rename `CreateLabelRequest`/`UpdateLabelRequest` to `CreateIssueLabelRequest`/`UpdateIssueLabelReques ` (verb-first, consistent with `CreateIssueRequest`). - Align the `Label` response struct with the schema: the always-present fields (`id`, `url`, `name`, `color`, `default`, `node_id`) are now non-pointer, while nullable `description` stays `*string`.
alexandear
approved these changes
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continues the request-body-by-value work in #3644, for
IssuesService.Label.BREAKING CHANGE:
IssuesService.CreateLabelnow takes aCreateLabelRequestby value (with a required non-pointerName).IssuesService.EditLabelrenamed toUpdateLabel, taking anUpdateLabelRequestby value instead of a*Label(with all fields optional).Notes
new_name, notnamewhich appears to have been a latent bug.cc @JamBalaya56562 flagging for #3644 coordination