Repository navigation
refactor!: Rename CodeScanningAlertState and DependabotAlertState to ...Request and pass them by value - #4617
Open
JamBalaya56562 wants to merge 3 commits into
Conversation
…tState` without a state
… 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 #4617 +/- ##
=======================================
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 13, 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.
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:
CodeScanningAlertStateandDependabotAlertStateare renamed toUpdateCodeScanningAlertRequestandUpdateDependabotAlertRequestand are passed by value toCodeScanningService.UpdateAlertandDependabotService.UpdateAlert; theirStatefields are now*string.This PR converts the request body types of the two "update an alert" endpoints. Both request schemas are
anyOf: [{required: [state]}, {required: [assignees]}], sostateis not always required, and neither Go type hadassignees.*CodeScanningAlertStateUpdateCodeScanningAlertRequestCodeScanningService.UpdateAlertPATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}*DependabotAlertStateUpdateDependabotAlertRequestDependabotService.UpdateAlertPATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}Three commits:
feat- Add the response fields missing from the alert schemas:Alert.Assignees,Alert.DismissalApprovedBy,Alert.LinkedPullRequests,DependabotAlert.Assignees, andDependabotAlert.DismissalRequest(with a newDependabotAlertDismissalRequesttype).feat!- Follow theanyOfrequest schemas:Statebecomes*stringwithomitempty, and both types getAssignees []stringwithomitzero(an empty slice is sent as[], which the API documents as removing all assignees). Also addcreate_request(CreateRequest) to the code scanning type andagent_assignment(AgentAssignment, newDependabotAlertAgentAssignmenttype) to the Dependabot type.testJSONMarshaltests fix the JSON for the state-only, assignees-only, and empty-assignees cases.refactor!- Rename both types to...Requestand pass them by value. Both entries are removed frombody-allowed-pointer-types, and the test variables are namedbody.The method names already match the GitHub docs operation names ("Update a code scanning alert", "Update a Dependabot alert"), 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.