Skip to content

Gitea sends discord webhook for edited release draft #27157

Closed
@Andre601

Description

@Andre601

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions