Dependencies only show one issue for each other repo #11891

Closed
opened 2025-11-02 09:51:05 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @colejohnson66 on GitHub (Oct 21, 2023).

Description

The "blocks/dependencies" area of issues only shows the three oldest additions to the list, even if there are more. The issue log does show there being more than three "new dependencies" being added. It appears like the code naively adds a LIMIT 3 to the database call with no regard for the real count.

The entire list should be viewable, and it should be sorted differently than the order of insertion in the database.

Gitea Version

1.20.5

Can you reproduce the bug on the Gitea demo site?

Untested

Log Gist

No response

Screenshots

This screenshot shows only three issues as being blocked by the currently viewed one. The current issue actually blocks about a half-dozen. As above, these are the first three additions to the list, and appear in that order.

Screenshot showing the above description

Git Version

No response

Operating System

No response

How are you running Gitea?

N/A

Database

MySQL/MariaDB

Originally created by @colejohnson66 on GitHub (Oct 21, 2023). ### Description The "blocks/dependencies" area of issues only shows the three oldest additions to the list, even if there are more. The issue log does show there being more than three "new dependencies" being added. It appears like the code naively adds a `LIMIT 3` to the database call with no regard for the real count. The entire list should be viewable, and it should be sorted differently than the order of insertion in the database. ### Gitea Version 1.20.5 ### Can you reproduce the bug on the Gitea demo site? Untested ### Log Gist _No response_ ### Screenshots This screenshot shows only three issues as being blocked by the currently viewed one. The current issue actually blocks about a half-dozen. As above, these are the first three additions to the list, and appear in that order. ![Screenshot showing the above description](https://github.com/go-gitea/gitea/assets/11381599/a6871820-002f-464a-81ed-e3690949b5c5) ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? N/A ### Database MySQL/MariaDB
GiteaMirror added the type/bug label 2025-11-02 09:51:05 -06:00
Author
Owner

@colejohnson66 commented on GitHub (Oct 21, 2023):

I can't easily identify why this occurs. The template as well as the code to retrieve them do not place a limit on the list's length.

@colejohnson66 commented on GitHub (Oct 21, 2023): I can't easily identify why this occurs. The [template](https://github.com/go-gitea/gitea/blob/b39bb958cc44511c3590e832f77cebdf70616b8c/templates/repo/issue/view_content/sidebar.tmpl#L429-L447) as well as [the code to retrieve them](https://github.com/go-gitea/gitea/blob/b39bb958cc44511c3590e832f77cebdf70616b8c/models/issues/issue.go#L662-L677) do not place a limit on the list's length.
Author
Owner

@lng2020 commented on GitHub (Oct 22, 2023):

this PR https://github.com/go-gitea/gitea/pull/17935 has several bugs and typos. It really should add some tests to ensure its behavior.

@lng2020 commented on GitHub (Oct 22, 2023): this PR https://github.com/go-gitea/gitea/pull/17935 has several bugs and typos. It really should add some tests to ensure its behavior.
Author
Owner

@colejohnson66 commented on GitHub (Oct 23, 2023):

Looking at your new PR and the linked PR, I can indeed confirm that the issue (no pun intended) is that only the first added issue for each other repository is shown. And they are shown in order of repository ID.

So, for my screenshot, #‍15 was from repo ID 2, #‍856 from ID 3, and #‍23 from ID 4. In addition, issue #‍23 for repository ID 4 was actually the first to be added to the list of dependencies, but shows up last.

@colejohnson66 commented on GitHub (Oct 23, 2023): Looking at your new PR and the linked PR, I can indeed confirm that the issue (no pun intended) is that only the first added issue for each other repository is shown. And they are shown in order of repository ID. So, for my screenshot, #‍15 was from repo ID 2, #‍856 from ID 3, and #‍23 from ID 4. In addition, issue #‍23 for repository ID 4 was actually the first to be added to the list of dependencies, but shows up last.
Author
Owner

@lng2020 commented on GitHub (Oct 23, 2023):

That make much more sense. Your screenshot is strictly followed the old code logic.

@lng2020 commented on GitHub (Oct 23, 2023): That make much more sense. Your screenshot is strictly followed the old code logic.
Author
Owner

@KazzmanK commented on GitHub (Oct 28, 2023):

There is much to add to the Dependency list UI issues.
on try.gitea.io I'm unable to reproduce my problems
on our 1.20.5 it is shows Not found, or, when I type, it shows strange results in dropdown.

image

In sibling issue it indeed displays it, but I need to reference other issue there

image

So, to add reference to issue 26 in my first issue, I have to try referencing issue 25, it shows issue 26 in dropdown and it is done !
But after what when I try to repeat the trick in other issue with filter string 25 it starts showing issue 81 and it is not possible to pick issue 26 anymore.
Total mess!
Is there something fixed in upcoming releases ?

@KazzmanK commented on GitHub (Oct 28, 2023): There is much to add to the Dependency list UI issues. on try.gitea.io I'm unable to reproduce my problems on our 1.20.5 it is shows Not found, or, when I type, it shows strange results in dropdown. ![image](https://github.com/go-gitea/gitea/assets/13328513/11358197-8365-48f6-91fb-84bf9a90279e) In sibling issue it indeed displays it, but I need to reference other issue there ![image](https://github.com/go-gitea/gitea/assets/13328513/b03caf50-7cad-4143-bb93-439f92761b46) So, to add reference to issue 26 in my first issue, I have to try referencing issue 25, it shows issue 26 in dropdown and it is done ! But after what when I try to repeat the trick in other issue with filter string 25 it starts showing issue 81 and it is not possible to pick issue 26 anymore. Total mess! Is there something fixed in upcoming releases ?
Author
Owner

@KazzmanK commented on GitHub (Oct 28, 2023):

It is still rising questions on 1.21.0+rc2-22-g2d2a5657e
image

As well as on
1.22.0+dev-249-ge75b89ea6

It just shows some random results in dropdown , and misses required issues.

@KazzmanK commented on GitHub (Oct 28, 2023): It is still rising questions on 1.21.0+rc2-22-g2d2a5657e ![image](https://github.com/go-gitea/gitea/assets/13328513/7939a193-5d21-45ab-9e29-970408e967c4) As well as on 1.22.0+dev-249-ge75b89ea6 It just shows some random results in dropdown , and misses required issues.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11891