Skip to content

refactor!: Rename UpdateDefaultSetupConfigurationOptions to UpdateDefaultSetupConfigurationRequest and pass it by value - #4694

Merged
gmlewis merged 3 commits into
google:masterfrom
JamBalaya56562:refactor/3644-default-setup-request-type
Oct 31, 2026
Merged

gmlewis merged 3 commits into
google:masterfrom
JamBalaya56562:refactor/3644-default-setup-request-type

Conversation

@JamBalaya56562

Copy link
Copy Markdown
Contributor

Updates #3644.

BREAKING CHANGE: UpdateDefaultSetupConfigurationOptions is renamed to UpdateDefaultSetupConfigurationRequest and is passed by value to CodeScanningService.UpdateDefaultSetupConfiguration; its State field is now *string.

This PR converts the request body type of the "update a code scanning default setup configuration" endpoint (PATCH /repos/{owner}/{repo}/code-scanning/default-setup). The request schema (code-scanning-default-setup-update) has no required properties, but the Go type always sent state, and it was missing three of the six properties.

Three commits:

  1. fix! - State becomes *string with omitempty, so a request that only changes, for example, query_suite no longer sends "state": "". Languages uses omitzero instead of omitempty, following the convention for optional slices. The test now checks the request body.
  2. feat - Add the missing runner_type (RunnerType), runner_label (RunnerLabel), and threat_model (ThreatModel) properties.
  3. refactor! - Rename the type to UpdateDefaultSetupConfigurationRequest and pass it by value. The type is removed from both body-allowed-pointer-types and body-allowed-wrong-names, and the test variable is named body.

The method name already matches the GitHub docs operation name, so it is not renamed. The response type UpdateDefaultSetupConfigurationResponse already has both properties of its schema (run_id, run_url).

Verified locally: go build ./..., go vet -tags integration ./test/integration/, go test ./github/, generated files idempotent, custom-gcl 0 issues, and script/check-schema-fields.sh reports no new issues.

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Oct 30, 2026
@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.64%. Comparing base (1172fdf) to head (dc063df).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4694   +/-   ##
=======================================
  Coverage   98.64%   98.64%           
=======================================
  Files         203      203           
  Lines       19027    19027           
=======================================
  Hits        18769    18769           
  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.

@gmlewis gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @JamBalaya56562!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @Not-Dhananjay-Mishra

@gmlewis gmlewis added the Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). label Oct 30, 2026

@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 Oct 31, 2026
@gmlewis

gmlewis commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

Thank you, @Not-Dhananjay-Mishra!
Merging.

@gmlewis
gmlewis merged commit d2ed031 into google:master Oct 31, 2026
15 checks passed
@JamBalaya56562
JamBalaya56562 deleted the refactor/3644-default-setup-request-type branch October 31, 2026 11:28
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