threefoldtech / threefold_connect

Apache License 2.0
7 stars 4 forks source link

Flagsmith migration discussion #597

Open Mahmoud-Emad opened 4 months ago

Mahmoud-Emad commented 4 months ago

After conducting an in-depth investigation, it became evident that directly retrieving keys from the deployed flagsmith instance and subsequently pushing them to the chain was not feasible.

Initially, I developed a small script to extract some project data, albeit not all. However, upon further analysis, I realized that iterating over this data and pushing it to the chain would pose significant readability issues for each user.

To address this challenge, I propose implementing a solution where data is loaded individually for each user before being pushed. Subsequently, the entire dataset can be loaded, and a systematic approach can be employed to extract the exact feature required for each user.

Moreover, it may be necessary to develop a dedicated client to facilitate this process. Instead of pushing the data into a key-value store, we can consider creating a project with a similar database schema. This project can then accommodate the entire dataset, which can be accessed and utilized through a custom client within the application. This approach ensures better organization and accessibility of the data while maintaining clarity and coherence for users.

Example of the data

{
   "count":12,
   "next":null,
   "previous":null,
   "results":[
      {
         "id":3,
         "name":"kyc",
         "type":"STANDARD",
         "default_enabled":false,
         "initial_value":null,
         "created_date":"2021-10-21T15:18:28.016010Z",
         "description":null,
         "tags":[

         ],
         "multivariate_options":[

         ],
         "is_archived":false,
         "owners":[
            {
               "id":4,
               "email":"lennert.defauw@jimber.org",
               "first_name":"Lennert",
               "last_name":"Defauw"
            }
         ]
      },
      {
         "id":49,
         "name":"yggdrasil",
         "type":"STANDARD",
         "default_enabled":false,
         "initial_value":null,
         "created_date":"2021-11-19T13:40:22.590607Z",
         "description":null,
         "tags":[

         ],
         "multivariate_options":[

         ],
         "is_archived":false,
         "owners":[
            {
               "id":4,
               "email":"lennert.defauw@jimber.org",
               "first_name":"Lennert",
               "last_name":"Defauw"
            }
         ]
      },
      {
         "id":67,
         "name":"debug",
         "type":"STANDARD",
         "default_enabled":false,
         "initial_value":null,
         "created_date":"2021-11-30T18:39:54.559337Z",
         "description":null,
         "tags":[

         ],
         "multivariate_options":[

         ],
         "is_archived":false,
         "owners":[
            {
               "id":4,
               "email":"lennert.defauw@jimber.org",
               "first_name":"Lennert",
               "last_name":"Defauw"
            }
         ]
      },
      {
         "id":68,
         "name":"use-new-wallet",
         "type":"STANDARD",
         "default_enabled":false,
         "initial_value":null,
         "created_date":"2021-12-01T12:51:25.939924Z",
         "description":null,
         "tags":[
            4
         ],
         "multivariate_options":[

         ],
         "is_archived":false,
         "owners":[
            {
               "id":4,
               "email":"lennert.defauw@jimber.org",
               "first_name":"Lennert",
               "last_name":"Defauw"
            }
         ]
      },
      {
         "id":69,
         "name":"redo-identity-verification",
         "type":"STANDARD",
         "default_enabled":false,
         "initial_value":null,
         "created_date":"2021-12-01T12:52:03.188631Z",
         "description":null,
         "tags":[

         ],
         "multivariate_options":[

         ],
         "is_archived":false,
         "owners":[
            {
               "id":4,
               "email":"lennert.defauw@jimber.org",
               "first_name":"Lennert",
               "last_name":"Defauw"
            }
         ]
      },
      {
         "id":70,
         "name":"new-wallet-url",
         "type":"STANDARD",
         "default_enabled":false,
         "initial_value":"asfd",
         "created_date":"2021-12-01T12:52:22.062499Z",
         "description":null,
         "tags":[
            4
         ],
         "multivariate_options":[

         ],
         "is_archived":false,
         "owners":[
            {
               "id":4,
               "email":"lennert.defauw@jimber.org",
               "first_name":"Lennert",
               "last_name":"Defauw"
            }
         ]
      },
      {
         "id":75,
         "name":"timeout-seconds",
         "type":"STANDARD",
         "default_enabled":false,
         "initial_value":"5",
         "created_date":"2022-01-19T10:32:02.696224Z",
         "description":null,
         "tags":[

         ],
         "multivariate_options":[

         ],
         "is_archived":false,
         "owners":[
            {
               "id":4,
               "email":"lennert.defauw@jimber.org",
               "first_name":"Lennert",
               "last_name":"Defauw"
            }
         ]
      },
      {
         "id":76,
         "name":"farmers-url",
         "type":"STANDARD",
         "default_enabled":false,
         "initial_value":"TBD",
         "created_date":"2022-01-20T15:40:01.464520Z",
         "description":null,
         "tags":[
            3
         ],
         "multivariate_options":[

         ],
         "is_archived":false,
         "owners":[
            {
               "id":4,
               "email":"lennert.defauw@jimber.org",
               "first_name":"Lennert",
               "last_name":"Defauw"
            }
         ]
      },
      {
         "id":77,
         "name":"can-see-farmers",
         "type":"STANDARD",
         "default_enabled":false,
         "initial_value":null,
         "created_date":"2022-01-20T15:40:11.492930Z",
         "description":null,
         "tags":[
            3
         ],
         "multivariate_options":[

         ],
         "is_archived":false,
         "owners":[
            {
               "id":4,
               "email":"lennert.defauw@jimber.org",
               "first_name":"Lennert",
               "last_name":"Defauw"
            }
         ]
      },
      {
         "id":92,
         "name":"tos-url",
         "type":"STANDARD",
         "default_enabled":false,
         "initial_value":"https://library.threefold.me/info/legal/#/",
         "created_date":"2022-03-23T12:00:03.678908Z",
         "description":null,
         "tags":[

         ],
         "multivariate_options":[

         ],
         "is_archived":false,
         "owners":[
            {
               "id":4,
               "email":"lennert.defauw@jimber.org",
               "first_name":"Lennert",
               "last_name":"Defauw"
            }
         ]
      },
      {
         "id":93,
         "name":"maintenance-mode",
         "type":"STANDARD",
         "default_enabled":false,
         "initial_value":null,
         "created_date":"2022-03-23T12:11:54.828975Z",
         "description":null,
         "tags":[

         ],
         "multivariate_options":[

         ],
         "is_archived":false,
         "owners":[
            {
               "id":4,
               "email":"lennert.defauw@jimber.org",
               "first_name":"Lennert",
               "last_name":"Defauw"
            }
         ]
      },
      {
         "id":97,
         "name":"phone-verification",
         "type":"STANDARD",
         "default_enabled":false,
         "initial_value":null,
         "created_date":"2022-04-04T12:43:12.267298Z",
         "description":null,
         "tags":[

         ],
         "multivariate_options":[

         ],
         "is_archived":false,
         "owners":[
            {
               "id":4,
               "email":"lennert.defauw@jimber.org",
               "first_name":"Lennert",
               "last_name":"Defauw"
            }
         ]
      }
   ]
}