refactor!: Pass the secret scanning body types by value and rename them to ...Request - #4548
Open
JamBalaya56562 wants to merge 3 commits into
Open
JamBalaya56562 wants to merge 3 commits into
JamBalaya56562 wants to merge 3 commits into
Conversation
Adds `assigned_to`, `closure_request_comment`, `closure_request_reviewer`, `closure_request_reviewer_comment`, `provider`, `provider_slug` and `metadata` from the secret scanning alert response schemas.
…ions` and make `State` optional
The request schema for PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}
requires any one of `state`, `assignee` or `validity`, so `state` is no longer
sent unconditionally.
…em to `...Request` `SecretScanningAlertUpdateOptions` and `SecretScanningPatternConfigsUpdateOptions` are renamed to `UpdateSecretScanningAlertRequest` and `UpdateSecretScanningPatternConfigsRequest`, and the three `SecretScanningService` methods taking them now take them by value. This removes both types from both `paramcheck` exception lists in `.golangci.yml`.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4548 +/- ##
=======================================
Coverage 98.57% 98.57%
=======================================
Files 197 197
Lines 18252 18252
=======================================
Hits 17991 17991
Misses 261 261 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
gmlewis
approved these changes
Sep 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.
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
This converts the two remaining
SecretScanningServicebody types, removing 4 entries from theparamcheckexception lists in.golangci.yml(2 frombody-allowed-pointer-typesand 2 frombody-allowed-wrong-names).Checking the types against the OpenAPI descriptions turned up two gaps that are fixed in separate commits:
PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}has five properties (state,resolution,resolution_comment,assignee,validity) withanyOf: [{required: [state]}, {required: [assignee]}, {required: [validity]}].SecretScanningAlertUpdateOptionsonly had the first three and declaredState string \json:"state"`, so an assignee-only or validity-only update was not possible.Stateis now*stringwithomitempty, andAssigneeandValidityare added. As elsewhere in this package (e.g.IssueRequest.Assignee),omitemptycannot express the schema's "set tonull` to clear" case; that is unchanged here.assigned_to,closure_request_comment,closure_request_reviewer,closure_request_reviewer_comment,provider,provider_slugandmetadata, none of which were onSecretScanningAlert. They are added as optional fields, with a newSecretScanningAlertMetadatatype for themetadataentries.UpdateSecretScanningPatternConfigsRequeststays shared betweenUpdatePatternConfigsForEnterpriseandUpdatePatternConfigsForOrg; the two request schemas are identical. The pattern configuration tests now also assert the request body, which they did not before.BREAKING CHANGE:
SecretScanningAlertUpdateOptionsandSecretScanningPatternConfigsUpdateOptionsare renamed toUpdateSecretScanningAlertRequestandUpdateSecretScanningPatternConfigsRequest;SecretScanningService.UpdateAlert,UpdatePatternConfigsForEnterpriseandUpdatePatternConfigsForOrgnow take them by value instead of by pointer;UpdateSecretScanningAlertRequest.Stateis now*string.