fix(coderd): support exact user email search - #27922
Open
wyattfry wants to merge 3 commits into
Open
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
cdrci2
added a commit
to coder/cla
that referenced
this pull request
Aug 6, 2026
wyattfry
force-pushed
the
wf/user-email-search
branch
from
August 6, 2026 14:23
c2143e3 to
3f5764c
Compare
Author
|
recheck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
User search can now resolve exact
email:andusername:terms throughGET /api/v2/usersinstead of only supporting fuzzy free-text matches. The database query already had exact email and username filters; this wires the public search parser and API handler to those filters so clients can ask for a single user by email without fetching every user or depending on substring matching.This is the API half of coder/terraform-provider-coderd#403: that provider PR adds
data.coderd_user.email, and this PR gives it an efficient exact lookup path.Testing
go test ./coderd/searchquery -run '^TestSearchUsers$' -count=1go test ./coderd -run '^TestGetUsersFilter$' -count=1http://127.0.0.1:39991against a clean Postgres database.lookup-target@example.com.GET /api/v2/users?q=email:LOOKUP-TARGET@EXAMPLE.COM&limit=2returned exactly one user:{ "count": 1, "users": [ { "id": "efc6f909-ce0a-4731-bd2f-6e4df417aaa7", "username": "lookup-target", "email": "lookup-target@example.com" } ] }