File tree Expand file tree Collapse file tree 1 file changed +33
-29
lines changed Expand file tree Collapse file tree 1 file changed +33
-29
lines changed Original file line number Diff line number Diff line change @@ -72,37 +72,41 @@ var nimbus = class extends ExtensionAPI {
72
72
isRollout ,
73
73
forceEnroll ,
74
74
) {
75
- try {
76
- const slug = `nimbus-devtools-${ featureId } -${ isRollout ? "rollout" : "experiment" } ` ;
77
- const recipe = JSON . parse ( `{
78
- "bucketConfig": {
79
- "count": 1000,
80
- "namespace": "devtools-test",
81
- "randomizationUnit": "normandy_id",
82
- "start": 0,
83
- "total": 1000
75
+ let userFacingName = `Nimbus Devtools ${ featureId } Enrollment` ;
76
+
77
+ if ( isRollout ) {
78
+ userFacingName += " (rollout)" ;
79
+ }
80
+
81
+ const slug = `nimbus-devtools-${ featureId } -${ isRollout ? "rollout" : "experiment" } ` ;
82
+ const recipe = {
83
+ bucketConfig : {
84
+ namespace : "devtools-test" ,
85
+ randomizationUnit : "normandy_id" ,
86
+ start : 0 ,
87
+ total : 1000 ,
88
+ count : 1000 ,
89
+ } ,
90
+ branches : [
91
+ {
92
+ features : [
93
+ {
94
+ featureId,
95
+ value : featureValue ,
96
+ } ,
97
+ ] ,
98
+ ratio : 1 ,
99
+ slug : "control" ,
84
100
} ,
85
- "branches": [
86
- {
87
- "features": [
88
- {
89
- "featureId": "${ featureId } ",
90
- "value": ${ JSON . stringify ( featureValue ) }
91
- }
92
- ],
93
- "ratio": 1,
94
- "slug": "control"
95
- }
96
- ],
97
- "isRollout": ${ isRollout } ,
98
- "featureIds": [
99
- "${ featureId } "
100
- ],
101
- "slug": "${ slug } ",
102
- "userFacingName": "Nimbus Devtools ${ featureId } Enrollment",
103
- "userFacingDescription": "Testing the feature with feature ID: ${ featureId } ."
104
- }` ) ;
101
+ ] ,
102
+ isRollout,
103
+ featureIds : [ featureId ] ,
104
+ slug,
105
+ userFacingName,
106
+ userFacingDescription : `Testing the feature with feature ID: ${ featureId } .` ,
107
+ } ;
105
108
109
+ try {
106
110
const slugExistsInStore = lazy . ExperimentManager . store
107
111
. getAll ( )
108
112
. some ( ( experiment ) => experiment . slug === recipe . slug ) ;
You can’t perform that action at this time.
0 commit comments