refactor(database): move step logic into separate package#810
Merged
refactor(database): move step logic into separate package#810
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
reviewed
Apr 11, 2023
cognifloyd
approved these changes
Apr 14, 2023
Member
cognifloyd
left a comment
There was a problem hiding this comment.
Nits resolved. No changes needed. LGTM!
Thanks again for doing all this refactoring. The database and API layers are feeling much cleaner.
wass3rw3rk
approved these changes
Apr 14, 2023
Member
wass3rw3rk
left a comment
There was a problem hiding this comment.
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 |
Member
There was a problem hiding this comment.
Suggested change
| // https://pkg.go.dev/github.com/go-vela/server/database/repo#New | |
| // https://pkg.go.dev/github.com/go-vela/server/database/step#New |
Contributor
Author
jbrockopp
added a commit
that referenced
this pull request
Apr 16, 2023
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.
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.com/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.