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

feat: get variation details by variation type #155

Merged
merged 89 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
b168340
feat: init new interface
duyhungtnn Jun 24, 2024
d069156
feat: update new API interface
duyhungtnn Jun 26, 2024
9e02971
feat: new detailed interface implementation
duyhungtnn Jun 26, 2024
6079f18
chore: add deprecated message
duyhungtnn Jun 26, 2024
2a3f136
fix: test fail
duyhungtnn Jun 26, 2024
67b30bc
chore: enable number tests
duyhungtnn Jun 27, 2024
28500cc
chore: remove unneccessary func
duyhungtnn Jun 27, 2024
b6e40fd
feat: add newDefaultBKTEvaluationDetails func
duyhungtnn Jun 27, 2024
5b4ac94
test: newDefaultBKTEvaluationDetails
duyhungtnn Jun 28, 2024
c34c4bd
chore: group test case for `newDefaultBKTEvaluationDetails`
duyhungtnn Jun 28, 2024
7a74072
test: stringVariationDetails
duyhungtnn Jun 28, 2024
f3f93fd
test: add test for new interface
duyhungtnn Jun 28, 2024
0a42f06
test: add more unit test for convertRawValueToType
duyhungtnn Jun 29, 2024
b7c8c11
fix: update json parser
duyhungtnn Jun 30, 2024
209d76c
fix: add 2 fail test cases
duyhungtnn Jun 30, 2024
f16e7d8
chore: add type OnlyPlainObject<T>
duyhungtnn Jun 30, 2024
37e0379
test: jsonVariationDetails
duyhungtnn Jul 1, 2024
80087ad
test: update e2e tests
duyhungtnn Jul 1, 2024
bc290b5
feat: remove generic from jsonVariable
duyhungtnn Jul 1, 2024
7160570
feat: prepare to allow more type could returning from objectVariation…
duyhungtnn Jul 2, 2024
fdcf762
fix: all test case
duyhungtnn Jul 3, 2024
62a9d46
fix: e2e tests
duyhungtnn Jul 3, 2024
a39bc03
test: objectVariation
duyhungtnn Jul 3, 2024
bfc56ce
fix: remove unused func
duyhungtnn Jul 3, 2024
cbbf9e2
test: data transformer logic
duyhungtnn Jul 3, 2024
a239ef4
test: more test for objectVariation
duyhungtnn Jul 3, 2024
70691ec
fix: e2e test fail
duyhungtnn Jul 3, 2024
c2af510
Merge branch 'main' into feat/new-detailed-evaluation-interface
duyhungtnn Jul 3, 2024
7ecfb70
Update build.yml
duyhungtnn Jul 4, 2024
6232bea
feat: make breaking changes in the jsonVariation()
duyhungtnn Jul 11, 2024
8f046d5
Merge branch 'feat/new-detailed-evaluation-interface' of github.com:b…
duyhungtnn Jul 11, 2024
2aa596d
fix: remove unused code
duyhungtnn Jul 11, 2024
4b10ae2
chore: change json parse method name
duyhungtnn Jul 11, 2024
9b5c58a
chore: add type_converter
duyhungtnn Jul 11, 2024
db2e6c8
feat: init new interface
duyhungtnn Jun 24, 2024
f4ba0bf
feat: update new API interface
duyhungtnn Jun 26, 2024
b2f87f0
feat: new detailed interface implementation
duyhungtnn Jun 26, 2024
f30e179
chore: add deprecated message
duyhungtnn Jun 26, 2024
69cfa5b
fix: test fail
duyhungtnn Jun 26, 2024
30f8540
chore: enable number tests
duyhungtnn Jun 27, 2024
c8bfd03
chore: remove unneccessary func
duyhungtnn Jun 27, 2024
113bbe5
feat: add newDefaultBKTEvaluationDetails func
duyhungtnn Jun 27, 2024
b8af6ad
test: newDefaultBKTEvaluationDetails
duyhungtnn Jun 28, 2024
c4c80d5
chore: group test case for `newDefaultBKTEvaluationDetails`
duyhungtnn Jun 28, 2024
ba9b30d
test: stringVariationDetails
duyhungtnn Jun 28, 2024
7ec2c7f
test: add test for new interface
duyhungtnn Jun 28, 2024
a42d274
test: add more unit test for convertRawValueToType
duyhungtnn Jun 29, 2024
1d90896
fix: update json parser
duyhungtnn Jun 30, 2024
36829c4
fix: add 2 fail test cases
duyhungtnn Jun 30, 2024
2c149ab
chore: add type OnlyPlainObject<T>
duyhungtnn Jun 30, 2024
3a6e216
test: jsonVariationDetails
duyhungtnn Jul 1, 2024
60bed89
test: update e2e tests
duyhungtnn Jul 1, 2024
b5913f5
feat: remove generic from jsonVariable
duyhungtnn Jul 1, 2024
e6ce93a
feat: prepare to allow more type could returning from objectVariation…
duyhungtnn Jul 2, 2024
a0b6258
fix: all test case
duyhungtnn Jul 3, 2024
43a2064
fix: e2e tests
duyhungtnn Jul 3, 2024
9dfcd88
test: objectVariation
duyhungtnn Jul 3, 2024
ba00ec6
fix: remove unused func
duyhungtnn Jul 3, 2024
fcacb6d
test: data transformer logic
duyhungtnn Jul 3, 2024
bb494e7
test: more test for objectVariation
duyhungtnn Jul 3, 2024
d4b1966
fix: e2e test fail
duyhungtnn Jul 3, 2024
fccb859
feat: make breaking changes in the jsonVariation()
duyhungtnn Jul 11, 2024
15e8a37
Update build.yml
duyhungtnn Jul 4, 2024
b9cc3f3
fix: remove unused code
duyhungtnn Jul 11, 2024
109360c
chore: change json parse method name
duyhungtnn Jul 11, 2024
a3f0f42
chore: add type_converter
duyhungtnn Jul 11, 2024
88dd9ef
chore: remove unused func getVariationValue
duyhungtnn Jul 12, 2024
8f72bed
Merge branch 'feat/new-detailed-evaluation-interface' of github.com:b…
duyhungtnn Jul 12, 2024
44d9ea7
chore: update error message for check non bank string
duyhungtnn Jul 12, 2024
bb34f67
chore: correct logic assetNonBlankString
duyhungtnn Jul 12, 2024
98c0efc
chore: moved Json type to src/JsonTypes.ts
duyhungtnn Jul 12, 2024
00e15db
chore: add missing class
duyhungtnn Jul 12, 2024
0f8b467
fix: build fail
duyhungtnn Jul 12, 2024
31982a5
fix: lint fail
duyhungtnn Jul 12, 2024
cec2539
Merge branch 'main' into feat/new-detailed-evaluation-interface
duyhungtnn Jul 19, 2024
5a27aef
Merge branch 'main' into feat/new-detailed-evaluation-interface
duyhungtnn Aug 2, 2024
247ca24
chore: rename jsonVariation to objectVariation
duyhungtnn Aug 2, 2024
66ce82d
chore: @deprecated jsonVariation
duyhungtnn Aug 2, 2024
7fa7d0c
chore: remove unnecessary if condition
duyhungtnn Aug 9, 2024
79ba253
chore: correct comments
duyhungtnn Aug 9, 2024
821cd3d
chore: rename BKTJsonValue to BKTValue
duyhungtnn Aug 9, 2024
cf33bad
chore: correct variable name
duyhungtnn Aug 9, 2024
7ac3c9a
chore: rename BKTJsonValue in the comment to BKTValue
duyhungtnn Aug 21, 2024
f99a134
chore: keep the detail interface right after the non-detail interface
duyhungtnn Aug 26, 2024
effffcc
Merge branch 'main' into feat/new-detailed-evaluation-interface
duyhungtnn Sep 6, 2024
08ddbb0
restore: jsonVariation method
duyhungtnn Sep 6, 2024
14c24ac
chore: move BKTValue & BKTEvaluationDetails to new files
duyhungtnn Sep 6, 2024
7cd8384
fix: lint errors
duyhungtnn Sep 6, 2024
0183a81
fix: event e2e test fail
duyhungtnn Sep 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions e2e/BKTClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,30 @@ suite('e2e/BKTClientTest', () => {
const javascript = client.evaluationDetails('feature-js-e2e-string')
expect(javascript).not.toBeNull()

const javascriptEvaluationDetails = client.stringVariationDetails(
'feature-js-e2e-string',
'',
)
expect(javascriptEvaluationDetails.variationValue).not.toEqual('')

// can retrieve evaluations for other featureTag
const android = client.evaluationDetails('feature-android-e2e-string')
expect(android).not.toBeNull()

const androidEvaluationDetails = client.stringVariationDetails(
'feature-android-e2e-string',
'',
)
expect(androidEvaluationDetails.variationValue).not.toStrictEqual('')

const golang = client.evaluationDetails('feature-go-server-e2e-1')
expect(golang).not.toBeNull()

const golangEvaluationDetails = client.stringVariationDetails(
'feature-go-server-e2e-1',
'',
)
expect(golangEvaluationDetails.variationValue).not.toStrictEqual('')
})
})
})
Expand Down
73 changes: 73 additions & 0 deletions e2e/evaluations.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,20 @@ suite('e2e/evaluations', () => {
variationValue: 'value-1',
reason: 'DEFAULT',
})

