Skip to content

feat: team members#566

Draft
Prashansa-K wants to merge 10 commits intomainfrom
feat/team-members
Draft

feat: team members#566
Prashansa-K wants to merge 10 commits intomainfrom
feat/team-members

Conversation

@Prashansa-K
Copy link
Copy Markdown
Contributor

@Prashansa-K Prashansa-K commented Mar 13, 2026

This PR adds support for member additions in a team.
We can add a pre-existing user or a system-account to a team.

This is what the declarative UX looks like:

organization:
  teams:
    - ref: backend-team
      name: "Backend Team"

      members: # a grouping concept for better readability and collapsing yaml needs
        users:
         - ref: alice
           name: Alice # we can also support id, email for lookups  

        system_accounts:
         - ref: bot-account
           name: Bot # we can also support id for lookup

Get and list commands follow the same heirarchy.

The following commands would output all members of a team - users and system-accounts

  • kongctl get org teams members --team-name teamA
  • kongctl get org teams members --team-id

We can classify them more into specific members and filter based on names, ids and emails (in case of users).

  • kongctl get org teams members users --team-name teamA alice
  • kongctl get org teams members users --team-name teamA alice@gmail.com
  • kongctl get org teams members system-account --team-name teamA bot

For tests, I have used system-accounts in the scenarios as we can't readily create and delete users.
So, I am testing all functionalities using system-accounts.

Support for adopt and dump would be added in a separate PR.

@Prashansa-K Prashansa-K requested review from a team as code owners March 13, 2026 07:56
Copilot AI review requested due to automatic review settings March 13, 2026 07:56
@Prashansa-K Prashansa-K changed the title Feat/team members feat: team members Mar 13, 2026
Copy link
Copy Markdown
Contributor

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 introduces organization team member (users + system accounts) support across declarative planning/execution and adds get org team member ... CLI commands, along with E2E scenarios to validate apply/sync/plan workflows.

Changes:

  • Add a members block under organization_team declarative resources and extract member resources for planning/execution.
  • Implement Konnect SDK/state/planner/executor support for team membership CRUD (add/remove) and identity lookup.
  • Add CLI commands to list team members (all, users-only, system-accounts-only) and add E2E scenarios covering apply/sync/plan flows.

Reviewed changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/e2e/scenarios/org/teams/members/sync/testdata/team-members.yaml Test fixture for sync-mode team system account membership.
test/e2e/scenarios/org/teams/members/sync/scenario.yaml E2E scenario validating sync create/swap/idempotency for team members.
test/e2e/scenarios/org/teams/members/sync/overlays/003-sync-remove-member/team-members.yaml Overlay fixture to validate member removal/addition in sync.
test/e2e/scenarios/org/teams/members/plan/sync-workflow/testdata/team-members.yaml Test fixture for plan(sync) workflow membership changes.
test/e2e/scenarios/org/teams/members/plan/sync-workflow/scenario.yaml E2E scenario validating plan(sync) then apply via sync --plan.
test/e2e/scenarios/org/teams/members/plan/sync-workflow/overlays/003-remove-member/team-members.yaml Overlay fixture to validate plan(sync) member swap.
test/e2e/scenarios/org/teams/members/plan/apply-workflow/testdata/team-members.yaml Test fixture for plan(apply) workflow membership changes.
test/e2e/scenarios/org/teams/members/plan/apply-workflow/scenario.yaml E2E scenario validating plan(apply) + diff + apply + idempotency.
test/e2e/scenarios/org/teams/members/apply/testdata/team-members.yaml Test fixture for apply-mode team system account membership.
test/e2e/scenarios/org/teams/members/apply/scenario.yaml E2E scenario validating apply + member listing + idempotency.
internal/konnect/helpers/sdk_mock.go Extend SDK mock to provide TeamMembership API.
internal/konnect/helpers/sdk.go Extend SDK interface/implementation to expose TeamMembership API.
internal/konnect/helpers/organization_team_membership.go New helper wrapping SDK endpoints for team membership + identity listing.
internal/declarative/state/client.go Add state client methods for listing/adding/removing team users/system accounts and identity lookup.
internal/declarative/resources/types.go Add resource types and ResourceSet collections for extracted team member resources.
internal/declarative/resources/organization_team_user.go New declarative resource type for organization team user membership.
internal/declarative/resources/organization_team_system_account.go New declarative resource type for organization team system-account membership.
internal/declarative/resources/organization_team.go Add members block support and member validation/default traversal.
internal/declarative/planner/organization_team_planner.go Plan CREATE/DELETE changes for team membership in sync/apply flows.
internal/declarative/planner/constants.go Define planner resource type constants for team membership resources.
internal/declarative/loader/loader.go Extract team member resources from team members block during load.
internal/declarative/executor/organization_team_user_adapter.go New executor adapter to add/remove users from teams.
internal/declarative/executor/organization_team_system_account_adapter.go New executor adapter to add/remove system accounts from teams.
internal/declarative/executor/executor.go Wire new membership executors and resolve organization team references.
internal/cmd/root/products/konnect/organization/team/members/members.go New member command group + shared flags + team ID/name resolution helpers.
internal/cmd/root/products/konnect/organization/team/members/getMembers.go Implement get org team member to list both users and system accounts.
internal/cmd/root/products/konnect/organization/team/members/users/users.go Add get org team member users command.
internal/cmd/root/products/konnect/organization/team/members/users/getUsers.go Implement listing/filtering of team users.
internal/cmd/root/products/konnect/organization/team/members/systemaccounts/systemaccounts.go Add get org team member system-accounts command.
internal/cmd/root/products/konnect/organization/team/members/systemaccounts/getSystemAccounts.go Implement listing/filtering of team system accounts.
internal/cmd/root/products/konnect/organization/team/getTeam.go Attach member subcommands under team get/list command tree.
internal/cmd/root/products/konnect/declarative/declarative.go Pass TeamMembership API into the declarative state client.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread internal/declarative/loader/loader.go Outdated
Comment thread internal/declarative/resources/types.go
Comment thread internal/declarative/planner/organization_team_planner.go
@rspurgeon rspurgeon marked this pull request as draft March 15, 2026 14:17
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.

2 participants