feat(generated): Add Groups API and organization membership groups support#536
Conversation
Greptile SummaryThis auto-generated PR adds a new
Confidence Score: 3/5PR is mostly safe but contains a P1 test fragility where a newly added test references a fixture file removed from the oagen manifest in the same PR. One P1 finding (test referencing a de-listed fixture that will break on next oagen cleanup) pulls the score below the 4/5 P1 ceiling, given it affects test reliability on the newly added code path. groups_test.go (ListOrganizationMemberships test fixture dependency) and testdata/create_group.json / testdata/update_group.json (misleading request-body fixtures tracked in manifest). Important Files Changed
Class Diagram%%{init: {'theme': 'neutral'}}%%
classDiagram
class Client {
+Groups() GroupService
+UserManagementOrganizationMembershipGroups() UserManagementOrganizationMembershipGroupService
+Authorization() AuthorizationService
+AdminPortal() AdminPortalService
}
class GroupService {
+ListOrganizationGroups(ctx, orgID, params) Iterator~Group~
+CreateOrganizationGroup(ctx, orgID, params) Group
+GetOrganizationGroup(ctx, orgID, groupID) Group
+UpdateOrganizationGroup(ctx, orgID, groupID, params) Group
+DeleteOrganizationGroup(ctx, orgID, groupID) error
+ListOrganizationMemberships(ctx, orgID, groupID, params) Iterator~UserOrganizationMembershipBaseListData~
+CreateOrganizationMembership(ctx, orgID, groupID, params) Group
+DeleteOrganizationMembership(ctx, orgID, groupID, omID) error
}
class UserManagementOrganizationMembershipGroupService {
+ListOrganizationMembershipGroups(ctx, omID, params) Iterator~Group~
}
class AuthorizationService {
+ListResourcesForMembership() Iterator~AuthorizationResource~
+ListEffectivePermissions() Iterator~AuthorizationPermission~
+ListRoleAssignments() Iterator~RoleAssignment~
}
class Group {
+string Object
+string ID
+string OrganizationID
+string Name
+string Description
+string CreatedAt
+string UpdatedAt
}
class WaitlistUser {
+string Object
+string ID
+string Email
+WaitlistUserState State
+string ApprovedAt
}
Client --> GroupService
Client --> UserManagementOrganizationMembershipGroupService
Client --> AuthorizationService
GroupService --> Group
UserManagementOrganizationMembershipGroupService --> Group
Reviews (1): Last reviewed commit: "feat(generated): Add Groups API and orga..." | Re-trigger Greptile |
| fixture, err := os.ReadFile("testdata/list_user_organization_membership_base_list_data.json") | ||
| if err != nil { | ||
| t.Fatalf("failed to read fixture: %v", err) | ||
| } | ||
| w.Write(fixture) |
There was a problem hiding this comment.
Test fixture removed from manifest but still referenced
testdata/list_user_organization_membership_base_list_data.json is explicitly removed from .oagen-manifest.json in this PR, yet this test continues to read from it. If a subsequent oagen run deletes files that are no longer tracked by the manifest, this test will fail at the os.ReadFile call with no fixture to serve, causing the iterator assertion to break. A new fixture should be added to the manifest, or the test should reference a tracked file (e.g., testdata/list_user_organization_membership.json if its shape is compatible).
| // UpdateGroup is an alias for UpdateAuthorizationPermission. | ||
| type UpdateGroup = UpdateAuthorizationPermission |
There was a problem hiding this comment.
Misleading type alias coupling
UpdateGroup to UpdateAuthorizationPermission
UpdateGroup is aliased to UpdateAuthorizationPermission — a structurally unrelated type — solely because they share the same Name/Description schema at this point in time. If UpdateAuthorizationPermission ever gains a permission-specific field (e.g., ResourceTypeSlug) or vice-versa, consumers of UpdateGroup would silently pick up that field. The same pattern is used for UpdateOrganizationRole and UpdateRole, so this appears to be a code-generator decision, but it creates invisible semantic coupling across two distinct domains.
| { | ||
| "name": "Engineering", | ||
| "description": "The engineering team" | ||
| } |
There was a problem hiding this comment.
Fixture files contain request body, not a full response object
testdata/create_group.json (and testdata/update_group.json) contain only {"name": "…", "description": "…"}, which is the request body shape — not a full Group response (which should include id, object, organization_id, created_at, updated_at). The actual tests correctly use testdata/group.json for responses, so these files are unused and only tracked in the manifest. Having misleadingly named request-body fixtures that look like response fixtures can cause confusion for future test authors.
Summary
Triggered by workos/openapi-spec@b684348