const evaluationDetails = client.stringVariationDetails(
FEATURE_ID_STRING,
'default',
)
expect(evaluationDetails).toStrictEqual({
featureId: FEATURE_ID_STRING,
featureVersion: 5,
userId: USER_ID,
variationId: '87e0a1ef-a0cb-49da-8460-289948f117ba',
variationName: 'variation 1',
variationValue: 'value-1',
reason: 'DEFAULT',
})
})
})

Expand Down Expand Up @@ -95,6 +109,20 @@ suite('e2e/evaluations', () => {
variationValue: '10',
reason: 'DEFAULT',
})

const evaluationDetails = client.numberVariationDetails(
FEATURE_ID_INT,
0,
)
expect(evaluationDetails).toStrictEqual({
featureId: FEATURE_ID_INT,
featureVersion: 3,
userId: USER_ID,
variationId: '6079c503-c281-4561-b870-c2c59a75e6a6',
variationName: 'variation 10',
variationValue: 10,
reason: 'DEFAULT',
})
})
})

Expand Down Expand Up @@ -123,6 +151,20 @@ suite('e2e/evaluations', () => {
variationValue: '2.1',
reason: 'DEFAULT',
})

const evaluationDetails = client.numberVariationDetails(
FEATURE_ID_DOUBLE,
0,
)
expect(evaluationDetails).toStrictEqual({
featureId: FEATURE_ID_DOUBLE,
featureVersion: 3,
userId: USER_ID,
variationId: '2d4a213c-1721-434b-8484-1b72826ece98',
variationName: 'variation 2.1',
variationValue: 2.1,
reason: 'DEFAULT',
})
})
})
})
Expand Down Expand Up @@ -152,6 +194,20 @@ suite('e2e/evaluations', () => {
variationValue: 'true',
reason: 'DEFAULT',
})

