go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.09k stars 5.49k forks source link

webhook branchfilter=* takes precedence regardless if configured in org or repo #30111

Open davama opened 7 months ago

davama commented 7 months ago

Description

Good day,

We are using the jenkins gitea-plugin which automatically creates a webhook as seen in the screenshot.

The attached screenshot webhook setting is configured at the org level and at the repo level.

We wanted to filter a repo within the org to main branch only, so we set Branch filter = main on the webhook. The org webhook did not change. ( Branch filter = *)

When we create a dummy branch within the repo, we still see the notification being sent to our pipeline server. (see logs)

We also tried Branch filter = {main} but got the same result.

We then decided to flip the filter. The org webhook to Branch filter = main and the repo webhook Branch filter = *, and we still saw the notification being sent when we create a branch within the repo. (see logs)

With our above tests, it seems that Branch filter = * takes precedence regardless where it is configured.

What I would have expected: The repo webhook specific settings would take precedence over the org webhook.

If this is not a bug, my apologies in placing in this category...

Any input is appreciated. Thank you for the support!

Best, Dave

Gitea Version

1.21.8

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://pastebin.com/raw/n7s0cALY

Screenshots

2024-03-26_11-58

Git Version

1.21.8

Operating System

Rocky Linux 9 (gitea inside docker)

How are you running Gitea?

gitea/postgres/cache-redis/postfix all inside docker containers.

using the rootless version.

Database

PostgreSQL

davama commented 7 months ago

Update:

upgraded to v1.21.10 and still experience behavior of repo webhook branch filter not being respected