refactor!: Rename EditMilestone to UpdateMilestone, split Milestone request bodies into CreateMilestoneRequest and UpdateMilestoneRequest, and pass by value - #4438
Open
JamBalaya56562 wants to merge 1 commit into
Conversation
…one` request bodies into `CreateMilestoneRequest` and `UpdateMilestoneRequest`, and pass by value CreateMilestone and EditMilestone reused the 16-field Milestone response type as their request bodies, but the endpoints accept only title, state, description and due_on, and their schemas differ: title is required on create and optional on update. The new request types model each schema exactly (non-pointer Title on create) and are passed by value. EditMilestone is renamed to UpdateMilestone to match the docs operation name. The Milestone response type stays unchanged, and its entry is removed from the .golangci.yml allowlist. BREAKING CHANGE: IssuesService.CreateMilestone now takes a new CreateMilestoneRequest (with non-pointer Title) by value, and IssuesService.EditMilestone is renamed to UpdateMilestone and takes a new UpdateMilestoneRequest by value, instead of *Milestone.
gmlewis
approved these changes
Aug 6, 2026
gmlewis
left a comment
Collaborator
There was a problem hiding this comment.
Thank you, @JamBalaya56562!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
Collaborator
|
Closing and reopening to force all the GitHub Actions workflows to fire properly after today's GitHub outage. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4438 +/- ##
=======================================
Coverage 97.55% 97.55%
=======================================
Files 194 194
Lines 19892 19892
=======================================
Hits 19406 19406
Misses 268 268
Partials 218 218 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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, this time for the milestone endpoints on
IssuesService.CreateMilestoneandEditMilestonereused the 16-fieldMilestoneresponse type as their request bodies, but per the docs the endpoints accept only four parameters — the other twelve fields (url,number,creator,open_issues,created_at, …) are server-generated. And the two schemas differ:titlestatedescriptiondue_onSo this splits the request body into two dedicated types, following the same approach as #4382, #4401 and the
Issues-service splits in #4396/#4400:CreateMilestoneRequest—Titleis a non-pointerstring(noomitempty) since it's required; the rest stay pointers.UpdateMilestoneRequest— every field is optional, so all stay pointers.EditMilestoneis renamed toUpdateMilestoneto match the docs operation name, Update a milestone (same convention asEditLabel→UpdateLabelin #4400). Both methods now take their body by value, andMilestoneis removed from thebody-allowed-pointer-typesallowlist. TheMilestoneresponse type itself is unchanged.Verified with
go build ./...,go vet -tags integration ./test/integration/,gofmt, the full./github/test suite (both methods and the eight generated accessors at 100%), andcustom-gcl(noparamcheckfindings after removing the allowlist entry).Updates #3644
BREAKING CHANGE: IssuesService.CreateMilestone now takes a new CreateMilestoneRequest (with non-pointer Title) by value, and IssuesService.EditMilestone is renamed to UpdateMilestone and takes a new UpdateMilestoneRequest by value, instead of *Milestone.
cc @jvm986 — this one is in the
Issuesservice, which you'd been working through; since it's been a couple of weeks I picked up the next item, but happy to coordinate again whenever you resume.