Skip to content

feat: issue label read, create, update, and delete commands#112

Merged
flipbit03 merged 15 commits intoflipbit03:mainfrom
lightstrikelabs:feat/labels-crud
Mar 8, 2026
Merged

feat: issue label read, create, update, and delete commands#112
flipbit03 merged 15 commits intoflipbit03:mainfrom
lightstrikelabs:feat/labels-crud

Conversation

@lightstrike
Copy link
Copy Markdown
Contributor

@lightstrike lightstrike commented Mar 2, 2026

Summary

  • Add issueLabelCreate, issueLabelUpdate, issueLabelDelete mutations and issueLabels query to operations.toml and regenerate SDK
  • New CLI subcommands:
    • lineark labels list [--team KEY] — list all issue labels (includes team key)
    • lineark labels create <NAME> [--team KEY] [--color HEX] [--description TEXT] [--parent ID] — create a label
    • lineark labels update <ID> [--name TEXT] [--color HEX] [--description TEXT] [--parent ID] — update a label
    • lineark labels delete <ID> — delete a label
  • --labels NAME,... flag on issues create, issues update, and issues batch-update for setting labels by name
  • --label-by adding|replacing|removing and --clear-labels flags for label management
  • Labels shown by name in issue output (issues list, issues search, issues read)
  • RAII LabelGuard for test cleanup

Changes from original PR

  • Removed labels read — low value since you'd only know the UUID after listing, and listing already shows everything useful
  • Removed issueLabel query from operations.toml — no longer needed
  • Added labels to issue outputIssueSummary, SearchSummary, and IssueDetail now include label names (not IDs) via nested LabelConnection
  • Labels column in table output — issue list/search tables show comma-separated label names
  • --labels doc updated — says "names" not "names or UUIDs"
  • All tests migrated to TeamGuard pattern for self-containment
  • Merged with origin/main

Test plan

  • make check — clean (lint, doc, build, column alignment)
  • make test — all 203 offline tests pass
  • SDK online tests: 40/40 pass including issue_label_create_update_and_delete
  • CLI online tests: labels_list_json_returns_array, labels_list_json_includes_team_field, labels_create_update_and_delete all pass

@flipbit03 flipbit03 marked this pull request as ready for review March 7, 2026 18:13
@flipbit03 flipbit03 added the safe-to-test Maintainer-approved: run online tests with API secrets label Mar 7, 2026
@github-actions github-actions Bot removed the safe-to-test Maintainer-approved: run online tests with API secrets label Mar 7, 2026
@flipbit03
Copy link
Copy Markdown
Owner

flipbit03 commented Mar 7, 2026

Hey @lightstrike, great work on the labels CRUD!

A couple of design thoughts before we merge:

1. Remove labels read

We think labels read <UUID> is low value and should be removed. The workflow is: list all labels → see what's available → use them on issues. You'd only know a label UUID after listing, and the list already shows everything useful. No other part of the CLI needs to look up a label by ID, sans if we're setting label groups (implemented already). This also means we can drop the issueLabel query from operations.toml.

2. Labels should be referenced by name, not ID

Throughout the CLI, labels should be shown and set by name, not UUID:

  • IssueDetail and IssueSummary should include the issue's labels as a list of names (e.g. "labels": ["Bug", "P0"])
  • issues create --labels Bug,Feature and issues update --labels ... already use names — the output should match
  • The LabelRow in labels list can keep the ID for completeness, but issue-facing output should be name-only

This keeps things consistent with how the CLI handles teams (by key), assignees (by name/me), statuses (by name), etc. — always human-readable identifiers, never raw UUIDs, unless unavoidable (e.g. parent-child relationships between labels and group labels)

We'll push these changes directly to your branch.

- Remove `labels read` command and `issueLabel` query (low value — you'd
  only know the UUID after listing, and listing already shows everything)
- Add labels to IssueSummary, SearchSummary, and IssueDetail as
  name-only (no UUIDs) via nested LabelConnection
- Add labels column to issue list/search table output
- Update --labels doc to say "names" not "names or UUIDs"
- Remove LabelDetail and LabelParentRef types (no longer needed)
@flipbit03 flipbit03 added the safe-to-test Maintainer-approved: run online tests with API secrets label Mar 7, 2026
@github-actions github-actions Bot removed the safe-to-test Maintainer-approved: run online tests with API secrets label Mar 7, 2026
When creating an issue with --team and --labels, resolve_label_ids
now fetches both team-scoped and workspace-wide labels. Previously
workspace labels were invisible when a team filter was active.

