-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Gitea submits webhooks on "status" event, even if webhook is defined only for "push" #33302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
btw, I have tried to search, but have not found the same problem already reported |
I will investigate it and could you confirm whether you created a webhook with only a push event in Gitea? |
I'm affected by this as well. Judging by the JSON payload of the webhook I would guess this relates to Gitea Actions CI jobs... My webhook is configured to only run on The {
"commit": {
"id": "411acbb5098d2257592f94bfa1bbf121cb61df78",
[...]
},
"context": "Name of CI job",
"created_at": "2025-01-17T08:50:30Z",
"description": "Successful in 1m17s",
[...]
} So it seems the webhook gets fired twice per CI job. One with |
I'm affected too. Please backport this fix as soon as possible. Thanks |
I have the same problem! Gitea webhooks are send several times. |
@lunny do you have any time plan for next release with the fix? Thank you. |
I think you can work around this issue by selecting custom events and exclusively choosing the push event at the moment. |
I have tried to select only push event and it still runs multiple webhooks. |
Fix go-gitea#32873 Fix go-gitea#33201 ~Fix go-gitea#33244~ ~Fix go-gitea#33302~ depends on ~go-gitea#33396~ A part of this PR should be backported to v1.23 manually.
@lunny updated from 1.23.1 to 1.23.3 and was hit with a barrage of According to the settings of the webhook, commit status events shouldn't be active: |
Could this be something persistency related? There hasn't been any event after I edited the webhook settings. (basically a no-op): Enable |
In our environment the version 1.23.3 is working fine now. |
Same issue with a bunch of status messages and the telegram webhook went red due to 429 response. Hook type: telegram Bot Token: XXXXXXXXXXXXX Trigger On: Branch filter: Example message: {
"text": "Commit Status changed: \u003ca href=\"/XXXXX/yyy/actions/runs/29/jobs/2\" rel=\"nofollow\"\u003e/ MacOS Go 1.23 (push)[dbe350a5859b98ef8e1d5aa65dc21ef150bff85e]:Waiting to run\u003c/a\u003e by \u003ca href=\"https://gitea.aaaa.bbb/gitea-actions\" rel=\"nofollow\"\u003egitea-actions\u003c/a\u003e",
"parse_mode": "HTML",
"disable_web_page_preview": true
} Gitea version: 1.23.3 (archlinux) |
Not just "Commit status" messages. Today got spammed with 'merge-requests created messages'. The hook is just supposed to notify on new tags created.
|
Have you check your webhook configuration, whether it includes |
Please check if you have any other high-level webhooks configured to receive all events. I am unable to reproduce the issue on my end. |
I have 3 webhook and none of them send commit status. My discord server was flooded with commit status chances from CI in all three webhooks... Gitea Version is 1.23.3 and as soon as i updated from 1.23.1 to 1.23.3 and started the service my discord began to popup the notifications. |
Can you enable statuses and disable statuses and active it to try again? |
Can you also check the history of this webhook and check the event types on the http headers. |
One of the items:
Content: {
"wait": false,
"content": "",
"username": "Lançamento de Versões",
"avatar_url": "https://static-00.iconduck.com/assets.00/gitea-icon-512x512-8lvcua7z.png",
"tts": false,
"embeds": [
{
"title": "Commit Status changed: continuous-integration/drone/push[6318b2c2a6b71473da43d8baa7dbe0d66f1e0a28]:Build is running",
"description": "",
"url": "https://MY-CI-DOMAIN/AGST/AirSense/79",
"color": 1754624,
"footer": {
"text": ""
},
"author": {
"name": "wagner.rebello",
"url": "https://MY-DOMAIN/wagner.rebello",
"icon_url": "https://MY-DOMAIN/avatars/53171ee2606976be490df98ed8780cf2fb51e1c6527ebbbcdc7958d017b26cf7"
},
"fields": null
}
]
} I will try to reenable the hooks tomorrow with status enabled, and disabled again. |
@lunny this has to be something related to persistency and/or database migrations.
Not a single false notification since. |
After enabling and disabling the statuses it seems that the hook works as intended. |
Description
Dear gitea developers,
we have a few webhooks in our gitea repositories. We have one webhook to jenkins generic trigger and other webhook to woodpecker. Webhook to jenkins should be called only for push events, webhook to woodpecker should be called for custom events (create, push and pull request events).
After update from gitea 1.22.6 to 1.23.1, gitea started trigger jenkins job 7 times instead one.
In gitea webhook config we can really see seven POST webhook requests to jenkins and to woodpecker. But woodpecker starts just one job, maybe because woodpecker filter the webhook requests and process only those from "push" events. But jenkins just start new job for every webhook trigger.
I have found that after gitea triggers the webhook on woodpecker, the woodpecker requests "status" on gitea. Gitea starts then webhooks again for this "status" request, even the trigger should happen only for push events.
If I disable woodpecker webhook, gitea sends no webhook to woodpecker, woodpecker does not request "status" on gitea, which means, gitea sends only one webhook request to jenkins for the "push" event.
I have activated debug log in gitea, but I am not sure if there is something important. I can see
and then webhook_sender queue processing
Could you please verify if the webhook trigger filter works correctly and for "Push events" trigger really only on "push" events and not on "status" events?
Thank you very much checking and eventually fixing.
Regards,
Robert Wolf.
Gitea Version
1.23.1
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
git version 2.30.2
Operating System
Debian 11.11 Linux
How are you running Gitea?
We use released gitea version, starting from systemd on Debian 11.11 Linux
Gitea version 1.23.1 built with GNU Make 4.3, go1.23.4 : bindata, sqlite, sqlite_unlock_notify
Database
PostgreSQL
The text was updated successfully, but these errors were encountered: