Skip to content

fix: make "test push webhook" always work#38425

Open
Otto-Deviant1904 wants to merge 4 commits into
go-gitea:mainfrom
Otto-Deviant1904:fix/webhook-test-push-silent-skip
Open

fix: make "test push webhook" always work#38425
Otto-Deviant1904 wants to merge 4 commits into
go-gitea:mainfrom
Otto-Deviant1904:fix/webhook-test-push-silent-skip

Conversation

@Otto-Deviant1904

@Otto-Deviant1904 Otto-Deviant1904 commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 12, 2026
@wxiaoguang

Copy link
Copy Markdown
Contributor

Instead of adding more "checks", I think it needs to re-design the "test webhook" button's behavior.

It should always send something useful to test the webhook.

@wxiaoguang wxiaoguang marked this pull request as draft July 13, 2026 02:05
PrepareWebhook skips when a webhook is not subscribed to the event or
when the branch filter excludes the ref. The Test Push Event control is
meant to verify the endpoint, so it now goes through PrepareTestWebhook,
which always creates and enqueues a hook task.

Real event delivery is unchanged. Adds a regression test covering a
webhook with no push subscription and a non-matching branch filter.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Otto-Deviant1904

Copy link
Copy Markdown
Contributor Author

Good call. I redesigned it so Test Push Event always enqueues a delivery via PrepareTestWebhook, which skips the normal event-subscription and branch-filter gates. Those gates still apply to real events through PrepareWebhook; the test control is only for verifying the endpoint actually receives something.

Pushed the update (rebased on current main). Happy to adjust further if you'd rather the test pick an enabled event type instead of always using a push payload.

@Otto-Deviant1904 Otto-Deviant1904 force-pushed the fix/webhook-test-push-silent-skip branch from 85156cb to f52112a Compare July 13, 2026 16:48
@wxiaoguang wxiaoguang marked this pull request as ready for review July 14, 2026 02:18
@wxiaoguang wxiaoguang changed the title fix: surface why Test Push Event was not queued fix: make "test push webhook" always work Jul 14, 2026
@wxiaoguang wxiaoguang added the backport/v1.27 This PR should be backported to Gitea 1.27 label Jul 14, 2026
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/v1.27 This PR should be backported to Gitea 1.27 lgtm/need 1 This PR needs approval from one additional maintainer to be merged. type/bug

Projects

None yet

3 participants