Skip to content

Commit 65207e5

Browse files
committed
updates
1 parent cc5d6fd commit 65207e5

File tree

23 files changed

+108
-204
lines changed

23 files changed

+108
-204
lines changed

lib/common_exports.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@
1414
* limitations under the License.
1515
*/
1616

17-
export { LOG_LEVEL } from './utils/enums';
1817
export { createStaticProjectConfigManager } from './project_config/config_manager_factory';
1918
export { PollingConfigManagerConfig } from './project_config/config_manager_factory';

lib/core/audience_evaluator/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import {
17-
LOG_LEVEL,
18-
} from '../../utils/enums';
1916
import * as conditionTreeEvaluator from '../condition_tree_evaluator';
2017
import * as customAttributeConditionEvaluator from '../custom_attribute_condition_evaluator';
2118
import * as odpSegmentsConditionEvaluator from './odp_segment_condition_evaluator';
@@ -24,8 +21,6 @@ import { CONDITION_EVALUATOR_ERROR, UNKNOWN_CONDITION_TYPE } from '../../error_m
2421
import { AUDIENCE_EVALUATION_RESULT, EVALUATING_AUDIENCE} from '../../log_messages';
2522
import { LoggerFacade } from '../../logging/logger';
2623

27-
const MODULE_NAME = 'AUDIENCE_EVALUATOR';
28-
2924
export class AudienceEvaluator {
3025
private logger?: LoggerFacade;
3126

lib/core/audience_evaluator/odp_segment_condition_evaluator/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import { UNKNOWN_MATCH_TYPE } from '../../../error_messages';
1717
import { LoggerFacade } from '../../../logging/logger';
1818
import { Condition, OptimizelyUserContext } from '../../../shared_types';
1919

20-
const MODULE_NAME = 'ODP_SEGMENT_CONDITION_EVALUATOR';
21-
2220
const QUALIFIED_MATCH_TYPE = 'qualified';
2321

2422
const MATCH_TYPES = [

lib/core/bucketer/index.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
/**
1818
* Bucketer API for determining the variation id from the specified parameters
1919
*/
20-
import { sprintf } from '../../utils/fns';
2120
import murmurhash from 'murmurhash';
2221
import { LoggerFacade } from '../../logging/logger';
2322
import {
@@ -27,7 +26,6 @@ import {
2726
Group,
2827
} from '../../shared_types';
2928

30-
import { LOG_LEVEL } from '../../utils/enums';
3129
import { INVALID_BUCKETING_ID, INVALID_GROUP_ID } from '../../error_messages';
3230
import { OptimizelyError } from '../../error/optimizly_error';
3331

@@ -40,7 +38,6 @@ export const INVALID_VARIATION_ID = 'Bucketed into an invalid variation ID. Retu
4038
const HASH_SEED = 1;
4139
const MAX_HASH_VALUE = Math.pow(2, 32);
4240
const MAX_TRAFFIC_VALUE = 10000;
43-
const MODULE_NAME = 'BUCKETER';
4441
const RANDOM_POLICY = 'random';
4542

4643
/**
@@ -86,7 +83,6 @@ export const bucket = function(bucketerParams: BucketerParams): DecisionResponse
8683
);
8784
decideReasons.push([
8885
USER_NOT_IN_ANY_EXPERIMENT,
89-
MODULE_NAME,
9086
bucketerParams.userId,
9187
groupId,
9288
]);
@@ -106,7 +102,6 @@ export const bucket = function(bucketerParams: BucketerParams): DecisionResponse
106102
);
107103
decideReasons.push([
108104
USER_NOT_BUCKETED_INTO_EXPERIMENT_IN_GROUP,
109-
MODULE_NAME,
110105
bucketerParams.userId,
111106
bucketerParams.experimentKey,
112107
groupId,
@@ -126,7 +121,6 @@ export const bucket = function(bucketerParams: BucketerParams): DecisionResponse
126121
);
127122
decideReasons.push([
128123
USER_BUCKETED_INTO_EXPERIMENT_IN_GROUP,
129-
MODULE_NAME,
130124
bucketerParams.userId,
131125
bucketerParams.experimentKey,
132126
groupId,
@@ -143,7 +137,6 @@ export const bucket = function(bucketerParams: BucketerParams): DecisionResponse
143137
);
144138
decideReasons.push([
145139
USER_ASSIGNED_TO_EXPERIMENT_BUCKET,
146-
MODULE_NAME,
147140
bucketValue,
148141
bucketerParams.userId,
149142
]);
@@ -152,8 +145,8 @@ export const bucket = function(bucketerParams: BucketerParams): DecisionResponse
152145
if (entityId !== null) {
153146
if (!bucketerParams.variationIdMap[entityId]) {
154147
if (entityId) {
155-
bucketerParams.logger?.warn(INVALID_VARIATION_ID, MODULE_NAME);
156-
decideReasons.push([INVALID_VARIATION_ID, MODULE_NAME]);
148+
bucketerParams.logger?.warn(INVALID_VARIATION_ID);
149+
decideReasons.push([INVALID_VARIATION_ID]);
157150
}
158151
return {
159152
result: null,

lib/core/custom_attribute_condition_evaluator/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ import {
2929
} from '../../error_messages';
3030
import { LoggerFacade } from '../../logging/logger';
3131

32-
const MODULE_NAME = 'CUSTOM_ATTRIBUTE_CONDITION_EVALUATOR';
33-
3432
const EXACT_MATCH_TYPE = 'exact';
3533
const EXISTS_MATCH_TYPE = 'exists';
3634
const GREATER_OR_EQUAL_THAN_MATCH_TYPE = 'ge';

lib/core/decision_service/index.tests.js

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,40 @@ import {
3939
getTestProjectConfig,
4040
getTestProjectConfigWithFeatures,
4141
} from '../../tests/test_data';
42+
4243
import {
43-
AUDIENCE_EVALUATION_RESULT_COMBINED,
44-
EVALUATING_AUDIENCES_COMBINED,
45-
USER_FORCED_IN_VARIATION,
4644
USER_HAS_NO_FORCED_VARIATION,
47-
USER_DOESNT_MEET_CONDITIONS_FOR_TARGETING_RULE,
48-
USER_NOT_IN_EXPERIMENT,
45+
VALID_BUCKETING_ID,
46+
SAVED_USER_VARIATION,
47+
SAVED_VARIATION_NOT_FOUND,
48+
} from '../../log_messages';
49+
50+
import {
4951
EXPERIMENT_NOT_RUNNING,
5052
RETURNING_STORED_VARIATION,
53+
USER_NOT_IN_EXPERIMENT,
54+
USER_HAS_NO_VARIATION,
55+
USER_HAS_VARIATION,
56+
USER_FORCED_IN_VARIATION,
57+
FORCED_BUCKETING_FAILED,
58+
EVALUATING_AUDIENCES_COMBINED,
59+
AUDIENCE_EVALUATION_RESULT_COMBINED,
60+
USER_IN_ROLLOUT,
61+
USER_NOT_IN_ROLLOUT,
5162
FEATURE_HAS_NO_EXPERIMENTS,
52-
NO_ROLLOUT_EXISTS,
63+
USER_DOESNT_MEET_CONDITIONS_FOR_TARGETING_RULE,
64+
USER_NOT_BUCKETED_INTO_TARGETING_RULE,
5365
USER_BUCKETED_INTO_TARGETING_RULE,
54-
USER_IN_ROLLOUT,
66+
NO_ROLLOUT_EXISTS,
67+
INVALID_ROLLOUT_ID,
68+
ROLLOUT_HAS_NO_EXPERIMENTS,
69+
IMPROPERLY_FORMATTED_EXPERIMENT,
70+
USER_HAS_FORCED_VARIATION,
5571
USER_MEETS_CONDITIONS_FOR_TARGETING_RULE,
5672
USER_NOT_BUCKETED_INTO_TARGETING_RULE,
57-
USER_NOT_IN_ROLLOUT,
58-
VALID_BUCKETING_ID,
59-
SAVED_USER_VARIATION,
60-
SAVED_VARIATION_NOT_FOUND
61-
} from '../../log_messages';
62-
import { mock } from 'node:test';
73+
USER_DOESNT_MEET_CONDITIONS_FOR_TARGETING_RULE,
74+
} from '../decision_service/index';
75+
6376
import { BUCKETING_ID_NOT_STRING, USER_PROFILE_LOOKUP_ERROR, USER_PROFILE_SAVE_ERROR } from '../../error_messages';
6477

6578
var testData = getTestProjectConfig();

0 commit comments

Comments
 (0)