Adding user_by_username method for single user #671
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change
This change allows you to run a username search to find a single user.
Context
The GitLab api
searchparameter searches through more than justusername. According to the docs, it searchesname,usernameandpublic_email.You can see this behaviour here:
If I wanted to get a specific user by username, I need to use the
usernameparameter:You can see this doesn't also return users starting with
reported_user_1(likereported_user_10, etc)Current behaviour
The current
user_searchendpoint would require the following invocation to return a single user:Invoking the same with 'simply'
user_searchreturns multiple matches: