Skip to content

test: cover 2xx webhook responses including 204 - #1358

Open
zanarellidev wants to merge 1 commit into
fluxcd:mainfrom
zanarellidev:fix/client-2xx-regression
Open

test: cover 2xx webhook responses including 204#1358
zanarellidev wants to merge 1 commit into
fluxcd:mainfrom
zanarellidev:fix/client-2xx-regression

Conversation

@zanarellidev

@zanarellidev zanarellidev commented Aug 2, 2026

Copy link
Copy Markdown

Summary

  • The default postMessage response validator already accepts any HTTP 2xx status (200 <= s < 300), including 204 No Content.
  • The in-code comment still said only 200/201/202, which matches the stale claim in 204 status in generic webhook is treated as error #441.
  • Add regression tests for 200/201/202/204 success and 400 failure, and update the comment.

Fixes #441

Test plan

  • go test -count=1 -run Test_postMessage_accepts2xxStatusCodes ./internal/notifier/
  • Existing Test_postMessage still passes

Clarify that the default HTTP response validator accepts any 2xx
status, including 204 No Content, and add regression coverage so
providers returning 204 cannot regress to a hard failure.

Signed-off-by: zanarelli <zanarelli.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

204 status in generic webhook is treated as error

1 participant