-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Allows repo search to match against "owner/repo" pattern strings #19754
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I thought for about two minutes if you missed any edge cases but couldn't find any, so LGTM.
(However, I would recommend running make fmt
.)
Yeah my bad! I used gofumpt based on the output from drone - is that equivalent? |
I think so. |
@delvh Is this assigned to me because there's more for me to do? |
a unit test to add this case would be nice ... if you need help just ask |
@Eekle my definition of assignee is |
@delvh Oh cool np. I'm used to issue workflows where the assignee is whoever next has to do a thing - so if this were assigned to anyone I would expect it to be a second reviewer. But this makes just as much sense :) Thanks @6543 Sounds good. I will try and work that out tomorrow but will holler if I need help! |
So then we cannot search |
This change does not remove any results - it only adds them. IE anything that matched before will still match - and some new stuff might too. |
Maybe we need have a sort so that repository matched |
That sounds sensible - I'm not sure I know how to do that but I'll give it a try. Out of curiosity how could a string with a forward slash match otherwise? I didn't think it was an allowed character? |
@6543 Unit tests added. Required a bit of change to the code that runs the cases just because of the way it checks pass/fail on matches. |
@lunny Adds search ordering such that owner matched repositories are at the top, only when the owner priority ID field isn't already filled. It's hard to think how to validate this - because I don't think a search string with a slash in could match any other way. |
please "update branch" |
make L-G-T-M work |
* giteaofficial/main: Prevent NPE when cache service is disabled (go-gitea#19703) Detect truncated utf-8 characters at the end of content as still representing utf-8 (go-gitea#19773) Add silentcodeg to MAINTAINERS (go-gitea#19771) Allows repo search to match against "owner/repo" pattern strings (go-gitea#19754) Update JS dependencies (go-gitea#19767) Nuke the incorrect permission report on /api/v1/notifications (go-gitea#19761)
…gitea#19754) * Allows repo search to match against "owner/repo" pattern strings * Gofumpt * Adds test case for "owner/repo" style repo search * With "owner/repo" search terms, prioritise results which match the owner field * Fixes unquoted SQL string in repo search
Closes #19617
If the
teamID
is 0 so we're not searching in a specific team, and the keyword has a single slash in - try and match each part of "owner/repo" against theowner_name
andlower_name
fields.Architecturally I don't know if this messes with API endpoints or something - I'm not that familiar. But I thought better to make the PR so there's something to discuss around at least.