-
Notifications
You must be signed in to change notification settings - Fork 883
feat: support filtering users table by login type #17238
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
Conversation
All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
Thanks for the PR! Looking good so far, but we'll need some tests. I believe the right place for those is Also, please run |
@ethanndickson I added a few tests for the PR and I also ran the commands which you mentioned Edit: Can you please help me in running the users_test.go file? I am not able to figure out why the test is failing. Making a call from the frontend works fine but the unit test keeps on failing. I am not sure if there is some extra config required to make it run |
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.
Your newly written tests are failing as, by default, DB queries are ran against a fake DB in dbmem.go
. You'll need to update the GetUsers
Go function with the same logic as the Postgres query.
To run go test
against postgres, just set DB=ci
:
DB=ci go test -run "TestGetUsersFilters" github.com/coder/coder/v2/coderd
(This is essentially what make test-postgres
does)
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.
Nice work on these tests! Just a few comments, mostly on style.
CI is all passing except for weekly-docs / check-docs
, which you can safely ignore (it should go away if you merge / rebase your branch off main)
Thank you for your feed @ethanndickson. I am to blame for these silly errors because of my over-reliance on copilot. I have fixed the style and removed unnecessary comments from the code. Please have a look again. |
ok @ethanndickson I think this final test should do it |
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.
Looking good, just two comments on the copy.
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.
Thanks a lot for the PR and your patience through these review cycles! ❤️
Waiting for macOS runner issue to be resolved, will reapprove
Thank you @ethanndickson for staying with me. This was my first ever PR in Go and I learned a lot. 🥳 🍾 |
#15896 Mentions ability to add support for filtering by login type
The issue mentions that backend API support exists but the backend did not seem to have the support for this filter. So I have added the ability to filter it.
I also added a corresponding update to readme file to make sure the docs will correctly showcase this feature