Gitea sends discord webhook for edited release draft #11684

Closed
opened 2025-11-02 09:44:37 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @Andre601 on GitHub (Sep 20, 2023).

Description

When you set up a discord-type webhook where you chose your events and selected Release will Gitea not send a Webhook when you save a new release as draft. This is fine and something I would expect as you may not want to publish new info too early to everyone.

However, if you edit said draft and again save it as such, therefore editing the draft, will Gitea send a webhook with the edit notification, which isn't really an optimal thing to do here.

Note that I have encountered this behaviour on a forgejo instance and I cannot test it within try.gitea.io due to it not allowing to make release drafts... So testing it yourself if you have the permission - or granting me the permission (Username is Andre601) to make drafts - is recommended.

Steps for possible reproduction:

  1. Create a Discord Webhook and copy URL
  2. Create a new Webhook on your Repository by selecting "Discord" as the webhook type
  3. Paste the URL into the URL field
  4. Select "Custom Events" followed by "Release"
  5. Go to releases tab
  6. Draft a new release and save it as a draft
  7. Edit the draft and save it as draft again
  8. Notice the webhook sending despite the edited release still being a draft

I would like to take the oportunity to also propose changes to the webhook system.
The way it is right now is flexible, yet rigit.
Flexible, because you can define your own selection of events to send a webhook for, but rigit because the selectable events group common types together, without any way of filtering them out...

As an example "Release" includes creation, deletion and edits of releases, without having any option to only have creation and edits f.e.

It should be considered to allow more fine-grained selections. Maybe by having the types as sub-lists of the event itself to select, where selecting the main/parent event would auto-select all the sub-list items...

A quick mockup using GitHub checkbox lists:

  • Release
    • Create
    • Edit
    • Delete

I can create a separate issue for this as a feature request if that is wanted.

Gitea Version

1.20.3+0-38-g0e33ecb13

Can you reproduce the bug on the Gitea demo site?

No (Not possible to test on that instance)

Log Gist

No response

Screenshots

Webhook message of the edited release draft:
grafik

The release in question, clearly marked as Draft:
grafik

Git Version

Operating System

How are you running Gitea?

I do not self-host/run it, but use codeberg.org for this.
As mentioned is the instance actually using forgejo, but given its soft-fork nature and currently not having any major differences from Gitea, I have strong beliefs that this bug exists within Gitea itself.

Database

None

Originally created by @Andre601 on GitHub (Sep 20, 2023). ### Description When you set up a discord-type webhook where you chose your events and selected `Release` will Gitea not send a Webhook when you save a new release as draft. This is fine and something I would expect as you may not want to publish new info too early to everyone. However, if you edit said draft and again save it as such, therefore editing the draft, will Gitea send a webhook with the edit notification, which isn't really an optimal thing to do here. Note that I have encountered this behaviour on a forgejo instance and I cannot test it within try.gitea.io due to it not allowing to make release drafts... So testing it yourself if you have the permission - or granting me the permission (Username is Andre601) to make drafts - is recommended. Steps for possible reproduction: 1. Create a Discord Webhook and copy URL 2. Create a new Webhook on your Repository by selecting "Discord" as the webhook type 3. Paste the URL into the URL field 4. Select "Custom Events" followed by "Release" 5. Go to releases tab 6. Draft a new release and save it as a draft 7. Edit the draft and save it as draft again 8. Notice the webhook sending despite the edited release still being a draft ---- I would like to take the oportunity to also propose changes to the webhook system. The way it is right now is flexible, yet rigit. Flexible, because you can define your own selection of events to send a webhook for, but rigit because the selectable events group common types together, without any way of filtering them out... As an example "Release" includes creation, deletion and edits of releases, without having any option to only have creation and edits f.e. It should be considered to allow more fine-grained selections. Maybe by having the types as sub-lists of the event itself to select, where selecting the main/parent event would auto-select all the sub-list items... A quick mockup using GitHub checkbox lists: - [ ] Release - [x] Create - [ ] Edit - [x] Delete I can create a separate issue for this as a feature request if that is wanted. ### Gitea Version 1.20.3+0-38-g0e33ecb13 ### Can you reproduce the bug on the Gitea demo site? No (Not possible to test on that instance) ### Log Gist _No response_ ### Screenshots Webhook message of the edited release draft: ![grafik](https://github.com/go-gitea/gitea/assets/11576465/f6e08f24-b343-49d5-82b0-ba649551679d) The release in question, clearly marked as Draft: ![grafik](https://github.com/go-gitea/gitea/assets/11576465/56da068d-1974-4efe-86ea-77e06c50b71a) ### Git Version - ### Operating System - ### How are you running Gitea? I do not self-host/run it, but use codeberg.org for this. As mentioned is the instance actually using forgejo, but given its soft-fork nature and currently not having any major differences from Gitea, I have strong beliefs that this bug exists within Gitea itself. ### Database None
GiteaMirror added the type/bug label 2025-11-02 09:44:37 -06:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 28, 2024):

Automatically locked because of our CONTRIBUTING guidelines

@github-actions[bot] commented on GitHub (Feb 28, 2024): Automatically locked because of our [CONTRIBUTING guidelines](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#issue-locking)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11684