Unleash/unleash

Can not to create default strategy

dmitryshelomanov opened this issue · 6 comments

Describe the bug

When I try to create default strategy (for all users) its not created. Instead of this Gradual rollout created (flexibleRollout)

Steps to reproduce the bug

  1. Go to projects
  2. New FF
  3. Create experiment
  4. Go to experiment
  5. Edit this
  6. Create default strategy (from select menu)

Expected Result

  --data-raw '{
  "name": "default",
  "constraints": [],
  "parameters": {
    "rollout": "100",
    "stickiness": "default",
    "groupId": "id"
  },
  "variants": [],
  "segments": [],
  "disabled": false
}'

Actual behavior

  --data-raw '{
  "name": "flexibleRollout",
  "constraints": [],
  "parameters": {
    "rollout": "100",
    "stickiness": "default",
    "groupId": "id"
  },
  "variants": [],
  "segments": [],
  "disabled": false
}'

Expected behavior

Experiment with name "name": "default", created

Logs, error output, etc.

No response

Screenshots

image image image

Additional context

No response

Unleash version

5.8.0+main

Subscription type

Open source

Hosting type

Self-hosted

SDK information (language and version)

No response

Hi @dmitryshelomanov, can you check the default strategy that is currently configured for that project?

You can check this by:

  • Selecting the project from the project list
  • Go into project settings
  • Select the default strategy tab

You may see something similar to the screenshot, which means that this is working as intended, as this is the default strategy for that environment in that project:

image

Here is where you can also configure the default strategy, if you want.
You can read more here: https://docs.getunleash.io/reference/projects#project-default-strategy

@nunogois not working. flexibleRollout strategy created. How to create default? "active for everyone"

Now I try o create strategy 50% | 50% (Base A/B)
But get error

   name: 'disabled',
    enabled: false,
    feature_enabled: false,
    featureEnabled: false

Code runner on Node JS (unleash-client)

    const unleash = await Unleash.startUnleash({
      environment: process.env.NODE_ENV === 'development' ? 'development' : 'production',
      url: 'http://localhost:4242/api/',
      appName: 'default',
      customHeaders: {
        Authorization: 'default:development.unleash-insecure-api-token',
      },
    });

    const { sub } = parseJwt({ accessToken, refreshToken });

    const sessionId = sub || fingerPrint;

    const ctx = {
      sessionId,
    };

    const ttt = unleash.getVariant('ttt', ctx);

    console.log({ ttt }); // variant desable, but its active in admin panel

what wrong ?

Hi @dmitryshelomanov,

Just to be clear, flexibleRollout is the "gradual rollout" strategy, which is configured to be the default strategy in your project.

Maybe what you're looking for is the "standard" strategy, that you can still add this way:

image

Like it's mentioned on the UI, however, we suggest you use a "gradual rollout" instead. A "standard" strategy is effectively the same as a "gradual rollout", with the exception that a "gradual rollout" gives you the option of selecting only a percentage of your user base, if you want.

This strategy turns on / off for your entire userbase. Prefer using "Gradual rollout" strategy (100%=on, 0%=off).

That being said, if you want your feature to be available to all your users, you should set your rollout to 100%, not 50%.

image

image

This may be the reason why you're seeing the feature as being disabled in your tests.

In conclusion:

If you'd like to do an A/B test targeting 100% of your user base, you should:

  • Create a strategy targeting 100% of your user base. If using a gradual rollout, this means setting it to 100%
  • Create variants A and B, that will be split in 50-50 by default (like shown in your screenshot)

Hope this helps!

Thanks
Its works