Sometimes it is not possible to move an issue from one project to another, because the target project cannot be found in the list.
Further details
The ability to move an issue from one project to another was introduced in 8.6 (see the implementation issue and the blog post). Now, on the Issue page, there is a button at the bottom of the right-side controls to "Move issue". If you click that button, a dropdown appears for you to select the target project. If you don't see what you are looking for in the list of 20 projects, you can enter text in the "Search project" input. Search results are also limited to 20 projects. So if you aren't able to find what you are looking for in the default list, or with search, then you cannot move the issue.
Attempt to find the gitlab project - it apparently cannot be found
Proposal
Backend should sort the "Search project" response by best matches, so the top 20 best matches are displayed (instead of an arbitrary 20 results from all the matches).
Performance
Backend should continue to limit the number of projects returned, for performance reasons.
Permissions and Security
No permissions or security implications.
What does success look like, and how can we measure that?
The example issue above can be successfully moved to the gitlab project.
To be honest I'm not sure how the dropdown we have right now is implemented. When I built this feature we were rendering this in HAML, and today I suppose this is being rendered differently, presumably with Vue. I expect some backend endpoint for getting projects that a user has access to, to be implemented somewhere, and there is could be some LIMIT modifier added to the SQL query. Perhaps we limit the amount of projects to some number, and because of ordering not being defined explicitly we do not show a few projects. This is only an assumption, I might be completely wrong here - it simply needs to be checked in code @djensen.
I think that it belongs to Plan::Project management.
FYI, this is affecting us at GitLab. Searching for "gitlab" doesn't return the gitlab project as an option, so we are unable to move issues to there. I don't think it's technically a ~bug, because the behavior is deliberate. This can probably be resolved by returning the best matches.
Offshoot from that: I can't find where the /move command (or others, like /cc) are described in the docs. Do you happen to know where that documentation is?
The problem is that searching for "gitlab" in our group returns too many results. I fixed the other issue by allowing searching by namespace so you should be able to search "gitlab-org/gitlab". Though it still shows a few other projects because it still matches projects like "gitlab-org/gitlab-puma", etc..
Another suggestion in that other issue was better ordering of results. Maybe by number of stars or last activity.
I'm also not sure why Winnie's fork is showing up here:
This is probably a project shared to a group? I'm not sure we even allow moving to shared projects.
It would also be good if our dropdown component supports pagination / infinite scroll where we see the succeeding results as we scroll down. Maybe a quick fix is to just increase the limit? It's currently at 20 which I think is kind of low.
Also, we now have a Vue version of this component and maybe that one supports pagination already.
@engwan ah, you're right. I didn't find that before I created this issue.
I fixed the other issue by allowing searching by namespace so you should be able to search "gitlab-org/gitlab".
When I search for "gitlab-org/gitlab", the gitlab project doesn't appear in the 20 results
Another suggestion in that other issue was better ordering of results. Maybe by number of stars or last activity.
Or by % match? (I've used the similar_text-ruby gem for something like this before.) I think this would be a better user experience than pagination or infinite scroll, because it would shift the burden from the user to the backend. Not sure if that would be feasible on the backend though.
When I search for "gitlab-org/gitlab", the gitlab project doesn't appear in the 20 results
I see, it looks like we now have more projects matching the gitlab-org/gitlab path
Or by % match? (I've used the similar_text-ruby gem for something like this before.) I think this would be a better user experience than pagination or infinite scroll, because it would shift the burden from the user to the backend. Not sure if that would be feasible on the backend though.
I don't think this would be feasible because we won't be able to use DB LIMIT in this case. We'd have to retrieve all matches from the DB, then compute the % match, then return the first N results.
@engwan you're right, we should protect performance with a LIMIT even if it won't usually apply. And where it does apply, there is that risk of excluding the user's intended record. Could we solve that with two queries?
exact match, which would be displayed first in the results if it exists
@engwan maybe that could be a separate/future enhancement then. In the meanwhile I'd support a quick fix like you talked about below. Thanks for talking this through with me
@engwan Are you asking about the default order of results, the order for when a character has been entered, or both? Also, I noticed that the space around the / in the namespace seems to matter. For example, when I tried searching for GitLab.org/gitlab-workhorse it didn't find the project, but GitLab.org / gitlab-workhorse did. I'd love it if both could provide the same results?
As far as the result order, @djensen when you search for a project to move to, can you share what that process looks like? For example, do you already know the full namespace of the project you're looking for, or just a portion? If just a portion, what portion do you feel is most memorable? If you know the full name, how would you expect that list to filter based on what you enter?
Are you asking about the default order of results, the order for when a character has been entered, or both?
Both. It's easier to make them the same for now.
I know we can be a bit smarter when there are characters entered like "best match", but we can't do that right now due to how our search works. We'd probably need postgres full text search or something like that to implement that.
For example, when I tried searching for GitLab.org/gitlab-workhorse it didn't find the project, but GitLab.org / gitlab-workhorse did. I'd love it if both could provide the same results?
Yeah, these are problems with our search which would also be solved by using full text search. Right now we do a simple ILIKE query per word in the search term.
So as a quick iteration, I would like to just change the sort order to something better than the current one. Currently, it's ordered by project name.
@engwan I see, thanks for clarifying! Let's go with popularity order for now then as it sounds like we are limited on what we can offer with this component. Do we have the ability to define levels in the sort? For example, first sort by keyword, then popularity, then date changed?
Do we have the ability to define levels in the sort? For example, first sort by keyword, then popularity, then date changed?
We can define multiple sorts but the next one would only be used if there's a tie. So if we do stars_count DESC, last_activity_at DESC, last activity will only be considered if projects have the same number of stars.
@djensen when you search for a project to move to, can you share what that process looks like?
@hollyreynolds my process, as far as I'm consciously aware of it:
Visually scan for the project in the given list (which is only 3-4 projects). Don't scroll the list - if a high-activity project isn't in the top 3-4 then it feels like there's no point, and even less point for a low-activity project.
Search by project name ("gitlab"). This feels easy because the project name is memorable and top-of-mind. This is the step where I would usually expect to be able to find my target.
Search with namespace ("gitlab-org/gitlab") if I need to. This feels harder, cognitively, because I have to think about the namespace (which is less memorable) and do more typing.
how would you expect that list to filter
In a perfect world, I would expect the list to be filtered by highest activity by default, then by percentage match for search. But both of those might have some technical complexity, so to simplify maybe latest activity by default, and exact match for search?
Should the board's "New issue" feature be handled under a separate issue? Or will it be handled by the same change made for this issue?
Yes, it'd make sense to create a separate issue. As far as I can see it's using the group projects API endpoint which already has an option for similarity search.