2020-10-01 17:08:36 -04:00
|
|
|
import {
|
|
|
|
ROLLOUT_STRATEGY_ALL_USERS,
|
|
|
|
ROLLOUT_STRATEGY_PERCENT_ROLLOUT,
|
2020-10-13 11:08:53 -04:00
|
|
|
ROLLOUT_STRATEGY_FLEXIBLE_ROLLOUT,
|
2020-10-05 14:08:51 -04:00
|
|
|
ROLLOUT_STRATEGY_GITLAB_USER_LIST,
|
|
|
|
ROLLOUT_STRATEGY_USER_ID,
|
2020-10-01 17:08:36 -04:00
|
|
|
} from '~/feature_flags/constants';
|
|
|
|
|
|
|
|
export const featureFlag = {
|
|
|
|
id: 1,
|
|
|
|
active: true,
|
|
|
|
created_at: '2018-12-12T22:07:31.401Z',
|
|
|
|
updated_at: '2018-12-12T22:07:31.401Z',
|
|
|
|
name: 'test flag',
|
|
|
|
description: 'flag for tests',
|
|
|
|
destroy_path: 'feature_flags/1',
|
|
|
|
update_path: 'feature_flags/1',
|
|
|
|
edit_path: 'feature_flags/1/edit',
|
2021-07-02 02:07:28 -04:00
|
|
|
strategies: [
|
2020-10-01 17:08:36 -04:00
|
|
|
{
|
2021-07-02 02:07:28 -04:00
|
|
|
id: 9,
|
|
|
|
name: ROLLOUT_STRATEGY_ALL_USERS,
|
|
|
|
parameters: {},
|
|
|
|
scopes: [{ id: 17, environment_scope: '*' }],
|
2020-10-01 17:08:36 -04:00
|
|
|
},
|
|
|
|
{
|
2021-07-02 02:07:28 -04:00
|
|
|
id: 8,
|
|
|
|
name: ROLLOUT_STRATEGY_PERCENT_ROLLOUT,
|
|
|
|
parameters: {},
|
|
|
|
scopes: [{ id: 18, environment_scope: 'review/*' }],
|
2020-10-01 17:08:36 -04:00
|
|
|
},
|
|
|
|
{
|
2021-07-02 02:07:28 -04:00
|
|
|
id: 7,
|
|
|
|
name: ROLLOUT_STRATEGY_USER_ID,
|
|
|
|
parameters: { userIds: '1,2,3,4' },
|
|
|
|
scopes: [{ id: 19, environment_scope: 'production' }],
|
2020-10-13 11:08:53 -04:00
|
|
|
},
|
2020-10-01 17:08:36 -04:00
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
export const getRequestData = {
|
|
|
|
feature_flags: [featureFlag],
|
|
|
|
count: {
|
|
|
|
all: 1,
|
|
|
|
disabled: 1,
|
|
|
|
enabled: 0,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const rotateData = { token: 'oP6sCNRqtRHmpy1gw2-F' };
|
|
|
|
|
|
|
|
export const userList = {
|
|
|
|
name: 'test_users',
|
|
|
|
user_xids: 'user3,user4,user5',
|
|
|
|
id: 2,
|
|
|
|
iid: 2,
|
|
|
|
project_id: 1,
|
|
|
|
created_at: '2020-02-04T08:13:10.507Z',
|
|
|
|
updated_at: '2020-02-04T08:13:10.507Z',
|
|
|
|
path: '/path/to/user/list',
|
|
|
|
edit_path: '/path/to/user/list/edit',
|
|
|
|
};
|
|
|
|
|
2020-10-05 14:08:51 -04:00
|
|
|
export const userListStrategy = {
|
|
|
|
name: ROLLOUT_STRATEGY_GITLAB_USER_LIST,
|
|
|
|
parameters: {},
|
|
|
|
scopes: [],
|
2020-11-03 04:09:07 -05:00
|
|
|
userList,
|
2020-10-05 14:08:51 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
export const percentRolloutStrategy = {
|
|
|
|
name: ROLLOUT_STRATEGY_PERCENT_ROLLOUT,
|
|
|
|
parameters: { percentage: '50', groupId: 'default' },
|
|
|
|
scopes: [],
|
|
|
|
};
|
|
|
|
|
2020-10-13 11:08:53 -04:00
|
|
|
export const flexibleRolloutStrategy = {
|
|
|
|
name: ROLLOUT_STRATEGY_FLEXIBLE_ROLLOUT,
|
2021-08-04 17:09:04 -04:00
|
|
|
parameters: { rollout: '50', groupId: 'default', stickiness: 'default' },
|
2020-10-13 11:08:53 -04:00
|
|
|
scopes: [],
|
|
|
|
};
|
|
|
|
|
2020-10-05 14:08:51 -04:00
|
|
|
export const usersWithIdStrategy = {
|
|
|
|
name: ROLLOUT_STRATEGY_USER_ID,
|
|
|
|
parameters: { userIds: '1,2,3' },
|
|
|
|
scopes: [],
|
|
|
|
};
|
|
|
|
|
2020-10-01 17:08:36 -04:00
|
|
|
export const allUsersStrategy = {
|
|
|
|
name: ROLLOUT_STRATEGY_ALL_USERS,
|
|
|
|
parameters: {},
|
|
|
|
scopes: [],
|
|
|
|
};
|