Repository navigation
refactor!: Rename ChecksService ...Options body types to ...Request and SetCheckSuitePreferences to UpdateCheckSuitePreferences - #4704
Merged
gmlewis merged 3 commits intoNov 7, 2026
Conversation
`name` is optional when updating a check run, but `UpdateCheckRunOptions.Name` was always sent, even when empty. `head_branch` is not part of the create check suite schema. `app_id` and `setting` are required in `AutoTriggerCheck`. Use `omitzero` for the optional request slices so that an empty slice can be sent.
…est` and `SetCheckSuitePreferences` to `UpdateCheckSuitePreferences`
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4704 +/- ##
=======================================
Coverage 98.64% 98.64%
=======================================
Files 204 204
Lines 19080 19080
=======================================
Hits 18822 18822
Misses 258 258 ☔ 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.
Updates #3644.
BREAKING CHANGE:
CreateCheckRunOptions,UpdateCheckRunOptions,CheckSuitePreferenceOptions, andCreateCheckSuiteOptionsare renamed toCreateCheckRunRequest,UpdateCheckRunRequest,UpdateCheckSuitePreferencesRequest, andCreateCheckSuiteRequest;ChecksService.SetCheckSuitePreferencesis renamed toChecksService.UpdateCheckSuitePreferences;UpdateCheckRunRequest.Nameis now*string;CreateCheckSuiteRequest.HeadBranchis removed;AutoTriggerCheck.AppIDis nowint64andAutoTriggerCheck.Settingis nowbool.These types are already passed by value, so this removes them from
body-allowed-wrong-names. Comparing them with the OpenAPI request schemas also showed these differences, which are fixed in separate commits:nameis not required byPATCH /repos/{owner}/{repo}/check-runs/{check_run_id}, butUpdateCheckRunOptions.Namewas always sent, even when empty. It is now*stringwithomitempty.head_branchis not in thePOST /repos/{owner}/{repo}/check-suitesrequest schema, soHeadBranchis removed.CheckSuite.HeadBranchin the response is unchanged.app_idandsettingare required in both the request and the response ofPATCH /repos/{owner}/{repo}/check-suites/preferences, so theAutoTriggerCheckfields are no longer pointers.Setting: falseis still sent.ActionsandAutoTriggerChecksin the request types now useomitzero, so nil is omitted and an empty slice is sent as[]. A caller that already passes an empty slice now sends[]instead of omitting the field.started_atwas missing fromUpdateCheckRunOptions, soStartedAtis added.UpdateCheckRunOptions.NameandCreateCheckSuiteOptions.HeadBranchare removed fromtools/schemafields/exceptions.txt.SetCheckSuitePreferencesis renamed because the GitHub docs operation name is "Update repository preferences for check suites".CheckRunOutputis left unchanged because it is shared with the response.Verified locally:
go build ./...,go vet -tags integration ./test/integration/,script/test.sh -covermode atomic ./...(all modules, without-race),script/generate.sh --check,script/lint.shincludingcustom-gcl, andscript/check-schema-fields.shreports nothing for these types. (It still reports the 4EnterpriseUpdateBudgetwarnings that master has since #4693; #4699 fixes them.) These changes were not exercised against the live GitHub API.