-
Notifications
You must be signed in to change notification settings - Fork 30
refactor(database): move step logic into separate package #810
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 @@
## main #810 +/- ##
==========================================
- Coverage 58.12% 57.91% -0.22%
==========================================
Files 255 263 +8
Lines 15892 15862 -30
==========================================
- Hits 9238 9187 -51
- Misses 6249 6261 +12
- Partials 405 414 +9
|
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.
Just a few nits.
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.
Nits resolved. No changes needed. LGTM!
Thanks again for doing all this refactoring. The database and API layers are feeling much cleaner.
wass3rw3rk
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.
super minor copy pasta error, but i don't want to hold back merge
|
|
||
| // create the database agnostic step service | ||
| // | ||
| // https://pkg.go.dev/github.com/go-vela/server/database/repo#New |
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.
| // https://pkg.go.dev/github.com/go-vela/server/database/repo#New | |
| // https://pkg.go.dev/github.com/go-vela/server/database/step#New |
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.
Based off of #574, #663, #687, #692, #721, #722 and #782
This change continues the refactor efforts initially introduced in the above PRs.
This adds a new
steppackage to thegithub.amrom.workers.dev/go-vela/server/databasepackage.This contains a
StepServiceinterface declaring all functions necessary for step based interactions with the database:server/database/step/service.go
Lines 11 to 49 in cc2aa4b
This package also contains the
enginewhich implements the above service interface:server/database/step/step.go
Lines 23 to 38 in cc2aa4b
This
enginecontains no raw SQL queries for integrating with thestepstable.Instead, we leverage our DB library's (https://gorm.io/) agnostic abstraction for integrating with that table.