Drop down search is not working -- when i search O...
# proj-agent-canvas
c
Drop down search is not working -- when i search OpenHands, only repo with keywords "openhands" from my own account shows up -- despite i have access to other repo with "OpenHands" in it
cc @freezing-spoon-14104
b
Is it case sensitive?
f
Nope, I tested it and am getting the same issues
Though it seems that we pass the right data, we just don't receive it from the backend. I'll try and take a look today and ping Rohit if OpenHands and I can't figure it out
πŸ™Œ 1
l
I think it has regressed so that it’s only showing things that start with the thing you entered
πŸ‘€ 1
So you can type All-Hands-AI/Op and it’ll show the repo
c
but that doesn't explain
xingyaoww/openhandsxxx
in the screenshot above though?
l
ah, true
q
github has pretty terrible search apis, which results in the behavior we're seeing 1. we search your personal repos by default via the search api (this leads to results with
xingyaoww
); partial matches work here so you can type
openhands
and it will match the second half of the repo name 2. in saas we use app installation, and you can search for a specific repo inside an installation but not across all installations; once you type
All-Hands-AI/
we figure out the installation and search for repos in there The fix may involve matching on installations; then searching the same query inside each installation - smth like that
^ Bitbucket repo dropdown doesn't face the same issue because of a solution like this - although the apis for bitbucket aren't 1:1 with github so it may be a bit trickier fixing this on github
f
Yeah I tthink OpenHands came up with a similar solution? I have a draft here: https://github.com/All-Hands-AI/OpenHands/pull/10324 Works now, but still making some other FE improvements with search too
πŸ™Œ 1
q
looking good, left a couple of comments
πŸ‘€ 1
thanks on a stick 1
f
Could you take another look? Im trapped making some FE improvementts but BE should be ready
πŸ‘ 1
c
Related to this bug -- the main branch from litellm isn't showing up!
q
@freezing-spoon-14104 pr lgtm @chilly-france-44439 branch loading hasn't been touched for a while, its prob the api being flaky or a default branch name that isn't main?
thanks on a stick 1
c
Default branch is indeed main.. and i've retry couple times and
main
is still not out 😞 https://github.com/BerriAI/litellm
f
OK so I think I'll add the frontend improvements at a separate PR because once again there are some limitations with the current dropdown library we're using. But there should be a minor improvement for now. @chilly-france-44439 can you test it and see that it passes your cases?
c
you mean on this branch
fix/repo-search
?
f
Yes
c
still doesn't work 😞
but the openhands search did work
f
OK nice, though according to Rohit it sounds like the branch issue is a separate issue so I'll create an issue for that
c
I can probably create a new issue for this..
βœ… 1
q
Yeah the issue needs to contain β€’ pagination for branches β€’ having the first result be the default branch (this is already sorta done, we track it in the GitRepository object)
c
Copy code
INFO:     127.0.0.1:60826 - "GET /api/user/repository/branches?repository=BerriAI%2Flitellm HTTP/1.1" 200 OK
INFO:     127.0.0.1:60896 - "GET /api/user/suggested-tasks HTTP/1.1" 200 OK
looks like the api call is successful
is this API pagninated?
q
nope, branches are not paginated (yet)
πŸ€” 1
c
probably because of this?
q
Yeahh that's it, we limit to 100 branches
c
ha, probably just remove it or increase the limit
but it gonna slow down frontend even more..
nod 1
q
pagination is the way to go, we didn't do it with the repo pagination as it was a large refactor
c
yep remove the restriction fix th eissue
πŸ™Œ 1
do you think we should PR this in or no? maybe raise. the max branches to 5k
q
how many branches did you load and how much time did it take? (in dev console) We can raise the limit for now in this pr
c
probably less than a few sec, i didn't really notice though
πŸ‘ 1
did we start loading the branch when user selects the repot?
q
not sure, prob - can check dev console
c
can you create an issue for pagination though
this is a tmp fix i believe
f
did we start loading the branch when user selects the repot?
Yes
πŸ‘ 1
c
so i think it should be fine
f
@quick-window-91705 how large of a scope is paginating branches going to be you think? Anyways tomorrow I'm going to rework the async dropdown (again) to fix issues I found today. If it's not big an effort, I can try to take care of branch pagination too
q
Fairly straightforward imo - I can help with early reviews along the way
f
Alright SGTM, I'll give it a shot but no promises of immediate success πŸ˜…
πŸ™ 1
thanks on a stick 1
c