Flagsmith / flagsmith

Open Source Feature Flagging and Remote Config Service. Host on-prem or use our hosted version at https://flagsmith.com/
https://flagsmith.com/
BSD 3-Clause "New" or "Revised" License
4.9k stars 375 forks source link

Implement a file-system importer to go with the s3 importer #2512

Open dabeeeenster opened 1 year ago

dabeeeenster commented 1 year ago

We have an exporter for both file-system and s3. We only have an importer for S3. We should add a file-system based importer. More info at https://docs.flagsmith.com/deployment/configuration/importing-and-exporting

Acceptance Criteria

laurencefass commented 1 year ago

Yes please!

I have a requirement to be able export to file, and import back in, so I can use the config for testing.

Is there a roadmap for this feature, or any other plans to implement?

dabeeeenster commented 1 year ago

It is on the backlog but we don't have an ETA I'm afraid. Happy to take PRs tho!

laurencefass commented 1 year ago

thats fair enough. Is this something that could be achieved via your API's (with the aim of submitting a PR?)

dabeeeenster commented 1 year ago

You could script it via API but it would be quite honerous. There is also the Terraform provider.

laurencefass commented 1 year ago

While this feature is in the backlog are there any get/set functions in the server SDK to allow for a third party to implement importers from different mediums? i.e. getState(withAuth) and putState(withAuth). I guess this would assume a global application state object? Or multiple objects to get/set different sections?

dabeeeenster commented 1 year ago

The SDKs are strictly for end clients of the platform - they are not designed around doing work like this I'm afraid.

laurencefass commented 1 year ago

ok thank you.

So could i initialise state (features/segments/users etc) programmatically via SDKs (as opposed to export/import).

My motivation is to set up a repeatable integration test with identical container state across docker runs.

At the moment Im setting up FS state via UI, and I cant rely on volumes to preserve state.

dabeeeenster commented 1 year ago

Yep you can do all that with the API.

gagantrivedi commented 1 month ago

Local file system import can be done with loaddata e.g: python manage.py loaddata org.json