-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathfeature_flags.feature
More file actions
611 lines (534 loc) · 42.9 KB
/
feature_flags.feature
File metadata and controls
611 lines (534 loc) · 42.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
@endpoint(feature-flags) @endpoint(feature-flags-v2)
Feature: Feature Flags
Manage feature flags and environments.
Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "FeatureFlags" API
@generated @skip @team:DataDog/feature-flags
Scenario: Approve a flag suggestion returns "Bad Request" response
Given new "ApproveFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"comment": "Looks good, approved!"}, "type": "flag-suggestion-events"}}
When the request is sent
Then the response status is 400 Bad Request
@generated @skip @team:DataDog/feature-flags
Scenario: Approve a flag suggestion returns "Not Found" response
Given new "ApproveFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"comment": "Looks good, approved!"}, "type": "flag-suggestion-events"}}
When the request is sent
Then the response status is 404 Not Found
@generated @skip @team:DataDog/feature-flags
Scenario: Approve a flag suggestion returns "OK" response
Given new "ApproveFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"comment": "Looks good, approved!"}, "type": "flag-suggestion-events"}}
When the request is sent
Then the response status is 200 OK
@skip @team:DataDog/feature-flags
Scenario: Archive a feature flag returns "Bad Request" response
Given new "ArchiveFeatureFlag" request
And request contains "feature_flag_id" parameter with value "00000000-0000-0000-0000-000000000000"
When the request is sent
Then the response status is 400 Bad Request
@skip @team:DataDog/feature-flags
Scenario: Archive a feature flag returns "Not Found" response
Given new "ArchiveFeatureFlag" request
And request contains "feature_flag_id" parameter with value "00000000-0000-0000-0000-000000000000"
When the request is sent
Then the response status is 404 Not Found
@team:DataDog/feature-flags
Scenario: Archive a feature flag returns "OK" response
Given there is a valid "feature_flag" in the system
And new "ArchiveFeatureFlag" request
And request contains "feature_flag_id" parameter from "feature_flag.data.id"
When the request is sent
Then the response status is 200 OK
@skip @team:DataDog/feature-flags
Scenario: Create a feature flag returns "Bad Request" response
Given new "CreateFeatureFlag" request
And body with value {"data": {"type": "feature-flags", "attributes": {"default_variant_key": "control", "description": "This is an example feature flag for demonstration", "json_schema": "{\"type\": \"object\", \"properties\": {\"enabled\": {\"type\": \"boolean\"}}}", "key": "example-feature-flag", "name": "Example Feature Flag", "value_type": "BOOLEAN", "variants": [{"key": "control", "name": "Control Variant", "value": "true"}]}}}
When the request is sent
Then the response status is 400 Bad Request
@skip @team:DataDog/feature-flags
Scenario: Create a feature flag returns "Conflict" response
Given new "CreateFeatureFlag" request
And body with value {"data": {"type": "feature-flags", "attributes": {"default_variant_key": "control", "description": "This is an example feature flag for demonstration", "json_schema": "{\"type\": \"object\", \"properties\": {\"enabled\": {\"type\": \"boolean\"}}}", "key": "example-feature-flag", "name": "Example Feature Flag", "value_type": "BOOLEAN", "variants": [{"key": "control", "name": "Control Variant", "value": "true"}]}}}
When the request is sent
Then the response status is 409 Conflict
@team:DataDog/feature-flags
Scenario: Create a feature flag returns "Created" response
Given new "CreateFeatureFlag" request
And body with value {"data": {"type": "feature-flags", "attributes": {"default_variant_key": "variant-{{ unique }}-1", "description": "Test feature flag for BDD scenarios", "key": "test-feature-flag-{{ unique }}", "name": "Test Feature Flag {{ unique }}", "value_type": "BOOLEAN", "variants": [{"key": "variant-{{ unique }}-1", "name": "Variant {{ unique }} A", "value": "true"}, {"key": "variant-{{ unique }}-2", "name": "Variant {{ unique }} B", "value": "false"}]}}}
When the request is sent
Then the response status is 201 Created
And the response "data.attributes.key" is equal to "test-feature-flag-{{ unique }}"
And the response "data.attributes.name" is equal to "Test Feature Flag {{ unique }}"
And the response "data.attributes.value_type" is equal to "BOOLEAN"
@generated @skip @team:DataDog/feature-flags
Scenario: Create a flag suggestion returns "Bad Request" response
Given new "CreateFlagSuggestion" request
And request contains "feature_flag_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"action": "archived", "comment": "Archive this deprecated flag", "environment_id": "550e8400-e29b-41d4-a716-446655440001", "notification_rule_targets": ["user@example.com"], "property": "FLAG", "suggestion": "ENABLED", "suggestion_metadata": {"variant_id": "550e8400-e29b-41d4-a716-446655440005"}}, "type": "flag-suggestions"}}
When the request is sent
Then the response status is 400 Bad Request
@generated @skip @team:DataDog/feature-flags
Scenario: Create a flag suggestion returns "Conflict" response
Given new "CreateFlagSuggestion" request
And request contains "feature_flag_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"action": "archived", "comment": "Archive this deprecated flag", "environment_id": "550e8400-e29b-41d4-a716-446655440001", "notification_rule_targets": ["user@example.com"], "property": "FLAG", "suggestion": "ENABLED", "suggestion_metadata": {"variant_id": "550e8400-e29b-41d4-a716-446655440005"}}, "type": "flag-suggestions"}}
When the request is sent
Then the response status is 409 Conflict
@generated @skip @team:DataDog/feature-flags
Scenario: Create a flag suggestion returns "Created" response
Given new "CreateFlagSuggestion" request
And request contains "feature_flag_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"action": "archived", "comment": "Archive this deprecated flag", "environment_id": "550e8400-e29b-41d4-a716-446655440001", "notification_rule_targets": ["user@example.com"], "property": "FLAG", "suggestion": "ENABLED", "suggestion_metadata": {"variant_id": "550e8400-e29b-41d4-a716-446655440005"}}, "type": "flag-suggestions"}}
When the request is sent
Then the response status is 201 Created
@generated @skip @team:DataDog/feature-flags
Scenario: Create a flag suggestion returns "Not Found" response
Given new "CreateFlagSuggestion" request
And request contains "feature_flag_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"action": "archived", "comment": "Archive this deprecated flag", "environment_id": "550e8400-e29b-41d4-a716-446655440001", "notification_rule_targets": ["user@example.com"], "property": "FLAG", "suggestion": "ENABLED", "suggestion_metadata": {"variant_id": "550e8400-e29b-41d4-a716-446655440005"}}, "type": "flag-suggestions"}}
When the request is sent
Then the response status is 404 Not Found
@team:DataDog/feature-flags
Scenario: Create allocation for a flag in an environment returns "Created" response
Given there is a valid "feature_flag" in the system
And there is a valid "environment" in the system
And new "CreateAllocationsForFeatureFlagInEnvironment" request
And request contains "feature_flag_id" parameter from "feature_flag.data.id"
And request contains "environment_id" parameter from "environment.data.id"
And body with value {"data":{"type":"allocations","attributes":{"name":"New targeting rule {{ unique }}","key":"new-targeting-rule-{{ unique_lower }}","targeting_rules":[],"variant_weights":[{"variant_id":"{{ feature_flag.data.attributes.variants[0].id }}","value":100}],"guardrail_metrics":[],"type":"CANARY"}}}
When the request is sent
Then the response status is 201 Created
@skip @team:DataDog/feature-flags
Scenario: Create an environment returns "Bad Request" response
Given new "CreateFeatureFlagsEnvironment" request
And body with value {"data": {"type": "environments", "attributes": {"description": "Staging environment for testing", "key": "staging", "name": "staging"}}}
When the request is sent
Then the response status is 400 Bad Request
@skip @team:DataDog/feature-flags
Scenario: Create an environment returns "Conflict" response
Given new "CreateFeatureFlagsEnvironment" request
And body with value {"data": {"type": "environments", "attributes": {"description": "Staging environment for testing", "key": "staging", "name": "staging"}}}
When the request is sent
Then the response status is 409 Conflict
@team:DataDog/feature-flags
Scenario: Create an environment returns "Created" response
Given new "CreateFeatureFlagsEnvironment" request
And body with value {"data": {"type": "environments", "attributes": {"name": "Test Environment {{ unique }}", "queries": ["test-{{ unique }}", "env-{{ unique }}"]}}}
When the request is sent
Then the response status is 201 Created
@generated @skip @team:DataDog/feature-flags
Scenario: Create targeting rules for a flag env returns "Accepted - Approval required for this change" response
Given new "CreateAllocationsForFeatureFlagInEnvironment" request
And request contains "feature_flag_id" parameter from "REPLACE.ME"
And request contains "environment_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}}
When the request is sent
Then the response status is 202 Accepted - Approval required for this change
@generated @skip @team:DataDog/feature-flags
Scenario: Create targeting rules for a flag env returns "Bad Request" response
Given new "CreateAllocationsForFeatureFlagInEnvironment" request
And request contains "feature_flag_id" parameter from "REPLACE.ME"
And request contains "environment_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}}
When the request is sent
Then the response status is 400 Bad Request
@generated @skip @team:DataDog/feature-flags
Scenario: Create targeting rules for a flag env returns "Conflict" response
Given new "CreateAllocationsForFeatureFlagInEnvironment" request
And request contains "feature_flag_id" parameter from "REPLACE.ME"
And request contains "environment_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}}
When the request is sent
Then the response status is 409 Conflict
@generated @skip @team:DataDog/feature-flags
Scenario: Create targeting rules for a flag env returns "Created" response
Given new "CreateAllocationsForFeatureFlagInEnvironment" request
And request contains "feature_flag_id" parameter from "REPLACE.ME"
And request contains "environment_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}}
When the request is sent
Then the response status is 201 Created
@generated @skip @team:DataDog/feature-flags
Scenario: Create targeting rules for a flag env returns "Not Found" response
Given new "CreateAllocationsForFeatureFlagInEnvironment" request
And request contains "feature_flag_id" parameter from "REPLACE.ME"
And request contains "environment_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}}
When the request is sent
Then the response status is 404 Not Found
@generated @skip @team:DataDog/feature-flags
Scenario: Delete a flag suggestion returns "Bad Request" response
Given new "DeleteFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request
@generated @skip @team:DataDog/feature-flags
Scenario: Delete a flag suggestion returns "No Content" response
Given new "DeleteFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 No Content
@generated @skip @team:DataDog/feature-flags
Scenario: Delete a flag suggestion returns "Not Found" response
Given new "DeleteFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
@skip @team:DataDog/feature-flags
Scenario: Delete an environment returns "No Content" response
Given there is a valid "environment" in the system
And new "DeleteFeatureFlagsEnvironment" request
And request contains "environment_id" parameter from "environment.data.id"
When the request is sent
Then the response status is 204 No Content
@skip @team:DataDog/feature-flags
Scenario: Delete an environment returns "Not Found" response
Given new "DeleteFeatureFlagsEnvironment" request
And request contains "environment_id" parameter with value "00000000-0000-0000-0000-000000000000"
When the request is sent
Then the response status is 404 Not Found
@skip @team:DataDog/feature-flags
Scenario: Disable a feature flag in an environment returns "Accepted - Approval required for this change" response
Given there is a valid "feature_flag" in the system
And there is a valid "environment" in the system
And new "DisableFeatureFlagEnvironment" request
And request contains "feature_flag_id" parameter from "feature_flag.data.id"
And request contains "environment_id" parameter from "environment.data.id"
When the request is sent
Then the response status is 202 Accepted - Approval required for this change
@skip @team:DataDog/feature-flags
Scenario: Disable a feature flag in an environment returns "Not Found" response
Given new "DisableFeatureFlagEnvironment" request
And request contains "feature_flag_id" parameter with value "00000000-0000-0000-0000-000000000000"
And request contains "environment_id" parameter with value "00000000-0000-0000-0000-000000000001"
When the request is sent
Then the response status is 404 Not Found
@skip @team:DataDog/feature-flags
Scenario: Disable a feature flag in an environment returns "OK" response
Given there is a valid "feature_flag" in the system
And there is a valid "environment" in the system
And new "DisableFeatureFlagEnvironment" request
And request contains "feature_flag_id" parameter from "feature_flag.data.id"
And request contains "environment_id" parameter from "environment.data.id"
When the request is sent
Then the response status is 200 OK
@skip @team:DataDog/feature-flags
Scenario: Enable a feature flag in an environment returns "Accepted - Approval required for this change" response
Given there is a valid "feature_flag" in the system
And there is a valid "environment" in the system
And new "EnableFeatureFlagEnvironment" request
And request contains "feature_flag_id" parameter from "feature_flag.data.id"
And request contains "environment_id" parameter from "environment.data.id"
When the request is sent
Then the response status is 202 Accepted - Approval required for this change
@skip @team:DataDog/feature-flags
Scenario: Enable a feature flag in an environment returns "Not Found" response
Given new "EnableFeatureFlagEnvironment" request
And request contains "feature_flag_id" parameter with value "00000000-0000-0000-0000-000000000000"
And request contains "environment_id" parameter with value "00000000-0000-0000-0000-000000000001"
When the request is sent
Then the response status is 404 Not Found
@skip @team:DataDog/feature-flags
Scenario: Enable a feature flag in an environment returns "OK" response
Given there is a valid "feature_flag" in the system
And there is a valid "environment" in the system
And new "EnableFeatureFlagEnvironment" request
And request contains "feature_flag_id" parameter from "feature_flag.data.id"
And request contains "environment_id" parameter from "environment.data.id"
When the request is sent
Then the response status is 200 OK
@skip @team:DataDog/feature-flags
Scenario: Get a feature flag returns "Not Found" response
Given new "GetFeatureFlag" request
And request contains "feature_flag_id" parameter with value "00000000-0000-0000-0000-000000000000"
When the request is sent
Then the response status is 404 Not Found
@team:DataDog/feature-flags
Scenario: Get a feature flag returns "OK" response
Given there is a valid "feature_flag" in the system
And new "GetFeatureFlag" request
And request contains "feature_flag_id" parameter from "feature_flag.data.id"
When the request is sent
Then the response status is 200 OK
And the response "data.attributes.key" has the same value as "feature_flag.data.attributes.key"
And the response "data.attributes.name" has the same value as "feature_flag.data.attributes.name"
And the response "data.attributes.value_type" has the same value as "feature_flag.data.attributes.value_type"
@generated @skip @team:DataDog/feature-flags
Scenario: Get a flag suggestion returns "Bad Request" response
Given new "GetFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request
@generated @skip @team:DataDog/feature-flags
Scenario: Get a flag suggestion returns "Not Found" response
Given new "GetFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
@generated @skip @team:DataDog/feature-flags
Scenario: Get a flag suggestion returns "OK" response
Given new "GetFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK
@skip @team:DataDog/feature-flags
Scenario: Get an environment returns "Not Found" response
Given new "GetFeatureFlagsEnvironment" request
And request contains "environment_id" parameter with value "00000000-0000-0000-0000-000000000000"
When the request is sent
Then the response status is 404 Not Found
@skip @team:DataDog/feature-flags
Scenario: Get an environment returns "OK" response
Given there is a valid "environment" in the system
And new "GetFeatureFlagsEnvironment" request
And request contains "environment_id" parameter from "environment.data.id"
When the request is sent
Then the response status is 200 OK
@skip @team:DataDog/feature-flags
Scenario: List environments returns "OK" response
Given new "ListFeatureFlagsEnvironments" request
When the request is sent
Then the response status is 200 OK
@team:DataDog/feature-flags
Scenario: List feature flags returns "OK" response
Given new "ListFeatureFlags" request
When the request is sent
Then the response status is 200 OK
@generated @skip @team:DataDog/feature-flags
Scenario: Pause a progressive rollout returns "Bad Request" response
Given new "PauseExposureSchedule" request
And request contains "exposure_schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request
@generated @skip @team:DataDog/feature-flags
Scenario: Pause a progressive rollout returns "Conflict" response
Given new "PauseExposureSchedule" request
And request contains "exposure_schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 409 Conflict
@generated @skip @team:DataDog/feature-flags
Scenario: Pause a progressive rollout returns "Not Found" response
Given new "PauseExposureSchedule" request
And request contains "exposure_schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
@generated @skip @team:DataDog/feature-flags
Scenario: Pause a progressive rollout returns "OK" response
Given new "PauseExposureSchedule" request
And request contains "exposure_schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK
@generated @skip @team:DataDog/feature-flags
Scenario: Reject a flag suggestion returns "Bad Request" response
Given new "RejectFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"comment": "Looks good, approved!"}, "type": "flag-suggestion-events"}}
When the request is sent
Then the response status is 400 Bad Request
@generated @skip @team:DataDog/feature-flags
Scenario: Reject a flag suggestion returns "Not Found" response
Given new "RejectFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"comment": "Looks good, approved!"}, "type": "flag-suggestion-events"}}
When the request is sent
Then the response status is 404 Not Found
@generated @skip @team:DataDog/feature-flags
Scenario: Reject a flag suggestion returns "OK" response
Given new "RejectFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"comment": "Looks good, approved!"}, "type": "flag-suggestion-events"}}
When the request is sent
Then the response status is 200 OK
@generated @skip @team:DataDog/feature-flags
Scenario: Resume a progressive rollout returns "Bad Request" response
Given new "ResumeExposureSchedule" request
And request contains "exposure_schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request
@generated @skip @team:DataDog/feature-flags
Scenario: Resume a progressive rollout returns "Conflict" response
Given new "ResumeExposureSchedule" request
And request contains "exposure_schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 409 Conflict
@generated @skip @team:DataDog/feature-flags
Scenario: Resume a progressive rollout returns "Not Found" response
Given new "ResumeExposureSchedule" request
And request contains "exposure_schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
@generated @skip @team:DataDog/feature-flags
Scenario: Resume a progressive rollout returns "OK" response
Given new "ResumeExposureSchedule" request
And request contains "exposure_schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK
@generated @skip @team:DataDog/feature-flags
Scenario: Start a progressive rollout returns "Bad Request" response
Given new "StartExposureSchedule" request
And request contains "exposure_schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request
@generated @skip @team:DataDog/feature-flags
Scenario: Start a progressive rollout returns "Conflict" response
Given new "StartExposureSchedule" request
And request contains "exposure_schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 409 Conflict
@generated @skip @team:DataDog/feature-flags
Scenario: Start a progressive rollout returns "Not Found" response
Given new "StartExposureSchedule" request
And request contains "exposure_schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
@generated @skip @team:DataDog/feature-flags
Scenario: Start a progressive rollout returns "OK" response
Given new "StartExposureSchedule" request
And request contains "exposure_schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK
@generated @skip @team:DataDog/feature-flags
Scenario: Stop a progressive rollout returns "Bad Request" response
Given new "StopExposureSchedule" request
And request contains "exposure_schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request
@generated @skip @team:DataDog/feature-flags
Scenario: Stop a progressive rollout returns "Conflict" response
Given new "StopExposureSchedule" request
And request contains "exposure_schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 409 Conflict
@generated @skip @team:DataDog/feature-flags
Scenario: Stop a progressive rollout returns "Not Found" response
Given new "StopExposureSchedule" request
And request contains "exposure_schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
@generated @skip @team:DataDog/feature-flags
Scenario: Stop a progressive rollout returns "OK" response
Given new "StopExposureSchedule" request
And request contains "exposure_schedule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK
@skip @team:DataDog/feature-flags
Scenario: Unarchive a feature flag returns "Bad Request" response
Given new "UnarchiveFeatureFlag" request
And request contains "feature_flag_id" parameter with value "00000000-0000-0000-0000-000000000000"
When the request is sent
Then the response status is 400 Bad Request
@skip @team:DataDog/feature-flags
Scenario: Unarchive a feature flag returns "Not Found" response
Given new "UnarchiveFeatureFlag" request
And request contains "feature_flag_id" parameter with value "00000000-0000-0000-0000-000000000000"
When the request is sent
Then the response status is 404 Not Found
@skip @team:DataDog/feature-flags
Scenario: Unarchive a feature flag returns "OK" response
Given there is a valid "feature_flag" in the system
And new "UnarchiveFeatureFlag" request
And request contains "feature_flag_id" parameter from "feature_flag.data.id"
When the request is sent
Then the response status is 200 OK
@skip @team:DataDog/feature-flags
Scenario: Update a feature flag returns "Bad Request" response
Given new "UpdateFeatureFlag" request
And request contains "feature_flag_id" parameter with value "00000000-0000-0000-0000-000000000000"
And body with value {"data": {"type": "feature-flags", "attributes": {"description": "Updated description for the feature flag", "json_schema": "{\"type\": \"object\", \"properties\": {\"enabled\": {\"type\": \"boolean\"}}}", "name": "Updated Feature Flag Name"}}}
When the request is sent
Then the response status is 400 Bad Request
@skip @team:DataDog/feature-flags
Scenario: Update a feature flag returns "Not Found" response
Given new "UpdateFeatureFlag" request
And request contains "feature_flag_id" parameter with value "00000000-0000-0000-0000-000000000000"
And body with value {"data": {"type": "feature-flags", "attributes": {"description": "Updated description for the feature flag", "json_schema": "{\"type\": \"object\", \"properties\": {\"enabled\": {\"type\": \"boolean\"}}}", "name": "Updated Feature Flag Name"}}}
When the request is sent
Then the response status is 404 Not Found
@team:DataDog/feature-flags
Scenario: Update a feature flag returns "OK" response
Given there is a valid "feature_flag" in the system
And new "UpdateFeatureFlag" request
And request contains "feature_flag_id" parameter from "feature_flag.data.id"
And body with value {"data": {"type": "feature-flags", "attributes": {"description": "Updated description for the feature flag", "name": "Updated Test Feature Flag {{ unique }}"}}}
When the request is sent
Then the response status is 200 OK
And the response "data.attributes.name" is equal to "Updated Test Feature Flag {{ unique }}"
And the response "data.attributes.description" is equal to "Updated description for the feature flag"
@skip @team:DataDog/feature-flags
Scenario: Update an environment returns "Bad Request" response
Given new "UpdateFeatureFlagsEnvironment" request
And request contains "environment_id" parameter with value "00000000-0000-0000-0000-000000000000"
And body with value {"data": {"type": "environments", "attributes": {"description": "Updated staging environment description", "name": "Updated Staging"}}}
When the request is sent
Then the response status is 400 Bad Request
@skip @team:DataDog/feature-flags
Scenario: Update an environment returns "Not Found" response
Given new "UpdateFeatureFlagsEnvironment" request
And request contains "environment_id" parameter with value "00000000-0000-0000-0000-000000000000"
And body with value {"data": {"type": "environments", "attributes": {"description": "Updated staging environment description", "name": "Updated Staging"}}}
When the request is sent
Then the response status is 404 Not Found
@skip @team:DataDog/feature-flags
Scenario: Update an environment returns "OK" response
Given there is a valid "environment" in the system
And new "UpdateFeatureFlagsEnvironment" request
And request contains "environment_id" parameter from "environment.data.id"
And body with value {"data": {"type": "environments", "attributes": {"name": "Updated Test Environment {{ unique }}", "queries": ["updated-{{ unique }}", "live-{{ unique }}"]}}}
When the request is sent
Then the response status is 200 OK
@team:DataDog/feature-flags
Scenario: Update targeting rules for a flag in an environment returns "OK" response
Given there is a valid "feature_flag" in the system
And there is a valid "environment" in the system
And new "UpdateAllocationsForFeatureFlagInEnvironment" request
And request contains "feature_flag_id" parameter from "feature_flag.data.id"
And request contains "environment_id" parameter from "environment.data.id"
And body with value {"data":[{"type":"allocations","attributes":{"key":"overwrite-allocation-{{ unique_lower }}","name":"New targeting rule {{ unique }}","targeting_rules":[],"variant_weights":[{"variant_id":"{{ feature_flag.data.attributes.variants[0].id }}","value":100}],"exposure_schedule":{"rollout_options":{"strategy":"UNIFORM_INTERVALS","autostart":false,"selection_interval_ms":86400000},"rollout_steps":[{"exposure_ratio":0.05,"interval_ms":null,"is_pause_record":false,"grouped_step_index":0},{"exposure_ratio":0.25,"interval_ms":null,"is_pause_record":false,"grouped_step_index":1},{"exposure_ratio":1,"interval_ms":null,"is_pause_record":false,"grouped_step_index":2}]},"guardrail_metrics":[],"type":"CANARY"}}]}
When the request is sent
Then the response status is 200 OK
@generated @skip @team:DataDog/feature-flags
Scenario: Update targeting rules for a flag returns "Accepted - Approval required for this change" response
Given new "UpdateAllocationsForFeatureFlagInEnvironment" request
And request contains "feature_flag_id" parameter from "REPLACE.ME"
And request contains "environment_id" parameter from "REPLACE.ME"
And body with value {"data": [{"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}]}
When the request is sent
Then the response status is 202 Accepted - Approval required for this change
@generated @skip @team:DataDog/feature-flags
Scenario: Update targeting rules for a flag returns "Bad Request" response
Given new "UpdateAllocationsForFeatureFlagInEnvironment" request
And request contains "feature_flag_id" parameter from "REPLACE.ME"
And request contains "environment_id" parameter from "REPLACE.ME"
And body with value {"data": [{"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}]}
When the request is sent
Then the response status is 400 Bad Request
@generated @skip @team:DataDog/feature-flags
Scenario: Update targeting rules for a flag returns "Conflict" response
Given new "UpdateAllocationsForFeatureFlagInEnvironment" request
And request contains "feature_flag_id" parameter from "REPLACE.ME"
And request contains "environment_id" parameter from "REPLACE.ME"
And body with value {"data": [{"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}]}
When the request is sent
Then the response status is 409 Conflict
@generated @skip @team:DataDog/feature-flags
Scenario: Update targeting rules for a flag returns "Not Found" response
Given new "UpdateAllocationsForFeatureFlagInEnvironment" request
And request contains "feature_flag_id" parameter from "REPLACE.ME"
And request contains "environment_id" parameter from "REPLACE.ME"
And body with value {"data": [{"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}]}
When the request is sent
Then the response status is 404 Not Found
@generated @skip @team:DataDog/feature-flags
Scenario: Update targeting rules for a flag returns "OK" response
Given new "UpdateAllocationsForFeatureFlagInEnvironment" request
And request contains "feature_flag_id" parameter from "REPLACE.ME"
And request contains "environment_id" parameter from "REPLACE.ME"
And body with value {"data": [{"attributes": {"experiment_id": "550e8400-e29b-41d4-a716-446655440030", "exposure_schedule": {"absolute_start_time": "2025-06-13T12:00:00Z", "control_variant_id": "550e8400-e29b-41d4-a716-446655440012", "control_variant_key": "control", "id": "550e8400-e29b-41d4-a716-446655440010", "rollout_options": {"autostart": false, "selection_interval_ms": 3600000, "strategy": "UNIFORM_INTERVALS"}, "rollout_steps": [{"exposure_ratio": 0.5, "grouped_step_index": 1, "id": "550e8400-e29b-41d4-a716-446655440040", "interval_ms": 3600000, "is_pause_record": false}]}, "guardrail_metrics": [{"metric_id": "metric-error-rate", "trigger_action": "PAUSE"}], "id": "550e8400-e29b-41d4-a716-446655440020", "key": "prod-rollout", "name": "Production Rollout", "targeting_rules": [{"conditions": [{"attribute": "user_tier", "operator": "ONE_OF", "value": ["premium", "enterprise"]}]}], "type": "FEATURE_GATE", "variant_weights": [{"value": 50, "variant_id": "550e8400-e29b-41d4-a716-446655440001", "variant_key": "control"}]}, "type": "allocations"}]}
When the request is sent
Then the response status is 200 OK