Skip to content

refactor!: Rename ChecksService ...Options body types to ...Request and SetCheckSuitePreferences to UpdateCheckSuitePreferences - #4704

Merged
gmlewis merged 3 commits into
google:masterfrom
JamBalaya56562:refactor/3644-checks-request-types
Nov 7, 2026
Merged

gmlewis merged 3 commits into
google:masterfrom
JamBalaya56562:refactor/3644-checks-request-types

Conversation

@JamBalaya56562

Copy link
Copy Markdown
Contributor

Updates #3644.

BREAKING CHANGE: CreateCheckRunOptions, UpdateCheckRunOptions, CheckSuitePreferenceOptions, and CreateCheckSuiteOptions are renamed to CreateCheckRunRequest, UpdateCheckRunRequest, UpdateCheckSuitePreferencesRequest, and CreateCheckSuiteRequest; ChecksService.SetCheckSuitePreferences is renamed to ChecksService.UpdateCheckSuitePreferences; UpdateCheckRunRequest.Name is now *string; CreateCheckSuiteRequest.HeadBranch is removed; AutoTriggerCheck.AppID is now int64 and AutoTriggerCheck.Setting is now bool.

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:

  • name is not required by PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}, but UpdateCheckRunOptions.Name was always sent, even when empty. It is now *string with omitempty.
  • head_branch is not in the POST /repos/{owner}/{repo}/check-suites request schema, so HeadBranch is removed. CheckSuite.HeadBranch in the response is unchanged.
  • app_id and setting are required in both the request and the response of PATCH /repos/{owner}/{repo}/check-suites/preferences, so the AutoTriggerCheck fields are no longer pointers. Setting: false is still sent.
  • Actions and AutoTriggerChecks in the request types now use omitzero, 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_at was missing from UpdateCheckRunOptions, so StartedAt is added.

UpdateCheckRunOptions.Name and CreateCheckSuiteOptions.HeadBranch are removed from tools/schemafields/exceptions.txt.

SetCheckSuitePreferences is renamed because the GitHub docs operation name is "Update repository preferences for check suites". CheckRunOutput is 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.sh including custom-gcl, and script/check-schema-fields.sh reports nothing for these types. (It still reports the 4 EnterpriseUpdateBudget warnings that master has since #4693; #4699 fixes them.) These changes were not exercised against the live GitHub API.

`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`
@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 Nov 7, 2026
@codecov

codecov Bot commented Nov 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.64%. Comparing base (dac8c26) to head (05607e0).

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

@Not-Dhananjay-Mishra Not-Dhananjay-Mishra 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

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Nov 7, 2026
@gmlewis
gmlewis merged commit f379dfc into google:master Nov 7, 2026
15 checks passed
@JamBalaya56562
JamBalaya56562 deleted the refactor/3644-checks-request-types branch November 7, 2026 15:44
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).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants