Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not to create default strategy #6053

Closed
dmitryshelomanov opened this issue Jan 26, 2024 · 6 comments
Closed

Can not to create default strategy #6053

dmitryshelomanov opened this issue Jan 26, 2024 · 6 comments
Assignees
Labels

Comments

@dmitryshelomanov
Copy link

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

@nunogois
Copy link
Member

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 nunogois self-assigned this Jan 29, 2024
@nunogois nunogois moved this from New to ext. contrib. / awaiting response in Issues and PRs Jan 29, 2024
@dmitryshelomanov
Copy link
Author

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

@dmitryshelomanov
Copy link
Author

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 ?

@dmitryshelomanov
Copy link
Author

image image

@nunogois
Copy link
Member

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!

@dmitryshelomanov
Copy link
Author

Thanks
Its works

@github-project-automation github-project-automation bot moved this from ext. contrib. / awaiting response to Done in Issues and PRs Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants