Skip to content
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

Clicking on a feature branch name from a dashboard entry directs to the wrong url (404) #17943

Closed
eeyrjmr opened this issue Dec 10, 2021 · 3 comments · Fixed by #17991
Closed
Labels
issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP type/bug
Milestone

Comments

@eeyrjmr
Copy link
Contributor

eeyrjmr commented Dec 10, 2021

Gitea Version

1.16.0+dev-670-gc7e23401a

Git Version

2.34

Operating System

windows

How are you running Gitea?

windows service

Database

MySQL

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Description

reports on the dashboard indicate that some parts are clickable

eeyrjmr pushed to some_branch at eeyrjmr/test_issues

However the branch url points to https://try.gitea.io/some_branch instead of https://try.gitea.io/eeyrjmr/test_issues/src/branch/some_branch ie the base url does not consider the user/organisation + repository

Annotation 2021-12-10 000603
Annotation 2021-12-10 000627

Screenshots

No response

@lunny lunny added the type/bug label Dec 10, 2021
@lunny lunny added this to the 1.16.0 milestone Dec 10, 2021
@jpraet
Copy link
Member

jpraet commented Dec 12, 2021

In #17551

commit_repo = pushed to <a href="%[1]s/src/branch/%[2]s">%[3]s</a> at <a href="%[1]s">%[4]s</a>
got replaced by
commit_repo = pushed to <a href="%[2]s">%[3]s</a> at <a href="%[1]s">%[4]s</a>
in locale_en-US.ini, but this change was not reflected in feeds.tmpl.

Other types of links in the action feed are simarly broken.

I also wonder about the impact of such structural changes to the parameters passed to existing localized messages: these will need to be updated in all other supported languages, otherwise they will have broken links as well?

@zeripath
Copy link
Contributor

We absolutely should not have translators responsible for building URLs. It's bad enough that there's HTML in there but building URLs is not a good idea.

That's why this was changed.

I also wonder about the impact of such structural changes to the parameters passed to existing localized messages: these will need to be updated in all other supported languages, otherwise they will have broken links as well?

Crowdin notices the change and translators update so this is not a problem.

@zeripath
Copy link
Contributor

Ok so it looks like there were a few places missed in feeds.tmpl where the branch URL needs to be correctly formed. Would be a quick pr to fix

@lunny lunny added the issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP label Dec 15, 2021
zeripath added a commit to zeripath/gitea that referenced this issue Dec 15, 2021
Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit that referenced this issue Dec 16, 2021
…and other fixes (#17991)

This PR contains multiple fixes. The most important of which is:

* Prevent hang in git cat-file if the repository is not a valid repository 
    
    Unfortunately it appears that if git cat-file is run in an invalid
    repository it will hang until stdin is closed. This will result in
    deadlocked /pulls pages and dangling git cat-file calls if a broken
    repository is tried to be reviewed or pulls exists for a broken
    repository.

    Fix #14734
    Fix #9271
    Fix #16113

Otherwise there are a few small other fixes included which this PR was initially intending to fix:

* Fix panic on partial compares due to missing PullRequestWorkInProgressPrefixes
* Fix links on pulls pages  due to regression from #17551 - by making most /issues routes match /pulls too - Fix #17983
* Fix links on feeds pages due to another regression from #17551 but also fix issue with syncing tags - Fix #17943
* Add missing locale entries for oauth group claims
* Prevent NPEs if ColorFormat is called on nil users, repos or teams.
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
…and other fixes (go-gitea#17991)

This PR contains multiple fixes. The most important of which is:

* Prevent hang in git cat-file if the repository is not a valid repository 
    
    Unfortunately it appears that if git cat-file is run in an invalid
    repository it will hang until stdin is closed. This will result in
    deadlocked /pulls pages and dangling git cat-file calls if a broken
    repository is tried to be reviewed or pulls exists for a broken
    repository.

    Fix go-gitea#14734
    Fix go-gitea#9271
    Fix go-gitea#16113

Otherwise there are a few small other fixes included which this PR was initially intending to fix:

* Fix panic on partial compares due to missing PullRequestWorkInProgressPrefixes
* Fix links on pulls pages  due to regression from go-gitea#17551 - by making most /issues routes match /pulls too - Fix go-gitea#17983
* Fix links on feeds pages due to another regression from go-gitea#17551 but also fix issue with syncing tags - Fix go-gitea#17943
* Add missing locale entries for oauth group claims
* Prevent NPEs if ColorFormat is called on nil users, repos or teams.
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants