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
43.01k stars 5.31k forks source link

`DEFAULT_SHOW_FULL_NAME` is not respected in RSS feeds #31491

Open na-Itms opened 1 week ago

na-Itms commented 1 week ago

Description

This is a follow-up on #20446 and #30096.

When the config option DEFAULT_SHOW_FULL_NAME is set to false, since Gitea 1.22, full names correctly don't appear anymore in commit lists. However, full names are still displayed in the RSS feed. We wish to use RSS feeds for our IRC notification bot and this introduces an unwanted discrepancy.

This can't be reproduced on the test instance, where DEFAULT_SHOW_FULL_NAME seems to be true.


If I'm not mistaken, this line https://github.com/go-gitea/gitea/blob/b5326a431f8b5c1c0fde524a50d75a4e19833e68/routers/web/feed/convert.go#L86 should be

title = act.GetActDisplayName() + " "

in order for the code to access the config value.

I noticed there is also a GetActDisplayNameTitle method but the logic below https://github.com/go-gitea/gitea/blob/b5326a431f8b5c1c0fde524a50d75a4e19833e68/models/activities/action.go#L240-L246 seems incorrect, unless I don't understand the aim of that method.

I read in https://github.com/go-gitea/gitea/pull/30096#issuecomment-2020506786 that those code paths need a rewriting, in which case this issue could be used to track the task.


I am not confident enough in my understanding of the code to propose a PR yet, but I would be happy to contribute fixes. We would be very grateful to have a fix for the RSS feeds as soon as possible.

Thank you in advance.

Gitea Version

1.22

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Ubuntu 22.04

How are you running Gitea?

Gitea 1.22 from binary download, run as a custom systemd service.

Database

MySQL/MariaDB

na-Itms commented 1 week ago

DEFAULT_SHOW_FULL_NAME is not respected either in the Contributors view of the Activity panel. 🤕

silverwind commented 4 days ago

I have not checked in detail, but it seems this GetActDisplayNameTitle should be moved out of actions-specific code and moved into another shared module to be used throughout the UI. I think it's likely that such a function already exists.