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: ImmuatableConfiguration #231

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f45b39c
chore: rename configuration.ts to configuration-wire-types.ts
typotter Feb 19, 2025
704d2e5
chore: deprecate fetchFlagConfigurations in favour of startPolling
typotter Feb 19, 2025
0e9c2f5
feat: Wrap configuration store access in new Configuration object
typotter Feb 19, 2025
8b11bb4
feat: ConfigurationRequestor.getConfiguration
typotter Feb 19, 2025
84857ad
merge main
typotter Feb 19, 2025
688b200
chore: delegate isObfuscated check to i-config
typotter Feb 19, 2025
40a953d
chore: delegate getFlagKeys to i-config
typotter Feb 19, 2025
3786b78
chore: delegate getFlagConfigurations to i-config
typotter Feb 19, 2025
2ab3dda
chore: delegate getFlag->getNormalizedFlag and evalDetails method to …
typotter Feb 19, 2025
06fc3e5
fix: point default config at other config stores
typotter Feb 19, 2025
1cc8cea
chore: remove findBanditByVariation and delegate to i-config
typotter Feb 19, 2025
f7e539e
chore: remove getBandit and delegate to i-config
typotter Feb 19, 2025
39aed59
feat: i-config.isInitialized
typotter Feb 19, 2025
421470d
remove getConfigDetails and delegate to i-config
typotter Feb 19, 2025
5b34fc7
feat: getters for other config stores and some renaming
typotter Feb 19, 2025
15e3262
chore: delegate banditVariations.get to i-config
typotter Feb 19, 2025
bf412f8
move flag config expired check to config requestor
typotter Feb 19, 2025
1ff4f35
v4.11.0
typotter Feb 19, 2025
5fc7ef3
chore: drop unimplemented and add specific string types
typotter Feb 19, 2025
3ab4301
chore: rename new config file to make a nicer diff
typotter Feb 19, 2025
3533fa5
chore: save startPolling for later
typotter Feb 19, 2025
b4b44b9
chore:lint
typotter Feb 19, 2025
4a1231b
chore: take TODO
typotter Feb 19, 2025
0f1874e
chore: don't duplicate code
typotter Feb 19, 2025
3f86324
Merge branch 'main' into tp/i-configuration
typotter Feb 21, 2025
94e7f3e
comments
typotter Feb 21, 2025
8796c23
RO config WIP
typotter Mar 5, 2025
19ba44d
merge main
typotter Mar 5, 2025
b08e9f5
return a copy of the config
typotter Mar 5, 2025
c284c36
update tests
typotter Mar 5, 2025
bb75ce3
copy config details and rename class
typotter Mar 5, 2025
25d9c25
lint
typotter Mar 5, 2025
0f883d8
updates
typotter Mar 5, 2025
f6bd4de
Merge branch 'main' into tp/i-configuration
typotter Mar 6, 2025
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
Prev Previous commit
Next Next commit
remove getConfigDetails and delegate to i-config
typotter committed Feb 19, 2025
commit 421470d8cdb29b8d3ba707d46342a09bf5e5e15f
16 changes: 2 additions & 14 deletions src/client/eppo-client.ts
Original file line number Diff line number Diff line change
@@ -45,7 +45,6 @@ import {
BanditModelData,
BanditParameters,
BanditVariation,
ConfigDetails,
Flag,
IPrecomputedBandit,
ObfuscatedFlag,
@@ -933,7 +932,7 @@ export default class EppoClient {
subjectAttributes: Attributes = {},
): Record<FlagKey, PrecomputedFlag> {
const config = this.getConfiguration();
const configDetails = this.getConfigDetails();
const configDetails = config.getFlagConfigDetails();
const flagKeys = this.getFlagKeys();
const flags: Record<FlagKey, PrecomputedFlag> = {};

@@ -1051,7 +1050,7 @@ export default class EppoClient {
);
}

const configDetails = this.getConfigDetails();
const configDetails = config.getFlagConfigDetails();
const flag = this.getNormalizedFlag(config, flagKey);

if (flag === null) {
@@ -1155,17 +1154,6 @@ export default class EppoClient {
);
}

private getConfigDetails(): ConfigDetails {
return {
configFetchedAt: this.flagConfigurationStore.getConfigFetchedAt() ?? '',
configPublishedAt: this.flagConfigurationStore.getConfigPublishedAt() ?? '',
configEnvironment: this.flagConfigurationStore.getEnvironment() ?? {
name: '',
},
configFormat: this.flagConfigurationStore.getFormat() ?? '',
};
}

private getNormalizedFlag(config: IConfiguration, flagKey: string): Flag | null {
return this.isObfuscated(config)
? this.getObfuscatedFlag(config, flagKey)