ansible / galaxy

Legacy Galaxy still available as read-only on https://old-galaxy.ansible.com - looking for the new galaxy -> https://github.com/ansible/galaxy_ng
Apache License 2.0
853 stars 328 forks source link

Can't add user to namespace due to GitHub username being a common substring #2322

Open j00bar opened 4 years ago

j00bar commented 4 years ago

Bug Report

SUMMARY

I was trying to add a GitHub user as an owner to my namespace whose username is a 4 letter word. There are more than 10 users in Galaxy whose username contains the 4 letter word. When I try to find him in the user picker with a search, despite the search being a perfect match to his username, he does not appear in the list of ten options. I have no way to refine the filter further.

STEPS TO REPRODUCE
  1. Go to edit a namespace.
  2. Enter ares in the search box for Namespace Owners
  3. Scroll through the list of 10 results and see that ten other users whose username contain the substring ares appear, but not @ares himself.
EXPECTED RESULTS

I expected the exact match to be the first result among the ten.

ACTUAL RESULTS

image

chouseknecht commented 4 years ago

What namespace?

chouseknecht commented 4 years ago

The search to https://galaxy.ansible.com/api/v1/users/?or__username__icontains=ares returns 43 results, but we only show 10. Maybe we simply return more than 10 and add an orderby as a simple fix.

newswangerd commented 4 years ago

I think there are a couple of solutions

We could

There are pros and cons to each of these. I think the second might be my favorite though

j00bar commented 4 years ago

How about istartswith ordered ascending by username?

Exact match will come first. After that, it will be ordered by alphabetically. So long as you never hit a case where you don't see the exact match, no problems - you can keep typing to drill down.