feat: Add group owners, user lookup, and enforce_feature_owners support#19
Merged
gagantrivedi merged 2 commits intomainfrom Apr 3, 2026
Merged
feat: Add group owners, user lookup, and enforce_feature_owners support#19gagantrivedi merged 2 commits intomainfrom
gagantrivedi merged 2 commits intomainfrom
Conversation
- Add GroupOwners field to Feature model with custom UnmarshalJSON - Add AddFeatureGroupOwners/RemoveFeatureGroupOwners client methods - Add User model and GetOrganisationUsers/GetOrganisationUserByEmail methods - Add EnforceFeatureOwners field to Project model - Add UserNotFoundError type
8 tasks
Zaimwa9
requested changes
Apr 2, 2026
Zaimwa9
left a comment
There was a problem hiding this comment.
Mostly minor comments but otherwise looks good
- Add parameter validation to manageFeatureGroupOwners (return error if feature.ProjectID or feature.ID is nil) - Add error path test for AddFeatureGroupOwners/RemoveFeatureGroupOwners with missing params - Pre-allocate GroupOwners slice in UnmarshalJSON for efficiency - Return copy of user in GetOrganisationUserByEmail to avoid pinning the slice in memory - Add missing date_joined field to User model and assert in tests https://claude.ai/code/session_01V7MNgv5pxkpz4chuJBzLcZ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GroupOwners *[]int64toFeaturemodel with customUnmarshalJSON(extracts IDs from{id, name}objects)AddFeatureGroupOwners/RemoveFeatureGroupOwnersclient methods (mirror existing owner management pattern)Usermodel andGetOrganisationUsers/GetOrganisationUserByEmailmethods for user lookup by emailEnforceFeatureOwners booltoProjectmodelUserNotFoundErrorerror typeCompanion PR: Flagsmith/terraform-provider-flagsmith (to follow)
Resolves Flagsmith/terraform-provider-flagsmith#214
Test plan
AddFeatureGroupOwnersandRemoveFeatureGroupOwnersGetOrganisationUsersandGetOrganisationUserByEmail(happy path + not found)TestGetFeatureto assertGroupOwnersdeserializationTestGetProjectto assertEnforceFeatureOwnersdeserialization