Skip to content

Check tracker url syntax #7068

@Grelog

Description

@Grelog
  • Gitea version (or commit ref): 81adf6a
  • Git version:
  • Operating system:
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Some time ago we created a new repository and added a connection to our external issue tracking system Tuleap.
We used this repository a while and didn´t recognized that there was a problem with the tracking url.

Yesterday i pushed a commit containing a tracker id in the commit message for the first time. After this, it wasn´t possible to view the repository in the web view anymore.
Because of this i wasn´t able to review or reconfigure the repository settings. I could only delete the whole repository via admin settings.

Web output in repository view:
template: repo/view_list:30:35: executing "repo/view_list" at <RenderCommitMessage .LatestCommit.Summary .RepoLink $.Repository.ComposeMetas>: error calling RenderCommitMessage: runtime error: slice bounds out of range
and in diff view:
template: repo/diff/page:12:28: executing "repo/diff/page" at <RenderCommitMessage .Commit.Message $.RepoLink $.Repository.ComposeMetas>: error calling RenderCommitMessage: runtime error: slice bounds out of range

In the gitea db i found a table called repo_unit with configuration data of the repos.
In this case the entry was
{"ExternalTrackerURL":"https://sampledomain.com/plugins/tracker/?tracker=161","ExternalTrackerFormat":"https://sampledomain.com/plugins/tracker/?aid={index]","ExternalTrackerStyle":"numeric"}
My colleague did a mistake on closing brackets > ?aid={index]

I suggest the web interface should perform an error check on entering the external tracker url to prevent such problems.

On try.gitea.io the problem seems to only occur on diff view and graph so this problem can be fixed in the web interface if you know what the problem is.
see here https://try.gitea.io/Grelog/test1/commit/643c2b265183847ace82967542ce40ac2ce92a7f
and here https://try.gitea.io/Grelog/test1/graph

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions