Skip to content

Commit

Permalink
Add field selector to list experiments API (#44)
Browse files Browse the repository at this point in the history
* Add field selector to list experiments API

* Refactor experiment service by creating more helper functions

* Specify table fields when UI queries API for experiments list

* Fix refactoring changes

* Update experiment context to query more experiments at once

* Remove all experiment fields from required field

* Make list experiments return paginated responses when page values are not specified

* Simplify api call to list experiments to only be performed once

* Fix changes to experiment models struct

* Update treatment service with changes to experiment model struct

* Refactor pagination to only take place when fields are not specified

* Fix bug whereby query fields were not passed to experiment service

* Make api call to display number of experiments retrieve only 1 field

* Simplify API calls to list experiments endpoint

* Fix bug whereby query fields were not passed to experiment service

* Revert changes to experiments config group by modifying experiments controller behaviour

* Refactor configs and contexts

* Refactor fieldNamesSet by using imported set
  • Loading branch information
deadlycoconuts committed Nov 3, 2022
1 parent 20df1c9 commit a2cf2c6
Show file tree
Hide file tree
Showing 25 changed files with 791 additions and 400 deletions.
9 changes: 9 additions & 0 deletions api/experiments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,15 @@ paths:
in: query
schema:
type: boolean
- name: fields
description: |
A selector to restrict the list of returned objects by their fields. If unset, all the fields will be returned.
Paginated responses will be returned if both or either of `page` and `page_size` parameters are provided.
in: query
schema:
type: array
items:
$ref: 'schema.yaml#/components/schemas/ExperimentField'
responses:
200:
$ref: '#/components/responses/ListExperimentsSuccess'
Expand Down
22 changes: 8 additions & 14 deletions api/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,25 +145,19 @@ components:
$ref: '#/components/schemas/SelectedTreatmentData'
metadata:
$ref: '#/components/schemas/SelectedTreatmentMetadata'
Experiment:
required:
- project_id
- description
- end_time
ExperimentField:
type: string
enum:
- id
- interval
- name
- segment
- start_time
- status
- type
- status_friendly
- treatments
- tier
- type
- created_at
- start_time
- end_time
- updated_at
- updated_by
- version
- treatments
Experiment:
type: object
properties:
description:
Expand Down
20 changes: 20 additions & 0 deletions clients/management/managementclient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

122 changes: 73 additions & 49 deletions common/api/schema/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a2cf2c6

Please sign in to comment.