Repository navigation
refactor!: Rename LockIssueOptions, PullRequestBranchUpdateOptions, and UserSuspendOptions to ...Request and pass them by value - #4612
Merged
gmlewis merged 2 commits intoOct 13, 2026
Conversation
…`, and `UserSuspendOptions` to `...Request` and pass them by value
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4612 +/- ##
=======================================
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:
|
gmlewis
approved these changes
Oct 12, 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
|
Thank you, @jvm986! |
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.
Updates #3644.
BREAKING CHANGE:
LockIssueOptions,PullRequestBranchUpdateOptions, andUserSuspendOptionsare renamed toLockIssueRequest,UpdatePullRequestBranchRequest, andSuspendUserRequestand are passed by value toIssuesService.Lock,PullRequestsService.UpdateBranch, andUsersService.Suspend;LockIssueRequest.LockReasonis now*string.This PR converts the three remaining single-method request body types that still use the
Optionssuffix:*LockIssueOptionsLockIssueRequestIssuesService.LockPUT /repos/{owner}/{repo}/issues/{issue_number}/lock*PullRequestBranchUpdateOptionsUpdatePullRequestBranchRequestPullRequestsService.UpdateBranchPUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch*UserSuspendOptionsSuspendUserRequestUsersService.SuspendPUT /users/{username}/suspended(GHES)Two commits:
fix!-LockIssueOptions.LockReasonbecomes*string. The field is optional in the OpenAPI schema (the request body itself is optional and has norequiredlist), and this removes its# TODO: Issuesentry from the structfieldallowed-tag-typeslist.refactor!- Rename the three types to...Requestand pass them by value. All six entries are removed frombody-allowed-pointer-typesandbody-allowed-wrong-names. Tests that passednilnow passXxxRequest{}, the body variables are namedbody, and theLockandUpdateBranchtests now assert the request body withtestJSONBody.The fields of
UpdatePullRequestBranchRequest(expected_head_sha) andSuspendUserRequest(reason) are already optional pointers and match the OpenAPI schemas, so they are unchanged. The method names already match the GitHub docs operation names ("Lock an issue", "Update a pull request branch", "Suspend a user"), so no methods are renamed.Verified locally:
go build ./...,go vet -tags integration ./test/integration/,examplemodule build,go test ./..., generated files idempotent,custom-gcl0 issues, andscript/check-schema-fields.shreports no new issues.