Skip to content

Commit

Permalink
feature: Migrate DataStore to use Resources Manager structure and fix…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
3 people committed Apr 26, 2023
1 parent 87332a7 commit fcd4918
Show file tree
Hide file tree
Showing 114 changed files with 2,662 additions and 3,647 deletions.
13 changes: 8 additions & 5 deletions TESTING.md
Expand Up @@ -15,7 +15,7 @@ This is a simple test to check if Tracetest is working correctly given it was pr
The steps that we should follow are:

- [ ] Open WebUI and go to `/settings` page. The provisioned Data Store should be selected.
- [ ] Run `tracetest datastore export -d {provisioned_datastore}` and check if the data was exported correctly.
- [ ] Run `tracetest export datastore --id current` and check if the data was exported correctly.
- [ ] Create a test on WebUI that calls a demo API (like [Pokeshop](https://docs.tracetest.io/live-examples/pokeshop/overview) or [Open Telemetry Store](https://docs.tracetest.io/live-examples/opentelemetry-store/overview)). This test should fetch traces correctly and run without errors.

### Checklist on version release
Expand All @@ -25,16 +25,17 @@ This is the entire checklist on what we should do to assert that Tracetest is wo
- [ ] Check if our release pipeline on [Release Tracetest](https://github.com/kubeshop/tracetest/actions/workflows/release-version.yml) workflow on Github Actions worked correctly.
- [ ] Double check [Detailed installation](https://docs.tracetest.io/getting-started/detailed-installation) doc and see if everything is documented correctly


### Tests to validate RC

- Test server installation via CLI

- [ ] Docker Compose and no demo API
- [ ] Docker Compose and demo API
- [ ] Kubernetes and no demo API
- [ ] Kubernetes and demo API

- Test Tracetest examples

- [ ] [Amazon X-Ray example](https://github.com/kubeshop/tracetest/tree/main/examples/tracetest-amazon-x-ray)
- [ ] [Datadog example](https://github.com/kubeshop/tracetest/tree/main/examples/tracetest-datadog)
- [ ] [Elastic APM example](https://github.com/kubeshop/tracetest/tree/main/examples/tracetest-elasticapm)
Expand All @@ -43,18 +44,20 @@ This is the entire checklist on what we should do to assert that Tracetest is wo
- [ ] [SignalFX example](https://github.com/kubeshop/tracetest/tree/main/examples/tracetest-signalfx)

- Test specific features added/changed on this release:

- [ ] Add features here

### Tests to validate final release

- Test CLI updates

- [ ] MacOS via homebrew
- [ ] MacOS via curl script
- [ ] Windows via chocolatey
- [ ] Windows via manual download

- Test specific features added/changed on this release:
- [ ] Add features here


## Automatic Tests

Expand All @@ -63,7 +66,7 @@ Today Tracetest has 3 main components: a WebUI, a CLI and a Server.
### Web UI

- **Unit tests**: Run by executing `npm test` on `./web` folder
- **End-to-end tests**: Run using [cypress](https://www.cypress.io/) against a temporary Tracetest created on Kubernetes.
- **End-to-end tests**: Run using [cypress](https://www.cypress.io/) against a temporary Tracetest created on Kubernetes.

### CLI

Expand Down
27 changes: 13 additions & 14 deletions api/dataStores.yaml
@@ -1,6 +1,17 @@
openapi: 3.0.0
components:
schemas:
DataStoreResource:
type: object
description: "Represents a data store structured into the Resources format."
properties:
type:
type: string
description: "Represents the type of this resource. It should always be set as 'DataStore'."
enum:
- DataStore
spec:
$ref: "#/components/schemas/DataStore"
DataStore:
type: object
required:
Expand All @@ -14,7 +25,7 @@ components:
type: string
type:
$ref: "#/components/schemas/SupportedDataStores"
isDefault:
default:
type: boolean
jaeger:
$ref: "#/components/schemas/GRPCClientSettings"
Expand Down Expand Up @@ -147,19 +158,7 @@ components:
type: string
SupportedDataStores:
type: string
enum:
[
jaeger,
openSearch,
tempo,
signalFx,
otlp,
elasticApm,
newRelic,
lightstep,
datadog,
awsxray,
]
enum: [jaeger, openSearch, tempo, signalFx, otlp, elasticApm, newRelic, lightstep, datadog, awsxray]
SupportedClients:
type: string
enum: [http, grpc]
83 changes: 12 additions & 71 deletions api/openapi.yaml
Expand Up @@ -1091,59 +1091,10 @@ paths:
description: "problem deleting a demo"

# Data Stores
/datastores:
get:
tags:
- api
summary: "Get all Data Stores"
description: "Get all Data Stores"
operationId: getDataStores
parameters:
- $ref: "./parameters.yaml#/components/parameters/take"
- $ref: "./parameters.yaml#/components/parameters/skip"
- $ref: "./parameters.yaml#/components/parameters/query"
- $ref: "./parameters.yaml#/components/parameters/sortBy"
- $ref: "./parameters.yaml#/components/parameters/sortDirection"
responses:
200:
description: successful operation
headers:
X-Total-Count:
schema:
type: integer
description: Total records count
content:
application/json:
schema:
type: array
items:
$ref: "./dataStores.yaml#/components/schemas/DataStore"
500:
description: "problem with getting data stores"
post:
tags:
- api
summary: "Create a new Data Store"
description: "Create a new Data Store"
operationId: createDataStore
requestBody:
content:
application/json:
schema:
$ref: "./dataStores.yaml#/components/schemas/DataStore"
responses:
200:
description: successful operation
content:
application/json:
schema:
$ref: "./dataStores.yaml#/components/schemas/DataStore"
400:
description: "trying to create a data store with an already existing ID"
/datastores/{dataStoreId}:
get:
tags:
- api
- resource-api
parameters:
- $ref: "./parameters.yaml#/components/parameters/dataStoreId"
summary: "Get a Data Store"
Expand All @@ -1155,12 +1106,14 @@ paths:
content:
application/json:
schema:
$ref: "./dataStores.yaml#/components/schemas/DataStore"
$ref: "./dataStores.yaml#/components/schemas/DataStoreResource"
404:
description: "data store not found"
500:
description: "problem with getting a data store"
put:
tags:
- api
- resource-api
parameters:
- $ref: "./parameters.yaml#/components/parameters/dataStoreId"
summary: "Update a Data Store"
Expand All @@ -1174,32 +1127,20 @@ paths:
responses:
204:
description: successful operation
400:
description: "invalid data store, some data was sent in incorrect format."
500:
description: "problem with updating data store"
delete:
tags:
- api
- resource-api
parameters:
- $ref: "./parameters.yaml#/components/parameters/dataStoreId"
summary: "Delete a Data Store"
description: "Delete a Data Store"
operationId: deleteDataStore
responses:
"204":
description: OK
/datastores/{dataStoreId}/definition.yaml:
get:
tags:
- api
parameters:
- $ref: "./parameters.yaml#/components/parameters/dataStoreId"
summary: Get the data store definition as an YAML file
description: Get the data store as an YAML file
operationId: getDataStoreDefinitionFile
responses:
200:
description: OK
content:
application/yaml:
schema:
type: string
204:
description: successful operation
500:
description: "problem with data store deletion"
120 changes: 0 additions & 120 deletions cli/actions/apply_datastore_action.go

This file was deleted.

0 comments on commit fcd4918

Please sign in to comment.