Skip to content

Commit fcd4918

Browse files
danielbdiasjorgeepcxoscar
authored
feature: Migrate DataStore to use Resources Manager structure and fix 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 <[email protected]> * 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 <[email protected]> Co-authored-by: Oscar Reyes <[email protected]>
1 parent 87332a7 commit fcd4918

File tree

114 files changed

+2662
-3647
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+2662
-3647
lines changed

TESTING.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This is a simple test to check if Tracetest is working correctly given it was pr
1515
The steps that we should follow are:
1616

1717
- [ ] Open WebUI and go to `/settings` page. The provisioned Data Store should be selected.
18-
- [ ] Run `tracetest datastore export -d {provisioned_datastore}` and check if the data was exported correctly.
18+
- [ ] Run `tracetest export datastore --id current` and check if the data was exported correctly.
1919
- [ ] 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.
2020

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

28-
2928
### Tests to validate RC
3029

3130
- Test server installation via CLI
31+
3232
- [ ] Docker Compose and no demo API
3333
- [ ] Docker Compose and demo API
3434
- [ ] Kubernetes and no demo API
3535
- [ ] Kubernetes and demo API
3636

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

4546
- Test specific features added/changed on this release:
47+
4648
- [ ] Add features here
47-
49+
4850
### Tests to validate final release
51+
4952
- Test CLI updates
53+
5054
- [ ] MacOS via homebrew
5155
- [ ] MacOS via curl script
5256
- [ ] Windows via chocolatey
5357
- [ ] Windows via manual download
5458

5559
- Test specific features added/changed on this release:
5660
- [ ] Add features here
57-
5861

5962
## Automatic Tests
6063

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

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

6871
### CLI
6972

api/dataStores.yaml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
openapi: 3.0.0
22
components:
33
schemas:
4+
DataStoreResource:
5+
type: object
6+
description: "Represents a data store structured into the Resources format."
7+
properties:
8+
type:
9+
type: string
10+
description: "Represents the type of this resource. It should always be set as 'DataStore'."
11+
enum:
12+
- DataStore
13+
spec:
14+
$ref: "#/components/schemas/DataStore"
415
DataStore:
516
type: object
617
required:
@@ -14,7 +25,7 @@ components:
1425
type: string
1526
type:
1627
$ref: "#/components/schemas/SupportedDataStores"
17-
isDefault:
28+
default:
1829
type: boolean
1930
jaeger:
2031
$ref: "#/components/schemas/GRPCClientSettings"
@@ -147,19 +158,7 @@ components:
147158
type: string
148159
SupportedDataStores:
149160
type: string
150-
enum:
151-
[
152-
jaeger,
153-
openSearch,
154-
tempo,
155-
signalFx,
156-
otlp,
157-
elasticApm,
158-
newRelic,
159-
lightstep,
160-
datadog,
161-
awsxray,
162-
]
161+
enum: [jaeger, openSearch, tempo, signalFx, otlp, elasticApm, newRelic, lightstep, datadog, awsxray]
163162
SupportedClients:
164163
type: string
165164
enum: [http, grpc]

api/openapi.yaml

Lines changed: 12 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,59 +1091,10 @@ paths:
10911091
description: "problem deleting a demo"
10921092

10931093
# Data Stores
1094-
/datastores:
1095-
get:
1096-
tags:
1097-
- api
1098-
summary: "Get all Data Stores"
1099-
description: "Get all Data Stores"
1100-
operationId: getDataStores
1101-
parameters:
1102-
- $ref: "./parameters.yaml#/components/parameters/take"
1103-
- $ref: "./parameters.yaml#/components/parameters/skip"
1104-
- $ref: "./parameters.yaml#/components/parameters/query"
1105-
- $ref: "./parameters.yaml#/components/parameters/sortBy"
1106-
- $ref: "./parameters.yaml#/components/parameters/sortDirection"
1107-
responses:
1108-
200:
1109-
description: successful operation
1110-
headers:
1111-
X-Total-Count:
1112-
schema:
1113-
type: integer
1114-
description: Total records count
1115-
content:
1116-
application/json:
1117-
schema:
1118-
type: array
1119-
items:
1120-
$ref: "./dataStores.yaml#/components/schemas/DataStore"
1121-
500:
1122-
description: "problem with getting data stores"
1123-
post:
1124-
tags:
1125-
- api
1126-
summary: "Create a new Data Store"
1127-
description: "Create a new Data Store"
1128-
operationId: createDataStore
1129-
requestBody:
1130-
content:
1131-
application/json:
1132-
schema:
1133-
$ref: "./dataStores.yaml#/components/schemas/DataStore"
1134-
responses:
1135-
200:
1136-
description: successful operation
1137-
content:
1138-
application/json:
1139-
schema:
1140-
$ref: "./dataStores.yaml#/components/schemas/DataStore"
1141-
400:
1142-
description: "trying to create a data store with an already existing ID"
11431094
/datastores/{dataStoreId}:
11441095
get:
11451096
tags:
1146-
- api
1097+
- resource-api
11471098
parameters:
11481099
- $ref: "./parameters.yaml#/components/parameters/dataStoreId"
11491100
summary: "Get a Data Store"
@@ -1155,12 +1106,14 @@ paths:
11551106
content:
11561107
application/json:
11571108
schema:
1158-
$ref: "./dataStores.yaml#/components/schemas/DataStore"
1109+
$ref: "./dataStores.yaml#/components/schemas/DataStoreResource"
1110+
404:
1111+
description: "data store not found"
11591112
500:
11601113
description: "problem with getting a data store"
11611114
put:
11621115
tags:
1163-
- api
1116+
- resource-api
11641117
parameters:
11651118
- $ref: "./parameters.yaml#/components/parameters/dataStoreId"
11661119
summary: "Update a Data Store"
@@ -1174,32 +1127,20 @@ paths:
11741127
responses:
11751128
204:
11761129
description: successful operation
1130+
400:
1131+
description: "invalid data store, some data was sent in incorrect format."
11771132
500:
11781133
description: "problem with updating data store"
11791134
delete:
11801135
tags:
1181-
- api
1136+
- resource-api
11821137
parameters:
11831138
- $ref: "./parameters.yaml#/components/parameters/dataStoreId"
11841139
summary: "Delete a Data Store"
11851140
description: "Delete a Data Store"
11861141
operationId: deleteDataStore
11871142
responses:
1188-
"204":
1189-
description: OK
1190-
/datastores/{dataStoreId}/definition.yaml:
1191-
get:
1192-
tags:
1193-
- api
1194-
parameters:
1195-
- $ref: "./parameters.yaml#/components/parameters/dataStoreId"
1196-
summary: Get the data store definition as an YAML file
1197-
description: Get the data store as an YAML file
1198-
operationId: getDataStoreDefinitionFile
1199-
responses:
1200-
200:
1201-
description: OK
1202-
content:
1203-
application/yaml:
1204-
schema:
1205-
type: string
1143+
204:
1144+
description: successful operation
1145+
500:
1146+
description: "problem with data store deletion"

cli/actions/apply_datastore_action.go

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)