-
Notifications
You must be signed in to change notification settings - Fork 30
refactor(database): move user logic into separate package #663
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
Codecov Report
@@ Coverage Diff @@
## master #663 +/- ##
==========================================
+ Coverage 54.94% 55.14% +0.20%
==========================================
Files 195 201 +6
Lines 15962 15882 -80
==========================================
- Hits 8770 8758 -12
+ Misses 6818 6748 -70
- Partials 374 376 +2
|
cognifloyd
left a comment
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.
Maybe point out in the docstrings ListUsers and ListLiteUsers differ (what makes it "Lite").
It looks like Lite just slips decrypting fields, right? Anything else?
Other than that, it looks good to me.
|
@cognifloyd the server/database/user/list_lite.go Lines 38 to 44 in a3798c3
This function is called when someone sends a The Lines 34 to 37 in a3798c3
This function is called when someone sends a
Do you have thoughts on what kind of changes you'd like to see regarding the function comments? |
cognifloyd
left a comment
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.
Maybe something like this?
Co-authored-by: Jacob Floyd <[email protected]>
kneal
left a comment
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.
LGTM 🐬
ecrupper
left a comment
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.
LGTM - really like this new pattern
Based off of #574
This change continues the refactor effort initially introduced in the above PR.
This adds a new
userpackage to thegithub.amrom.workers.dev/go-vela/server/databasepackage.This contains a
UserServiceinterface declaring all functions necessary for user based interactions with the database:server/database/user/service.go
Lines 11 to 45 in b2350a9
This package also contains the
enginewhich implements the above service interface:server/database/user/user.go
Lines 25 to 39 in b2350a9
This
enginecontains no raw SQL queries for integrating with theuserstable.Instead, we leverage our DB library's (https://gorm.io/) agnostic abstraction for integrating with that table.