Skip to content

Commit

Permalink
remove config reference from variant feature flag (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyuanliang-ms authored Sep 11, 2024
1 parent 91b7a2d commit 386ae79
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
4 changes: 0 additions & 4 deletions src/featureManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,6 @@ export class FeatureManager implements IFeatureManager {
// TODO: send telemetry for variant assignment reason in the future.
console.log(`Variant assignment for feature ${featureName}: ${variantDef?.name ?? "default"} (${reason})`);

if (variantDef?.configuration_reference !== undefined) {
console.warn("Configuration reference is not supported yet.");
}

result.variant = variantDef !== undefined ? new Variant(variantDef.name, variantDef.configuration_value) : undefined;
result.variantAssignmentReason = reason;

Expand Down
4 changes: 0 additions & 4 deletions src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ export interface VariantDefinition {
* The configuration value for this feature variant.
*/
configuration_value?: unknown;
/**
* The path to a configuration section used as the configuration value for this feature variant.
*/
configuration_reference?: string;
/**
* Overrides the enabled state of the feature if the given variant is assigned. Does not override the state if value is None.
*/
Expand Down
10 changes: 3 additions & 7 deletions test/sampleFeatureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ export const featureFlagsConfigurationObject = {
"variants": [
{
"name": "Big",
"configuration_reference": "ShoppingCart:Big",
"status_override": "Disabled"
}
],
Expand All @@ -231,8 +230,7 @@ export const featureFlagsConfigurationObject = {
"enabled": true,
"variants": [
{
"name": "Big",
"configuration_reference": "ShoppingCart:Big"
"name": "Big"
}
],
"allocation": {
Expand All @@ -254,8 +252,7 @@ export const featureFlagsConfigurationObject = {
"enabled": false,
"variants": [
{
"name": "Big",
"configuration_reference": "ShoppingCart:Big"
"name": "Big"
}
],
"allocation": {
Expand Down Expand Up @@ -415,8 +412,7 @@ export const featureFlagsConfigurationObject = {
"variants": [
{
"name": "Small",
"configuration_value": "600px",
"configuration_reference": "ShoppingCart:Small"
"configuration_value": "600px"
}
],
"allocation": {
Expand Down

0 comments on commit 386ae79

Please sign in to comment.