Skip to content

Conversation

@Callum0x50
Copy link
Member

No description provided.

@Callum0x50 Callum0x50 linked an issue Dec 4, 2025 that may be closed by this pull request
9 tasks
@Callum0x50 Callum0x50 marked this pull request as draft December 4, 2025 13:11
@Callum0x50 Callum0x50 changed the title Add commands to manage Teams and RBAC Add commands to manage Teams and Members Dec 15, 2025
@Callum0x50 Callum0x50 marked this pull request as ready for review December 15, 2025 08:16
@Callum0x50 Callum0x50 requested a review from Copilot December 15, 2025 08:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive team and member management capabilities to the CLI tool, allowing users to create/delete teams and add/remove team members programmatically.

Key changes:

  • Added team commands for creating and deleting teams with validation
  • Added member subcommands for adding and removing team members with role assignment
  • Extended the client interface with new API methods for team and member operations

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
pkg/rootcommand/rootcommand.go Wires up new team create/delete commands and member subcommand group
pkg/commands/teams/create.go Implements team creation with name/description validation
pkg/commands/teams/delete.go Implements team deletion by name lookup
pkg/commands/teams/member/add.go Implements adding members to teams with role assignment and helper functions for ID lookups
pkg/commands/teams/member/remove.go Implements removing members from teams using helper functions
pkg/client/teams.go Adds REST client methods for team CRUD operations and member management
pkg/client/client.go Extends client interfaces with TeamsClient and new MemberClient interface

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if teamName == "" {
return errEmptyName
}

Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

The function retrieves all teams from the API to find one by name. This could be inefficient if there are many teams. Consider adding a query parameter to the API or implement pagination if the API supports it. At minimum, document this potential performance limitation.

Suggested change
// NOTE: This retrieves all teams to find one by name, which may be inefficient if there are many teams.
// Consider updating the API to support querying by name or pagination to improve performance.

Copilot uses AI. Check for mistakes.
Comment on lines +46 to 49
type MemberClient interface {
AddTeamMember(ctx context.Context, teamId string, request []AddTeamMemberRequest) error
RemoveTeamMember(ctx context.Context, teamId string, memberId string) error
}
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

The member management methods (AddTeamMember and RemoveTeamMember) are defined in a separate MemberClient interface, but these are logically part of team management. Consider consolidating these methods into the TeamsClient interface for better cohesion, as members are a sub-resource of teams. This would align with the pattern used for GetTeamMembers which is already in TeamsClient.

Copilot uses AI. Check for mistakes.
Comment on lines 129 to 132
teams, err := set.PlatformClient.ListTeams(ctx)
if err != nil {
return "", redact.Errorf("could not list teams: %w", redact.Safe(err))
}
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

The function retrieves all teams from the API to find one by name. This could be inefficient if there are many teams. Consider adding a query parameter to the API or implement pagination if the API supports it. At minimum, document this potential performance limitation.

Copilot uses AI. Check for mistakes.
Comment on lines 150 to 152
users, err := set.PlatformClient.ListUsers(ctx)
if err != nil {
return "", redact.Errorf("could not list users: %w", redact.Safe(err))
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

The function retrieves all users from the API to find one by UPN. This could be inefficient with a large user base. Consider adding a query parameter to the API or implement pagination if the API supports it. At minimum, document this potential performance limitation.

Copilot uses AI. Check for mistakes.
@Callum0x50 Callum0x50 merged commit d9c58fa into main Dec 16, 2025
3 checks passed
@Callum0x50 Callum0x50 deleted the 44-add-rbac-and-team-management-to-indev-cli branch December 16, 2025 12:44
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.

Add RBAC and Team Management to indev CLI

2 participants