feat: team CRUD and membership management#94
Conversation
|
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: 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 ( 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.
1c64f39 to
1a4d392
Compare
|
@flipbit03 Changes made and also rebased to resolve conflicts from the |
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.
1a4d392 to
6338503
Compare
|
@lightstrike we also need to fix those documentation lints. that |
This reverts commit 0b1f9a3.
|
@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. |
|
@flipbit03 Does your test Linear account have multiple users? |
|
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. |
|
@lightstrike I noticed that behavior, when testing, and created a second test user in the Linear Workspace I have set up for this:
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! |

Summary
teams read,teams create,teams update,teams deleteteams members add,teams members removeteam_create,team_update,team_delete,team_membership_create,team_membership_deleteusagecommand reference with all new team commandsDetails
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 settingsteams create <NAME>— with--key,--description,--icon,--color,--timezone,--private,--cycles-enabled,--triage-enabledteams update <KEY-OR-ID>— same flags as create plus--name, with no-op validationteams delete <KEY-OR-ID>— accepts key, name, or UUIDteams members add <TEAM> --user <USER>— add a user (supportsmealias)teams members remove <TEAM> --user <USER>— resolves membership ID internally, then removesImplementation notes:
TeamRef,TeamDetail,TeamMembershipRef),resolve_team_idreuse,print_one/print_tableoutputmembers removedoes a two-step lookup: fetches team memberships to find theTeamMembershipID for the target user, then callsteam_membership_deleteTest plan
--userrequired, usage text)make checkpasses (fmt, clippy, doc, build)make testpasses (all 73 CLI offline, 44 SDK offline, 0 warnings)