Add user list, team members --json, and member role markers#250
Merged
Conversation
Three related gaps in member listing:
`team members` had no --json output. It now emits the connection shape
({ nodes, pageInfo }) with GraphQL field names preserved, matching label list
and project list.
There was no way to list everyone in the workspace, only per-team. Adds
`linear user list` (alias `u`) querying viewer.organization.users. This is a
sibling command rather than a `team members --organization` flag: workspace
members are definitionally not team members, and a flag that has to error when
combined with the positional team key is the design saying it's two commands.
Members now show admin, owner, and you markers alongside the existing
inactive/guest/not-assignable ones, via a shared renderer.
Along the way this fixes `team members --all`, which was a no-op. getTeamMembers
never passed includeDisabled, so Linear defaulted it to false and disabled users
were never fetched — the client-side `active` filter was narrowing a set that
could not contain them. The regression test pins includeDisabled in the mock
variables, so it fails loudly if the flag stops reaching the API.
Note: the --all fix could not be exercised against real data; the workspace used
for QA has no disabled users.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three related gaps in member listing, plus a latent bug found along the way.
team members --jsonNo JSON output existed. Now emits the connection shape
{ nodes, pageInfo }with GraphQL field names preserved, matchinglabel listandproject list.--jsonrespects--allrather than dumping raw results, and an empty result still emits valid JSON instead of prose.linear user list(aliasu)There was no way to list everyone in the workspace — only per-team. This queries
viewer.organization.userswith full pagination.Why a sibling command and not
team members --organization: workspace members are definitionally not team members, so the flag would negate its own noun. The repo's existing scope flags (label list --workspace,project list --all-teams) keep the listed entity fixed and vary the filter. A flag that must throw when combined with the positional team key is the design telling you it's two commands.--workspace <slug>is also already a global option, so a second differently-spelled scope-widening flag would be a trap.Role markers
Members now render
(admin),(owner), and(you)alongside the existing(inactive),(guest),(not assignable), via a shared renderer used by both commands.adminandownerare independent in Linear's schema, so both can show at once.Bug fix:
team members --allwas a no-opgetTeamMembersnever passedincludeDisabled, so Linear defaulted it tofalseand disabled users were never fetched. The client-sideactivefilter was therefore narrowing a set that could never have contained them —--allcould not reveal anyone.includeDisabledis now an explicit required parameter so callers can't silently inherit the default.The regression test pins
includeDisabledin the mock variables, so it fails loudly if the flag stops reaching the API. Verified load-bearing by reverting the fix and watching it fail.Other notes
lastSeen: nullbecause the renderer formats it withtoLocaleString(), which varies by runner TZ/locale.Verification
Exercised against the real API: role markers render, JSON shape is correct, and
user listreturns 3 workspace members against 2 team members — confirming the workspace query genuinely returns a different set.One case could not be verified against live data: the workspace used for QA has no disabled users, so
--allreturns identical counts there. That path is covered by the mocked regression test only.Follow-up (not in this PR)
Generated skill docs are not reproducible across machines — the generator's wrap width comes from
Deno.consoleSize(), so regenerating on a different terminal reflows unrelated files. Only the genuinely-changed doc files are included here to avoid that churn.