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

featu: [Add support for exporting the configuration[ (FF-2437) #90

Merged
merged 5 commits into from
Jul 2, 2024

Conversation

leoromanovsky
Copy link
Member

Fixes: #issue

Motivation and Context

Users who want to bootstrap their client SDK need a mechanism to export the configuration from their NodeJS server.

feat store drawio

Description

Adds a new method to the client called getConfiguration - it is implemented by exporting the contents of the servingStore: SyncStore. This is implemented as a Map and trivial to export all the flags. The top-level method returns the UFC response.

Customers will be instructed to serialize this to JSON if desired and transmit it over an internal API.

How has this been tested?

New unit tests.

@leoromanovsky leoromanovsky marked this pull request as ready for review June 18, 2024 05:59
src/client/eppo-client.ts Outdated Show resolved Hide resolved
src/configuration-store/configuration-store.ts Outdated Show resolved Hide resolved
@sameerank
Copy link
Contributor

sameerank commented Jun 18, 2024

Not sure if these questions are related, but here they go:

  1. Isn't the Node server version of the configuration incompatible with the JS client version? Or is the diagram referring to using the JS client version on the server (which aligns with how I'm thinking about this) to get the obfuscated config?
  2. And also we had paused exposing the ApiEndpoint class in this PR but I think (in a separate PR) we can make it importable again. Does that sound right? Or does this approach make that unnecessary since the SDK is handling the fetch?

@leoromanovsky
Copy link
Member Author

Not sure if these questions are related, but here they go:

  1. Isn't the Node server version of the configuration incompatible with the JS client version? Or is the diagram referring to using the JS client version on the server (which aligns with how I'm thinking about this) to get the obfuscated config?

Yes this is a good observation. I am planning on allowing the JS client to configure itself in obfuscated or non obfuscated mode, the latter being for this use case of importing a configuration from nodejs. Do you see concerns with this approach, assuming the customer is aware of the security relaxation they are performing?

  1. And also we had paused exposing the ApiEndpoint class in this PR but I think (in a separate PR) we can make it importable again. Does that sound right? Or does this approach make that unnecessary since the SDK is handling the fetch?

Cool yea now that we have the go ahead should complete that work to expose it.

@@ -41,6 +41,6 @@ export interface ISyncStore<T> {
export interface IAsyncStore<T> {
isInitialized(): boolean;
isExpired(): Promise<boolean>;
getEntries(): Promise<Record<string, T>>;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@felipecsl you had a review comment to rename getAll to entries. Ok for me to also rename getEntries to entries for consistency?

@leoromanovsky leoromanovsky merged commit e223b48 into main Jul 2, 2024
2 checks passed
@leoromanovsky leoromanovsky deleted the lr/ff-2437/export-all branch July 2, 2024 03:19
aarsilv pushed a commit that referenced this pull request Jul 2, 2024
* featu: [Add support for exporting the configuration[ (FF-2437)

* rename getAll to entries

* getFlagConfigurations

* bump to 3.4.0
aarsilv added a commit that referenced this pull request Jul 3, 2024
* Fetch and store bandit parameters (#85)

* bandit config store added

* fix typo

* test case

* feedback from PR

* Aaron/ff 2407/bandit evaluator (#88)

* don't fetch bandit parameters if no store provided

* stubbed methods for bandit evaluation

* failing attribute scoring test

* score actions tests passing

* clean up from rebase

* scoring working

* weights test in place

* tests passing

* feedback from PR

* Bandit selects and assigns action from weighted actions (#95)

* action selection working, but suspect

* failing JS test case

* shared test cases passing

* shared bandit tests passing

* intermediate test case passing

* fix test assignment weights

* bandit logger test

* handle when no actions

* tests passing

* changes from self-review of PR

* additional note for future PR

* remove comments from bandit logger interface

* feedback from PR

* fix remaining issues from rebase

* Update for updated shared test data (#104)

* update for shared test data updates

* get ready for updated sdk test data

* todo with failing test

* store bandit flag to action association

* rearrange parameters

* feedback from PR

* Handle explicitly bucketed numeric and categorical attributes  (#108)

* file names for test cases

* support explicitly bucketed attributes

* subject attribute test

* tests WIP

* final tests passing

* all tests passing

* need to export bandit logger interfaces

* feedback from PR

* featu: [Add support for exporting the configuration[ (FF-2437) (#90)

* featu: [Add support for exporting the configuration[ (FF-2437)

* rename getAll to entries

* getFlagConfigurations

* bump to 3.4.0

* bump feature version

* add bandit store setters to interface

---------

Co-authored-by: Leo Romanovsky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants