Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: found an edge case exporting variants (#2900)
## About the changes When exporting v3, for variants backward compatibility, we need to find one featureEnvironment and fetch variants from there. In cases where the default environment is disabled (therefore does not get variants per environment when added), it can be still be selected for the export process. Therefore variants don't appear in the feature when they should be there. An e2e test that fails with the previous implementation was added to validate the behavior This comes from our support ticket 404
- Loading branch information
Gastón Fournier
committed
Jan 13, 2023
1 parent
3a08122
commit 6996584
Showing
3 changed files
with
153 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"version": 3, | ||
"features": [ | ||
{ | ||
"name": "test-variants-postman", | ||
"description": "", | ||
"type": "experiment", | ||
"project": "default", | ||
"stale": false, | ||
"createdAt": "2023-01-13T09:17:43.989Z", | ||
"lastSeenAt": null, | ||
"impressionData": false, | ||
"archivedAt": null, | ||
"archived": false, | ||
"variants": [ | ||
{ | ||
"name": "fake", | ||
"weight": 500, | ||
"payload": { | ||
"type": "string", | ||
"value": "123" | ||
}, | ||
"overrides": [], | ||
"stickiness": "default", | ||
"weightType": "variable" | ||
}, | ||
{ | ||
"name": "fake2", | ||
"weight": 500, | ||
"payload": { | ||
"type": "json", | ||
"value": "{\"hello\":\"world\"}" | ||
}, | ||
"overrides": [], | ||
"stickiness": "default", | ||
"weightType": "variable" | ||
} | ||
] | ||
} | ||
], | ||
"strategies": [], | ||
"projects": [ | ||
{ | ||
"id": "default", | ||
"name": "Default", | ||
"description": "Default project", | ||
"createdAt": "2023-01-10T13:11:03.260Z", | ||
"health": 100, | ||
"updatedAt": "2023-01-13T09:09:12.494Z" | ||
} | ||
], | ||
"tagTypes": [], | ||
"tags": [], | ||
"featureTags": [], | ||
"featureStrategies": [], | ||
"environments": [ | ||
{ | ||
"name": "default", | ||
"type": "production", | ||
"sortOrder": 1, | ||
"enabled": false, | ||
"protected": true | ||
}, | ||
{ | ||
"name": "development", | ||
"type": "development", | ||
"sortOrder": 100, | ||
"enabled": true, | ||
"protected": false | ||
}, | ||
{ | ||
"name": "production", | ||
"type": "production", | ||
"sortOrder": 200, | ||
"enabled": true, | ||
"protected": false | ||
} | ||
], | ||
"featureEnvironments": [ | ||
{ | ||
"enabled": true, | ||
"featureName": "test-variants-postman", | ||
"environment": "development" | ||
} | ||
], | ||
"segments": [], | ||
"featureStrategySegments": [] | ||
} |