const evaluationDetails = client.booleanVariationDetails(
FEATURE_ID_BOOLEAN,
false,
)
expect(evaluationDetails).toStrictEqual({
featureId: FEATURE_ID_BOOLEAN,
featureVersion: 3,
userId: USER_ID,
variationId: '4fab39c8-bf62-4a78-8a10-1b8bc3dd3806',
variationName: 'variation true',
variationValue: true,
reason: 'DEFAULT',
})
})
})

Expand All @@ -164,6 +220,9 @@ suite('e2e/evaluations', () => {
expect(client.jsonVariation(FEATURE_ID_JSON, '')).toStrictEqual({
key: 'value-1',
})
expect(client.objectVariation(FEATURE_ID_JSON, '')).toStrictEqual({
key: 'value-1',
})
})

test('detail', () => {
Expand All @@ -182,6 +241,20 @@ suite('e2e/evaluations', () => {
variationValue: `{ "key": "value-1" }`,
reason: 'DEFAULT',
})

const evaluationDetails = client.objectVariationDetails(
FEATURE_ID_JSON,
{},
)
expect(evaluationDetails).toStrictEqual({
featureId: FEATURE_ID_JSON,
featureVersion: 3,
userId: USER_ID,
variationId: '8b53a27b-2658-4f8c-925e-fb277808ed30',
variationName: 'variation 1',
variationValue: { key: 'value-1' },
reason: 'DEFAULT',
})
})
})
})
3 changes: 3 additions & 0 deletions e2e/events.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ suite('e2e/events', () => {
expect(client.jsonVariation(FEATURE_ID_JSON, '')).toStrictEqual({
key: 'value-1',
})
expect(client.objectVariation(FEATURE_ID_JSON, '')).toStrictEqual({
key: 'value-1',
})

const component = getDefaultComponent(client)

Expand Down
Loading
Loading