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

Import feature flag list feature #2071

Merged
merged 19 commits into from
Nov 5, 2024
Merged

Conversation

Yagnik56
Copy link
Collaborator

@Yagnik56 Yagnik56 commented Oct 21, 2024

This PR contains an import feature flag list feature with validation and import endpoints.

Here are a few images of the same.
image
image
image

There are 3 lists json files available in zack's comment for testing with the updated format.

Some Validation user has to keep in mind:
The list's context and feature flag's context must match; all these lists have Mathia as context.
The feature flag ID isn't needed. It will be removed from export and where the list is getting imported that feature flag's ID will be added during import from the backend.
For the listType as a segment, the subsegment it refers to should exist with the same context as the feature flag we are importing that list in.
The group type has to be valid for its context with the list type available for it's context.

@zackcl
Copy link
Collaborator

zackcl commented Oct 21, 2024

@Yagnik56 Could you please share a working FF list JSON file (or content)?

@Yagnik56
Copy link
Collaborator Author

@Yagnik56 Could you please share a working FF list JSON file (or content)?

I added 3 files in the description now, you can use those for testing.

@Yagnik56 Yagnik56 requested a review from zackcl October 21, 2024 15:37
@zackcl
Copy link
Collaborator

zackcl commented Oct 21, 2024

Thanks for sharing the files. I tried importing the files you shared, but they all show up as "Incompatible."
Screenshot 2024-10-22 at 1 34 36 AM

Could it be because the file doesn't match the feature flag I'm trying to import it into?

{"createdAt":"2024-10-03T08:22:14.136Z","updatedAt":"2024-10-03T08:22:23.888Z","versionNumber":2,"segmentId":"306aeaac-0f58-4d28-8c6a-918430dc7218","featureFlagId":"ffb4b749-3127-44ff-9aae-e011dacbad73","enabled":true,"listType":"Individual","segment":{"createdAt":"2024-10-03T08:22:14.136Z","updatedAt":"2024-10-03T08:22:14.136Z","versionNumber":1,"id":"306aeaac-0f58-4d28-8c6a-918430dc7218","name":"bfdb","description":"","context":"mathia","type":"private","individualForSegment":[{"createdAt":"2024-10-03T08:22:23.888Z","updatedAt":"2024-10-03T08:22:23.888Z","versionNumber":1,"segmentId":"306aeaac-0f58-4d28-8c6a-918430dc7218","userId":"bfbfd"}],"groupForSegment":[],"subSegments":[]}}

By the way, I'm not sure why we need to include the feature-flag-specific properties in the List file. These files should be exported from and imported into different feature flags (Include and Exclude Lists) and segments (Lists) tables.

Could we simply include list-specific properties in the List file? I think the properties might differ depending on the "listType."

@Yagnik56
Copy link
Collaborator Author

Yagnik56 commented Oct 21, 2024

To fix the issue of incompatibility:
Use a feature flag with mathia as context, individual and group lists should be compatible in that case. For a segment create a segment with mathia as context and add a new segment ID in the subsegment's ID instead of the one present in JSON should fix the segment list.

@zackcl
Copy link
Collaborator

zackcl commented Oct 23, 2024

@Yagnik56 Could you please reshare a JSON file content with minimal information possible? I think you mentioned many of the properties (e.g., featureFlagId) won't be included in the JSON file when exported, right? It would be helpful to see the file content for discussion tomorrow (we could discuss whether we want to include the context in the file or not).

@Yagnik56
Copy link
Collaborator Author

@zackcl I updated the json files in the description and removed the data that the backend won't send in export. You can have a look.

@zackcl
Copy link
Collaborator

zackcl commented Oct 24, 2024

Here are the file contents for reference:

Individual_list.json:

{
   "listType":"Individual",
   "segment":{
      "name":"bfdb",
      "description":"",
      "context":"mathia",
      "type":"private",
      "userIds":["bfbfd"],
      "groups":[ ],
      "subSegmentIds":[ ]
   }
}

Group_list.json:

{
   "listType":"group1",
   "segment":{
      "name":"fbdfd",
      "description":"",
      "context":"mathia",
      "type":"private",
      "userIds":[ ],
      "groups":[ 
       {
            "groupId":"fbdf",
            "type":"group1"
         }
      ],
      "subSegmentIds":[ ]
   }
}

Segment_list.json:

{
   "listType":"Segment",
   "segment":{
      "name":"seg1",
      "description":"2",
      "context":"mathia",
      "type":"private",
      "userIds":[ ],
      "groups":[ ],
      "subSegmentIds":[
         "a78e3c7d-8d55-438a-afd3-c9539fbb870a",
      ]
   }
}

Copy link
Collaborator

@VivekFitkariwala VivekFitkariwala left a comment

Choose a reason for hiding this comment

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

Small changes.

…ure-flag-list

Export feature flag list modals, API endpoing and functionality
@Yagnik56 Yagnik56 merged commit 073985d into dev Nov 5, 2024
14 checks passed
@Yagnik56 Yagnik56 deleted the feature/import-feature-flag-list branch November 5, 2024 14:32
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.

FF: Import List Modal (Include and Exclude Table Menu Function)
3 participants