-
Notifications
You must be signed in to change notification settings - Fork 67
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
Add Data store as resource on backend #2385
Add Data store as resource on backend #2385
Conversation
bf2e9ec
to
7e859f5
Compare
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.
Right now, I've added datastoreresource
package inside of tracedb
, because I thought they manage the same thing, even knowing that tracedb
is heavily infrastructure-based code.
I accept suggestions on other places that could not be confusing 🙃
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 this makes sense. I was thinking that maybe we don't need a package specifically for the resource. Maybe it could live directly under tracedb
? This is an open question
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.
we discussed this and decided we'll keep the separated project. this approach allows more flexibility
de55b1f
to
7ace777
Compare
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.
this looks like a weird name. is it like this for any particular reason?
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.
An ill-succeed experiment that I've done to try to focus all repository tests on the same place. 🤦 🙃
On later versions, I've changed to repository_tests.go
|
||
// reuse the created_at field for auditing purposes, | ||
// unless the client explicitly send it | ||
createdAt, err := r.getCreatedAt(ctx, dataStore) |
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.
do we need to support this case? I think unless we have an explicit need for this, clients should not be allowed to set this
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.
We have this case today, I believe that we can remove it on the future.
server/model/data_stores.go
Outdated
@@ -111,6 +111,7 @@ func (ds DataStore) HasID() bool { | |||
} | |||
|
|||
func (ds DataStore) Validate() error { | |||
//TODO: replace for resource validate |
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.
would it make sense to address these TODOs in this PR?
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.
Yes! I'm working on it.
df280fd
to
a0b165a
Compare
17add7e
to
17fdb8f
Compare
ab5b1c4
to
ed03a5f
Compare
…2368) Fixing sorting fields on OpenAPI Updating OpenAPI to consider DataStore endpoint managing only one record Add endpoint in plural
17fdb8f
to
a997d88
Compare
1b524b2
to
156958c
Compare
…2368) Fixing sorting fields on OpenAPI Updating OpenAPI to consider DataStore endpoint managing only one record Add endpoint in plural
a997d88
to
ea05beb
Compare
return manager | ||
} | ||
|
||
func cleanup(t *testing.T, manager resourcemanager.Manager) { |
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.
Without a cleanup structure, this test file surpasses more than 100 idle connections. Later we need to think about how we can improve the RM structure to avoid these open connections.
b4b9ee8
to
6a1808f
Compare
ea05beb
to
57eb095
Compare
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!
a3eafe2
into
feature/datastore-as-resource
… CLI commands (#2414) * Updating DataStore API definition to consider ResourcesAPI structure (#2368) Fixing sorting fields on OpenAPI Updating OpenAPI to consider DataStore endpoint managing only one record Add endpoint in plural * Add Data store as resource on Backend (#2385) * feat(frontend): add data store as resource (#2423) * Add data store as resource on CLI (#2422) * Updating DataStore API definition to consider ResourcesAPI structure (#2368) Fixing sorting fields on OpenAPI Updating OpenAPI to consider DataStore endpoint managing only one record Add endpoint in plural * Adding datastoreresource package * Update internal references to use datastoreresource package * Isolate database resources on each test * Adding behavior for no datastore scenario * Fixing rebase problems * Fixing another rebase problem * Updating DataStore API definition to consider ResourcesAPI structure (#2368) Fixing sorting fields on OpenAPI Updating OpenAPI to consider DataStore endpoint managing only one record Add endpoint in plural * Fixing merge * Adding documentation for delete operation * Improving cleanup code * Updating datastore API * Adding CLI generated code * wip * wip * Fixing CLI * deprecated old commands * Adding wrongly deleted file * simplifying the resource actions creation steps --------- Co-authored-by: Oscar Reyes <oscar-rreyes1@hotmail.com> * fix ingester dsRepo * chore(docs): update data store docs and examples (#2429) * removing test deletion * fixing provisioning file * fixing provisioning file --------- Co-authored-by: Jorge Padilla <jorge.esteban.padilla@gmail.com> Co-authored-by: Oscar Reyes <oscar-rreyes1@hotmail.com>
… CLI commands (#2414) * Updating DataStore API definition to consider ResourcesAPI structure (#2368) Fixing sorting fields on OpenAPI Updating OpenAPI to consider DataStore endpoint managing only one record Add endpoint in plural * Add Data store as resource on Backend (#2385) * feat(frontend): add data store as resource (#2423) * Add data store as resource on CLI (#2422) * Updating DataStore API definition to consider ResourcesAPI structure (#2368) Fixing sorting fields on OpenAPI Updating OpenAPI to consider DataStore endpoint managing only one record Add endpoint in plural * Adding datastoreresource package * Update internal references to use datastoreresource package * Isolate database resources on each test * Adding behavior for no datastore scenario * Fixing rebase problems * Fixing another rebase problem * Updating DataStore API definition to consider ResourcesAPI structure (#2368) Fixing sorting fields on OpenAPI Updating OpenAPI to consider DataStore endpoint managing only one record Add endpoint in plural * Fixing merge * Adding documentation for delete operation * Improving cleanup code * Updating datastore API * Adding CLI generated code * wip * wip * Fixing CLI * deprecated old commands * Adding wrongly deleted file * simplifying the resource actions creation steps --------- Co-authored-by: Oscar Reyes <oscar-rreyes1@hotmail.com> * fix ingester dsRepo * chore(docs): update data store docs and examples (#2429) * removing test deletion * fixing provisioning file * fixing provisioning file --------- Co-authored-by: Jorge Padilla <jorge.esteban.padilla@gmail.com> Co-authored-by: Oscar Reyes <oscar-rreyes1@hotmail.com>
This PR adds the Data Store as a resource into the Tracetest server.
On this PR, both the old and new structures coexist on the API. The next PR will update the OpenAPI code with make generate and change the references to use this structure.
Loom: https://www.loom.com/share/45b49110030d4b0688b51c059f97388c
Changes
Fixes
Checklist