Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

feat: [add ability to export configurations] (FF-2472)#57

Merged
leoromanovsky merged 4 commits intomainfrom
lr/2472/export-configuration
Jun 21, 2024
Merged

feat: [add ability to export configurations] (FF-2472)#57
leoromanovsky merged 4 commits intomainfrom
lr/2472/export-configuration

Conversation

@leoromanovsky
Copy link
Member

@leoromanovsky leoromanovsky commented Jun 20, 2024

Fixes: #issue

Motivation and Context

Support customers being able to bootstrap their client SDKs from server responses. They need to be able to export the configuration to pass onto their clients.

This configuration is of course not obfuscated as it originated from the server - clients will be able to be instantiated in not-obfuscated mode for this use case.

Description

  • adds new public method get_flag_configurations that returns a Dict[str, Flag] - I am choosing this instead of the full UFC configuration since I do not want to export the bandits. Those can be exported and bootstrapped separately if that use-case comes up.

How has this been tested?

New unit tests.

@leoromanovsky leoromanovsky marked this pull request as ready for review June 20, 2024 18:19
flag_configurations = client.get_flag_configurations()

# Convert flag configurations to a JSON string
flag_config_json = json.dumps(flag_configurations)
Copy link
Contributor

Choose a reason for hiding this comment

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

This, flag_configurations being a dict, makes sense to me

def test_get_configurations():
config = {"flag1": mock_flag, "flag2": mock_flag}
store.set_configurations(config)
configurations = store.get_configurations()
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@leoromanovsky leoromanovsky merged commit 8462d04 into main Jun 21, 2024
@leoromanovsky leoromanovsky deleted the lr/2472/export-configuration branch June 21, 2024 18:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants