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
44.61k stars 5.45k forks source link

Truncate option for Discord #32278

Open echodreamz opened 15 hours ago

echodreamz commented 15 hours ago

Feature Description

Would it be possible to add a setting that overrides the truncating of Discord webhook notifications? Previously, Gitea would push the entire commit message, now it cuts off at 50 characters like Github does, one of the reasons we stuck with Gitea is because the webhook notifications included the entire commit message.

Adding a setting (default to 50 characters) to enable/disable or extend the characters count I think would be a good middle ground to allow the previous behavior but also allow conforming to Github.

Screenshots

No response

yp05327 commented 10 hours ago

@kemzeb Can you follow this?

kemzeb commented 4 hours ago

Interesting, I never thought that there would be an interest in keeping the previous behavior. I think it would be fine to make this configurable, I'm just not sure how that would look. I'm also trying to ponder any potential problems in the future if we would introduce this setting. This would be a specific configuration, where it's:

We also need to consider the scope of the setting, should it be:

The easiest would be to define some instance-wide setting, but I'm unsure if this is the best option.

I do know that the webhook table does have a meta column and I originally thought that we could throw a simple flag in the table and in the Discord webhook creation form that would toggle truncation on/off. I then realized that this is actually used in order for us to communicate to Discord properly, so this won't work. Open to other ideas.