Skip to content
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 field selector to list experiments API #44

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
02a7571
Add field selector to list experiments API
deadlycoconuts Oct 17, 2022
445de2f
Refactor experiment service by creating more helper functions
deadlycoconuts Oct 17, 2022
1eeb15a
Specify table fields when UI queries API for experiments list
deadlycoconuts Oct 17, 2022
4df309d
Fix refactoring changes
deadlycoconuts Oct 18, 2022
de9cf07
Update experiment context to query more experiments at once
deadlycoconuts Oct 18, 2022
5d81cce
Remove all experiment fields from required field
deadlycoconuts Oct 25, 2022
e82df84
Make list experiments return paginated responses when page values are…
deadlycoconuts Oct 25, 2022
5bccf98
Simplify api call to list experiments to only be performed once
deadlycoconuts Oct 25, 2022
5fa5bd1
Fix changes to experiment models struct
deadlycoconuts Oct 25, 2022
7a6872b
Update treatment service with changes to experiment model struct
deadlycoconuts Oct 25, 2022
30302ec
Refactor pagination to only take place when fields are not specified
deadlycoconuts Oct 25, 2022
cec0c97
Fix bug whereby query fields were not passed to experiment service
deadlycoconuts Oct 25, 2022
3822e92
Make api call to display number of experiments retrieve only 1 field
deadlycoconuts Oct 25, 2022
b7bccab
Simplify API calls to list experiments endpoint
deadlycoconuts Oct 26, 2022
8c701c0
Fix bug whereby query fields were not passed to experiment service
deadlycoconuts Oct 26, 2022
f22bddc
Revert changes to experiments config group by modifying experiments c…
deadlycoconuts Oct 26, 2022
09739a4
Refactor configs and contexts
deadlycoconuts Nov 3, 2022
c990155
Refactor fieldNamesSet by using imported set
deadlycoconuts Nov 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the change in this PR, all fields from Experiment should be considered to be not required, like we do for Treatment.

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