Skip to content

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

Merged
stefanprodan merged 1 commit into
fluxcd:mainfrom
zanarellidev:fix/client-2xx-regression
Aug 5, 2026
Merged

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

Conversation

@zanarellidev

@zanarellidev zanarellidev commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

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>
@stefanprodan stefanprodan added area/receiver Webhook receiver related issues and PRs area/testing Testing related issues and pull requests labels Aug 5, 2026

@stefanprodan stefanprodan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Thanks @zanarellidev

@stefanprodan
stefanprodan merged commit 317b695 into fluxcd:main Aug 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/receiver Webhook receiver related issues and PRs area/testing Testing related issues and pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

204 status in generic webhook is treated as error

2 participants