Adds online test for labels with spaces in names.
- labels list now shows the parent label name column
- labels update supports --clear-parent to remove parent relationship
- labels create/update with --parent auto-promotes the parent to a group
  (Linear requires is_group=true before a label can have children)
- Adds online test for parent set/list/clear lifecycle
- labels create: add --group flag to create a group label
- labels update: add --group/--group false to promote/demote
  (demoting fails if label still has children)
- labels list: show group column ("yes" or empty)
- Remove auto-promotion of parent labels to groups
- Test covers full lifecycle: create group, add child, list,
  clear parent, demote group
- Remove id column (labels are referenced by name, not UUID)
- Rename group → is_label_group, parent → parent_label for clarity
- Sort output: groups first with children underneath, then standalone labels
Label names aren't globally unique — two different teams can have
the same label name. UUIDs are needed for --parent, update, and delete.
- SDK: add comment_update/resolve/unresolve, issue_batch_update,
  issue_vcs_branch_search, issue_label_create/update/delete
- CLI: add labels CRUD, issues batch-update/find-branch,
  comments update/resolve/unresolve, estimate flags
- Top-level: split Labels into its own row, update Issues and
  Comments rows with new subcommands
@flipbit03 flipbit03 self-requested a review March 7, 2026 20:52
Clearer intent: --make-label-group promotes a label to a group,
--clear-label-group demotes it back. No ambiguous boolean parameter.
…ear-parent-label-group

All label group flags are now fully explicit and self-documenting:
--parent-label-group, --clear-parent-label-group,
--make-label-group, --clear-label-group
@flipbit03 flipbit03 added the safe-to-test Maintainer-approved: run online tests with API secrets label Mar 7, 2026
@github-actions github-actions Bot removed the safe-to-test Maintainer-approved: run online tests with API secrets label Mar 7, 2026
labels now serializes as ["Bug", "Feature"] instead of the
GraphQL-leaking { nodes: [{ name: "Bug" }, ...] } structure.
@flipbit03 flipbit03 added the safe-to-test Maintainer-approved: run online tests with API secrets label Mar 7, 2026
@github-actions github-actions Bot removed the safe-to-test Maintainer-approved: run online tests with API secrets label Mar 7, 2026
- Fix issue tests using --parent-label-group instead of --parent (labels
  flag was incorrectly applied to issue parent operations during rename)
- Add exponential backoff to retry_with_backoff (0, 1, 2, 4, 8, 10s cap)
- Add settle() helper for post-creation eventual consistency delays
- Add run_lineark_with_retry() for transient "conflict on insert" errors
- Apply settle() after create_test_team() for API propagation
- Apply run_lineark_with_retry to all project creation calls
- Increase retry count for search-dependent unarchive test
@flipbit03 flipbit03 added the safe-to-test Maintainer-approved: run online tests with API secrets label Mar 8, 2026
@github-actions github-actions Bot removed the safe-to-test Maintainer-approved: run online tests with API secrets label Mar 8, 2026
@flipbit03
Copy link
Copy Markdown
Owner

Update: all changes are pushed. Here's what I added on top of your commit:

  • Removed labels read, dropped issueLabel query from operations.toml
  • Flattened label output in issues"labels": ["Bug", "Feature"] instead of the GraphQL connection nesting
  • Explicit group management flags — Linear requires is_group: true before a label can be a parent, so rather than auto-promoting (too magical), added --make-label-group / --clear-label-group and --parent-label-group / --clear-parent-label-group. Verbose on purpose — self-documenting for LLMs.
  • Fixed resolve_label_ids — when --team was set, workspace-wide labels were invisible. Now fetches both scopes.
  • Improved labels list — groups first with children underneath, is_label_group and parent_label columns, sorted sensibly
  • Test fixes — the flag rename accidentally bled into issue tests (--parent-label-group instead of --parent). Also added settle(), run_lineark_with_retry(), and exponential backoff to stop flaky failures from Linear's eventual consistency and transient "conflict on insert" errors.
  • Updated all three READMEs

Full suite passes: 64 CLI + 40 SDK + 11 blocking online tests.

@flipbit03 flipbit03 added the safe-to-test Maintainer-approved: run online tests with API secrets label Mar 8, 2026
@github-actions github-actions Bot removed the safe-to-test Maintainer-approved: run online tests with API secrets label Mar 8, 2026
@flipbit03 flipbit03 merged commit 3b01b0d into flipbit03:main Mar 8, 2026
10 checks passed
Copy link
Copy Markdown
Owner

@flipbit03 flipbit03 left a comment

Choose a reason for hiding this comment

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

LGTM!

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