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
45.25k stars 5.5k forks source link

Issue dependencies ui kind of broken #4479

Closed Aragur closed 4 months ago

Aragur commented 6 years ago

Description

In the dependencies list it only lists the last 8 issues relative to that one. For example issue #12 can only see issues #11 to #3. Also manual mention (for example of #1) doesn’t work. Thanks to @Morlinest we already know more details: Current work around is to search the exact issue name to add another. Direct mention of the issue id is not working (but this should a thing).

Screenshots

Try to select #1 on issue #12 Try to select #1 on issue #12

jonasfranz commented 6 years ago

Ping @kolaente

kolaente commented 6 years ago

This is something which should be fixed directly in the issue search, as I'm only using that (via the api). The results are the same as when you search on {projecturl}/issues.

I agree the issue search is not very good implemented.

kolaente commented 6 years ago

I'd rather have the search return issues by their index instead of frankensteining this into the dependencies.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

stevegt commented 5 years ago

Just noticed that direct mention of the issue id is still not working as of 7d973edf65c664ea4bdb0efe455f03c486727fa2.

zeripath commented 5 years ago

@stevegt could you give a quick example of what you mean. Preferably with a try.gitea.io link?

It might be best to open another issue since this one is closed.

stevegt commented 5 years ago

@zeripath A 'try' link won't help -- go to any issue you can edit and enter an issue number into the 'dependencies' field, either with or without a leading '#'. You'll see that you get an error response of 'Dependent issue does not exist.'

This issue was recently closed by stale bot due to lack of activity, not because it's been addressed. There has been no merge referencing it. Re-opening would be the normal thing to do, rather than fragment the conversation. I'll let it sit for a while to see if anyone with access re-opens. I may get to this with a fix myself at some point as well.

nascimentolwtn commented 5 years ago

For me is happening something similar, but it seems to be a cache problem, because if I create a sequence of issues, only old ones once shown are listed on new issues to be included as dependency. Also, it seems to show only the first page of opened issues (typing '#' would help).

A workaround: change browser or clear cache history.

xf- commented 5 years ago

@nascimentolwtn i think is is caused by service worker and caching the result

lesh59 commented 3 years ago

I think the dependency drop down is only showing the first page of issues. Changing the ISSUE_PAGING_NUM in app.ini to a larger number showed more issues in the drop down (and on the issues page of course). The drop down should not be affected by "pages", should be all issues, filtered as you type.

samaust commented 3 years ago

Tested on version 1.11.6 :

6543 commented 3 years ago

@samaust sorry, we dont support anymore v1.11.6 & you should upgrade for security reasons

stevegt commented 3 years ago

@6543 The fact that @samaust is running an old version is orthogonal to this issue -- the bug still exists in 1.14.0+dev-874-ge8ad6c1ff.

Giszmo commented 2 years ago

I installed from snap yesterday and ran into this same issue.

gitea 1.16.5

Not sure if bugbounties are welcome but I'd tip $50 in BTC for this to be fixed.

Ryuno-Ki commented 2 years ago

The relevant template is

https://github.com/go-gitea/gitea/blob/73382d2132f8f242245d83f66c92761e0b477b91/templates/repo/issue/view_content/sidebar.tmpl#L517-L534

The associated JavaScript

https://github.com/go-gitea/gitea/blob/73382d2132f8f242245d83f66c92761e0b477b91/web_src/js/features/repo-issue.js#L89-L123

A few questions come to my mind:

  1. Why is the JavaScript using .data() here? (see https://docs.gitea.io/en-us/guidelines-frontend/#html-attributes-and-dataset )
  2. I can see AJAX requests like /issues/search?q=some&priority_repo_id=2&type=all&_=1654452403354 Where is the associated router? (formerly using /api/v1/repos/issues/search. Changed in https://github.com/go-gitea/gitea/commit/783a02188970ba5800514f7c64f6a818f65c04a1#diff-d39a63ccfd5f0fe703f74ce48a3624ba59a856317b0d236d7eae87dfcf6c1c20 ) The one below?
  3. Searching for something in the title or body (whole words) work. We want to reference the issue ID here, though.

https://github.com/go-gitea/gitea/blob/7b089c465d9f851454be91ca209ab26782648a45/routers/web/repo/search.go#L19-L58

Ryuno-Ki commented 2 years ago

I got an explanation on routers in the chat.

The router in

https://github.com/go-gitea/gitea/blob/d9b50e4fd126e60fe0735bafbcb12d0e8f6dd0c2/routers/web/web.go#L320

passes the request to SearchIssues:

https://github.com/go-gitea/gitea/blob/744e45218579fe2fd130b91d9fb95ec4becd314d/routers/web/repo/issue.go#L2144-L2317

That makes

https://github.com/go-gitea/gitea/blob/744e45218579fe2fd130b91d9fb95ec4becd314d/modules/indexer/issues/indexer.go#L385-L401

the code that searches the issues.

Therefore, this issue is likely not of kind/ui.

wxiaoguang commented 2 years ago

I can answer some of your questions.

  1. Why is the JavaScript using .data() here? (see guideline )

There are a lot of legacy frontend code (as old as years ago). The rule for using attr instead of data was suggested by silverwind a few months ago and I wrote it into the guideline. For me, I am doing my best to make sure ever line of JS I touched follows the guideline.

  1. I can see AJAX requests like .. Where is the associated router?

The easiest way is just to run the code, and watch the output log. You will see the called router function in logs (zeripath and I added this feature in 1.17, to make develop & debug more easily)

  1. Searching for something in the title or body (whole words) work. We want to reference the issue ID here, though.

Yup, it's better to make the Issue Index can be searched or just loaded by hard-code (indeed, the number of the issue is called index internally, not id)

d33pjs commented 2 years ago

Having (still) the same issue. Is someone working on that? Or are there any workarounds in the meantime?

silkentrance commented 5 months ago

Partial matching of words is possible but might be expensive.

Bleve

Partial matching with bleve is a no brainer if you use camel case in your wording, which, of course, will not always work.

So, searching for 'iss' will never find 'issue'. Yet, searching for 'foo' will find 'FooBar' or 'fooBar'. The same goes for 't2', which can be found by a search for either 't' or '2'.

6543 commented 4 months ago

I propose> create a popup template that based on usage has preset filters. (e.g. only issues/pulls of repo X)

and let issues search via keyword or number have it live updated... ... multiselect would be nice ... filter for closed and open

use that:

mockup: image

silkentrance commented 4 months ago

I propose> create a popup template that based on usage has preset filters. (e.g. only issues/pulls of repo X)

and let issues search via keyword or number have it live updated... ... multiselect would be nice ... filter for closed and open

use that:

  • for adding issues/pulls in project board view to add to the project
  • adding dependencys

mockup: image

I propose> create a popup template that based on usage has preset filters. (e.g. only issues/pulls of repo X)

and let issues search via keyword or number have it live updated... ... multiselect would be nice ... filter for closed and open

use that:

  • for adding issues/pulls in project board view to add to the project
  • adding dependencys

mockup: image

I strongly believe that this is an altogether different feature request. Please make this a different issue. The issue at hand is already complex and does not require any additional complexity.

Personally, I have a different approach in mind. One. which will move the dependency management to below the original issue/pr "description" and right before the follow-up comments, similar to for example *ira.

silkentrance commented 4 months ago

What is required here as a solution, is search by