-
Notifications
You must be signed in to change notification settings - Fork 162
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
Validate datastore engine #810
base: main
Are you sure you want to change the base?
Conversation
Hi @jon-whit, based on our last discussion, raised this PR to verify Datastore engine. I have purposefully setup validation after unmarshalling of configs, as I can't write custom unmarshal for viper. Please have a look. Thanks |
cmd/run/run_test.go
Outdated
|
||
t.Run("correct datastore engine specified", func(t *testing.T) { | ||
cfg := DefaultConfig() | ||
cfg.Datastore.URI = "postgresql://localhost:5432" |
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.
I didn't think postgresql
was a valid prefix? The enumerations in cmd/shared.go
below define postgres
.
This test should return an error, and we should change this test to assert postgres://localhost:5432
does not.
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.
I think, I accidently set URI in this test. I just wanted to test for correct DatastoreEngine. After changes, I am getting expected result.
Although one thing which I noticed is, on setting wrong postgres URI, RunServer
stalls and waits for connection. I think we should fail early. Let me know your thoughts
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.
Left some comments for review.
@jon-whit Addressed comments, plz check. |
ba13dc3
to
fa88048
Compare
It appears this PR has been stale for at least 14 days 🗓️. If no action is taken the maintainer team may consider closing the PR. Please reach out if you need assistance or help to finish the work 👍🏼. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #810 +/- ##
==========================================
+ Coverage 86.05% 86.08% +0.03%
==========================================
Files 85 86 +1
Lines 8048 8064 +16
==========================================
+ Hits 6925 6941 +16
Misses 792 792
Partials 331 331 ☔ View full report in Codecov by Sentry. |
Hi @Himanshu372, i apologize for taking so long to review this. I took the liberty of updating this PR with respect to main. I also added some more validations to the datastore configs. |
Description
Added
DatastoreEngine
type which takes up const permissible engine type valuesDatastoreEngine
References
Addresses comment - #712 (comment)
Closes #681
Review Checklist
main