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
Initialize Trtl Database #52
Conversation
This pull request has been linked to Shortcut Story #10265: Spike: Postgres or Trtl?. |
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.
Good start!
@@ -136,6 +148,10 @@ func TestAllowAllOrigins(t *testing.T) { | |||
require.True(t, conf.AllowAllOrigins(), "expected allow all origins to be true when * is set") | |||
} | |||
|
|||
func TestDatabase(t *testing.T) { | |||
// TODO: test DatabaseConfig validation |
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.
@daniellemaxwell would you mind creating a story for this please?
// TODO: do we need any other key components for listing tenants? | ||
return t.ID.MarshalBinary() | ||
} | ||
|
||
func (t *Tenant) Namespace() string { | ||
return TenantNamespace | ||
} | ||
|
||
func (t *Tenant) MarshalValue() ([]byte, error) { | ||
// TODO: look into bson, msgpack, etc. | ||
return json.Marshal(t) | ||
} | ||
|
||
func (t *Tenant) UnmarshalValue(data []byte) error { | ||
// TODO: look into bson, msgpack, etc. | ||
return json.Unmarshal(data, t) |
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.
@daniellemaxwell would you mind creating a story for these TODOs please?
if conf.Insecure { | ||
opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials())) | ||
} else { | ||
// TODO: connect with mtls |
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.
@daniellemaxwell would you mind creating a story for connecting to trtl using mTLS please?
// database is already connected then nothing will happen). | ||
func Connect(conf config.DatabaseConfig) (err error) { | ||
if conf.Testing { | ||
// TODO: setup mock trtl connection for testing |
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.
@daniellemaxwell (last one I think) would you mind creating two stories for this TODO:
- Implement mock trtl for testing tenant (this TODO)
- Implement tests for the db package interactions with trtl (not this TODO but related)
Codecov Report
@@ Coverage Diff @@
## main #52 +/- ##
==========================================
- Coverage 52.32% 49.39% -2.93%
==========================================
Files 47 49 +2
Lines 3232 3468 +236
==========================================
+ Hits 1691 1713 +22
- Misses 1359 1566 +207
- Partials 182 189 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Scope of changes
Initializes trtl database for Tenant.
Fixes SC-10265
Type of change