-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Discord Webhooks should hide multiline commit details #32371
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
Thanks for the report! This is unattended behavior... #31970 should have removed the commit description and just kept the summary: gitea/services/webhook/discord.go Line 159 in 41b4ef8
Here we split the commit message with Looking at the Go docs further, I may have misused strings.SplitN(commit.Message, "\n", 2)[0] ... since the last element would be the "unsplit remainder" that the docs talk about. Currently we seem to be using the unsplit remainder (which would just be the message). Reading the code of Not sure how I missed this. I'll be making a PR to correct this. |
…itea#32432) Resolves go-gitea#32371. go-gitea#31970 should have just showed the commit summary, but `strings.SplitN()` was misused such that we did not perform any splitting at all and just used the message. This was not caught in the unit test made in that PR since the test commit summary was > 50 (which truncated away the commit description). This snapshot resolves this and adds another unit test to ensure that we only show the commit summary.
…) (#32447) Backport #32432 by @kemzeb Resolves #32371. #31970 should have just showed the commit summary, but `strings.SplitN()` was misused such that we did not perform any splitting at all and just used the message. This was not caught in the unit test made in that PR since the test commit summary was > 50 (which truncated away the commit description). This snapshot resolves this and adds another unit test to ensure that we only show the commit summary. Co-authored-by: Kemal Zebari <[email protected]>
Description
While #31668 was resolved (thanks!), the messages of Discord webhooks is still hard/harder to read in some cases like this one :
Now, the message is truncated after 50 characters like GitHub, but I think that only the first line of the message should be displayed. See GitHub for comparison (these are also multiline commits) :
Gitea Version
1.22.3
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
2.30.2
Operating System
Linux
How are you running Gitea?
Official docker image
Database
PostgreSQL
The text was updated successfully, but these errors were encountered: