Repository navigation
Conversation
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
somaz94
added a commit
to somaz94/somaz94
that referenced
this pull request
Oct 21, 2026
somaz94
marked this pull request as ready for review
October 21, 2026 04:51
somaz94
requested review from
FGadvancer,
skiffer-git and
withchao
as code owners
October 21, 2026 04:51
This branch has not been deployed
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.
Fixes #3808.
failedContinueinconfig/webhooks.ymlis parsed intoBeforeConfig.FailedContinue, but nothing has read it since the 3.7.0 refactor (b76816b). A before callback whose receiver is unreachable, times out, or answers with something that is not JSON therefore always fails the operation, whatever the flag says.SyncPostnow passes the flag topost, which logs a warning and returns nil on a request error or an undecodable response, the same two cases the v3.6 helper covered. A rejection the receiver sends back throughactionCodeandnextCodeis still returned. If decoding fails partway, the response is reset first, because callers apply its fields after a nil error andjson.Unmarshalkeeps filling fields after a type error. After callbacks are unchanged.Upgrade note: the shipped
webhooks.ymlsetsfailedContinue: trueon most before callbacks, so a 3.7+ deployment that enabled one will now let the operation through when the receiver is down instead of rejecting it. Deployments that want to keep failing closed should setfailedContinue: false. I left the defaults as they are, since that is your call.How to test
go test ./pkg/common/webhook/runs a new table test against an httptest receiver. A dropped connection and a non-JSON body each fail without the flag and pass with it, a partially decoded body leaves no fields behind, a normal answer is still applied, and a rejection is still returned with the flag on. The three continue cases fail on main.go build ./...andgo vet ./pkg/common/webhook/also pass locally.Follow-ups
With the flag on,
beforeSetGroupInfoandbeforeSetGroupInfoExstill fail, with a record-not-found error.internal/rpc/group/callback.gocopiesresp.GroupIDand the other fields withNotNilReplace(&req.X, &resp.X), which always replaces, so an empty response clearsreq.GroupID. The same thing already happens when a receiver answers without those fields. I can send that as a separate fix.