Skip to content

Commit 48efa46

Browse files
krithika369Krithika Sundararajan
and
Krithika Sundararajan
authored
Add user-friendly experiment search filter (#42)
* API changes for status friendly filter * Update API test cases * Update Search UI * Update screenshot, fix lint error * Remove data-test-subj attribute Co-authored-by: Krithika Sundararajan <krithika.sundararajan@go-jek.com>
1 parent e1a9729 commit 48efa46

20 files changed

+432
-214
lines changed

.golangci.yml

-3
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,5 @@ linters:
2222
- varcheck
2323

2424
linters-settings:
25-
gocyclo:
26-
# Min code complexity to report, 30 by default (recommended 10-20)
27-
min-complexity: 25
2825
lll:
2926
line-length: 150

api/experiments.yaml

+21-12
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,15 @@ paths:
266266
in: query
267267
schema:
268268
$ref: 'schema.yaml#/components/schemas/ExperimentStatus'
269+
- name: status_friendly
270+
in: query
271+
description: |
272+
status_friendly is a combination of the status field, in conjunction with the duration,
273+
that produces a user-friendly classification of the experiment statuses. When this parameter
274+
is supplied, the status, start_time and end_time filters can also be set. However, the final
275+
result would be an intersection of the application of each of these filters.
276+
schema:
277+
$ref: 'schema.yaml#/components/schemas/ExperimentStatusFriendly'
269278
- name: end_time
270279
description: Used together with the start_time, to filter experiments that are at least partially running in the input range.
271280
in: query
@@ -1371,7 +1380,7 @@ components:
13711380
items:
13721381
$ref: 'schema.yaml#/components/schemas/Experiment'
13731382
paging:
1374-
$ref: "schema.yaml#/components/schemas/Paging"
1383+
$ref: 'schema.yaml#/components/schemas/Paging'
13751384
CreateExperimentSuccess:
13761385
description: Creates an experiment for the given project
13771386
content:
@@ -1417,9 +1426,9 @@ components:
14171426
data:
14181427
type: array
14191428
items:
1420-
$ref: "schema.yaml#/components/schemas/ExperimentHistory"
1429+
$ref: 'schema.yaml#/components/schemas/ExperimentHistory'
14211430
paging:
1422-
$ref: "schema.yaml#/components/schemas/Paging"
1431+
$ref: 'schema.yaml#/components/schemas/Paging'
14231432
GetExperimentHistorySuccess:
14241433
description: Get the specified historical version of an experiment
14251434
content:
@@ -1430,7 +1439,7 @@ components:
14301439
type: object
14311440
properties:
14321441
data:
1433-
$ref: "schema.yaml#/components/schemas/ExperimentHistory"
1442+
$ref: 'schema.yaml#/components/schemas/ExperimentHistory'
14341443
ListTreatmentsSuccess:
14351444
description: Returns treatments with the given project_id. If pagination options were used, the results are scoped accordingly and the paging info in the response body is set.
14361445
content:
@@ -1445,7 +1454,7 @@ components:
14451454
items:
14461455
$ref: 'schema.yaml#/components/schemas/Treatment'
14471456
paging:
1448-
$ref: "schema.yaml#/components/schemas/Paging"
1457+
$ref: 'schema.yaml#/components/schemas/Paging'
14491458
CreateTreatmentSuccess:
14501459
description: Creates a treatment for the given project
14511460
content:
@@ -1500,9 +1509,9 @@ components:
15001509
data:
15011510
type: array
15021511
items:
1503-
$ref: "schema.yaml#/components/schemas/TreatmentHistory"
1512+
$ref: 'schema.yaml#/components/schemas/TreatmentHistory'
15041513
paging:
1505-
$ref: "schema.yaml#/components/schemas/Paging"
1514+
$ref: 'schema.yaml#/components/schemas/Paging'
15061515
GetTreatmentHistorySuccess:
15071516
description: Get the specified historical version of a treatment
15081517
content:
@@ -1513,7 +1522,7 @@ components:
15131522
type: object
15141523
properties:
15151524
data:
1516-
$ref: "schema.yaml#/components/schemas/TreatmentHistory"
1525+
$ref: 'schema.yaml#/components/schemas/TreatmentHistory'
15171526
ListSegmentsSuccess:
15181527
description: Returns segments with the given project_id. The results are paginated and the paging info in the response body is set.
15191528
content:
@@ -1528,7 +1537,7 @@ components:
15281537
items:
15291538
$ref: 'schema.yaml#/components/schemas/Segment'
15301539
paging:
1531-
$ref: "schema.yaml#/components/schemas/Paging"
1540+
$ref: 'schema.yaml#/components/schemas/Paging'
15321541
CreateSegmentSuccess:
15331542
description: Creates a segment for the given project
15341543
content:
@@ -1583,9 +1592,9 @@ components:
15831592
data:
15841593
type: array
15851594
items:
1586-
$ref: "schema.yaml#/components/schemas/SegmentHistory"
1595+
$ref: 'schema.yaml#/components/schemas/SegmentHistory'
15871596
paging:
1588-
$ref: "schema.yaml#/components/schemas/Paging"
1597+
$ref: 'schema.yaml#/components/schemas/Paging'
15891598
GetSegmentHistorySuccess:
15901599
description: Get the specified historical version of a segment
15911600
content:
@@ -1596,7 +1605,7 @@ components:
15961605
type: object
15971606
properties:
15981607
data:
1599-
$ref: "schema.yaml#/components/schemas/SegmentHistory"
1608+
$ref: 'schema.yaml#/components/schemas/SegmentHistory'
16001609
securitySchemes:
16011610
bearerAuth:
16021611
type: http

api/schema.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ components:
156156
- segment
157157
- start_time
158158
- status
159+
- status_friendly
159160
- treatments
160161
- tier
161162
- type
@@ -195,6 +196,8 @@ components:
195196
type: string
196197
status:
197198
$ref: '#/components/schemas/ExperimentStatus'
199+
status_friendly:
200+
$ref: '#/components/schemas/ExperimentStatusFriendly'
198201
segment:
199202
$ref: '#/components/schemas/ExperimentSegment'
200203
id:
@@ -396,6 +399,17 @@ components:
396399
enum:
397400
- inactive
398401
- active
402+
ExperimentStatusFriendly:
403+
type: string
404+
description: |
405+
The user-friendly classification of experiment statuses. The categories are
406+
self-explanatory. Note that the current time plays a role in the definition
407+
of some of these statuses.
408+
enum:
409+
- running
410+
- scheduled
411+
- completed
412+
- deactivated
399413
ExperimentTier:
400414
type: string
401415
enum:

clients/management/managementclient.go

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/api/schema/schema.go

+69-46
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Loading
Loading

0 commit comments

Comments
 (0)