Skip to content

feat: team CRUD and membership management#94

Merged
flipbit03 merged 6 commits intoflipbit03:mainfrom
lightstrikelabs:feat/team-crud-membership
Feb 24, 2026
Merged

feat: team CRUD and membership management#94
flipbit03 merged 6 commits intoflipbit03:mainfrom
lightstrikelabs:feat/team-crud-membership

Conversation

@lightstrike
Copy link
Copy Markdown
Contributor

Summary

  • Add full team CRUD to the CLI: teams read, teams create, teams update, teams delete
  • Add team membership management: teams members add, teams members remove
  • Generate 5 new SDK mutation functions via codegen: team_create, team_update, team_delete, team_membership_create, team_membership_delete
  • Update usage command reference with all new team commands

Details

Teams previously only supported teams list. This PR brings teams to feature parity with documents and projects:

CLI commands added:

  • teams read <KEY-OR-ID> — full detail view including members, cycles/triage settings
  • teams create <NAME> — with --key, --description, --icon, --color, --timezone, --private, --cycles-enabled, --triage-enabled
  • teams update <KEY-OR-ID> — same flags as create plus --name, with no-op validation
  • teams delete <KEY-OR-ID> — accepts key, name, or UUID
  • teams members add <TEAM> --user <USER> — add a user (supports me alias)
  • teams members remove <TEAM> --user <USER> — resolves membership ID internally, then removes

Implementation notes:

  • Follows the existing document/project patterns: lean types (TeamRef, TeamDetail, TeamMembershipRef), resolve_team_id reuse, print_one/print_table output
  • members remove does a two-step lookup: fetches team memberships to find the TeamMembership ID for the target user, then calls team_membership_delete
  • No-op update validation matches the documents/milestones pattern

Test plan

  • SDK offline: 5 mutation variable serialization tests (team create, update, delete, membership create, membership delete)
  • SDK online: 2 integration tests (team CRUD lifecycle, membership create/delete lifecycle)
  • CLI offline: 10 tests (help text for all subcommands, flag validation, no-op update error, --user required, usage text)
  • CLI online: 3 end-to-end tests (create + list + delete, full CRUD with read-back verification, members add + verify + remove)
  • make check passes (fmt, clippy, doc, build)
  • make test passes (all 73 CLI offline, 44 SDK offline, 0 warnings)

@flipbit03 flipbit03 added the safe-to-test Maintainer-approved: run online tests with API secrets label Feb 23, 2026
@github-actions github-actions Bot removed the safe-to-test Maintainer-approved: run online tests with API secrets label Feb 23, 2026
@flipbit03
Copy link
Copy Markdown
Owner

flipbit03 commented Feb 23, 2026

Hey! The online tests are failing because Linear has a 48-character limit on team names, and the test names with a full UUID exceed that:

[test] CLI teams create 3acf27ab-5a19-46e2-abc8-324447a9c890   → 62 chars
[test] CLI teams CRUD 9b802ecb-4f5b-412e-897d-23435a7cfc3b     → 59 chars
[test] CLI teams members 2e1d24bd-8a3a-4527-a622-f4ad4035fa09   → 62 chars

Fix is to truncate the UUID to its first 8 chars — that keeps names well under the limit:

// Before:
let unique_name = format!("[test] CLI teams create {}", uuid::Uuid::new_v4());

// After:
let unique_name = format!("[test] tm-create {}", &uuid::Uuid::new_v4().to_string()[..8]);

Same change for the other two tests (tm-crud, tm-members). Three lines total.

I tried pushing the fix directly to your branch but ran into permission issues — would you mind applying this?

Add teamCreate, teamUpdate, teamDelete, teamMembershipCreate, and
teamMembershipDelete to operations.toml and regenerate SDK mutation
functions.
Add teams read, create, update, delete, members add, and members remove
subcommands. Includes lean types for field selection, no-op update
validation, and membership ID resolution for removals. Update usage.rs
with the new command reference.
Add offline variable serialization tests for all 5 team mutations and
online integration tests for team CRUD lifecycle and membership
create/delete.
Add offline arg parsing and help text tests for all new team
subcommands. Add online end-to-end tests for team create/delete,
full CRUD lifecycle, and members add/remove.
@lightstrike lightstrike force-pushed the feat/team-crud-membership branch from 1c64f39 to 1a4d392 Compare February 24, 2026 00:20
@lightstrike
Copy link
Copy Markdown
Contributor Author

@flipbit03 Changes made and also rebased to resolve conflicts from the comments delete PR merged (thanks!)

Linear rejects team names longer than 48 characters. Test names with
full UUIDs (36 chars) exceeded this — truncate to 8 chars and shorten
prefixes. Also enable uuid v4 feature for the CLI crate.
@lightstrike lightstrike force-pushed the feat/team-crud-membership branch from 1a4d392 to 6338503 Compare February 24, 2026 00:21
@flipbit03 flipbit03 added the safe-to-test Maintainer-approved: run online tests with API secrets label Feb 24, 2026
@flipbit03
Copy link
Copy Markdown
Owner

@lightstrike we also need to fix those documentation lints. that < needs proper escaping to appear in Rustdoc

@github-actions github-actions Bot removed the safe-to-test Maintainer-approved: run online tests with API secrets label Feb 24, 2026
@flipbit03 flipbit03 merged commit 0b1f9a3 into flipbit03:main Feb 24, 2026
8 checks passed
flipbit03 added a commit that referenced this pull request Feb 24, 2026
@lightstrike
Copy link
Copy Markdown
Contributor Author

@flipbit03 It looks like one of the online tests failed -- I'll open up a fix in a new PR once I get it figured out.

@lightstrike
Copy link
Copy Markdown
Contributor Author

@flipbit03 Does your test Linear account have multiple users?

@lightstrike
Copy link
Copy Markdown
Contributor Author

Basically we can't really test adding and removing a member without a second user account because the creator of the team is auto-added.

@flipbit03
Copy link
Copy Markdown
Owner

flipbit03 commented Feb 24, 2026

@lightstrike I noticed that behavior, when testing, and created a second test user in the Linear Workspace I have set up for this:

image

I'm now looking into improving the currently existing team membership crud tests, as I already merged this PR, I'll be tackling that in a further PR. Thanks again for the contributions! Here's the issue for it:

EDIT: This is fixed now, and these tests are now fully utilizing the second user to exercise the happy path. Cheers!

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