Skip to content

feat(labels): add issue label CRUD commands - #232

Merged
iamfj merged 5 commits into
linearis-oss:nextfrom
doublerebel:feature/dbl-191-add-label-creation-support-to-linearis-cli
Jul 2, 2026
Merged

feat(labels): add issue label CRUD commands#232
iamfj merged 5 commits into
linearis-oss:nextfrom
doublerebel:feature/dbl-191-add-label-creation-support-to-linearis-cli

Conversation

@doublerebel

@doublerebel doublerebel commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Bug Description

linearis labels list can discover labels, but the CLI could not create or manage issue labels. It also lacked precise label detachment coverage on the objects that can receive labels.

Changes Made

  • Adds issue-label create, read, update, and delete subcommands under linearis labels.
  • Adds generated GraphQL label mutations plus a single-label issue-label query.
  • Adds selective issue-label removal with issues update --labels <labels> --label-mode remove while preserving add, overwrite, and --clear-labels.
  • Adds matching project-label attachment/removal controls for managed projects: projects create --labels, projects update --labels, projects update --labels --label-mode add|remove|overwrite, and projects update --clear-labels.
  • Keeps project-label CRUD out of this PR; project-label listing/application is covered, but creating/updating/deleting project-label definitions remains a non-goal.

Scope / Non-goals

This PR implements issue-label CRUD plus attach/remove coverage for the two managed labelable object contexts currently exposed by Linearis: issues and projects. It does not add project-label definition CRUD, parent-label management, or hierarchy editing.

Tests

  • npm run check:ci
  • npx tsc --noEmit
  • npm test
  • npm run build
  • node dist/main.js labels usage
  • node dist/main.js issues usage
  • node dist/main.js projects usage

Review Note

The command path follows the existing Linearis layering: command -> resolver -> service -> generated GraphQL operation. Services accept pre-resolved UUIDs only; commands keep validation and output handling at the CLI boundary.

Refs #117

@iamfj
iamfj force-pushed the feature/dbl-191-add-label-creation-support-to-linearis-cli branch from 4df82c3 to f6f7e62 Compare July 2, 2026 21:52
@iamfj
iamfj changed the base branch from main to next July 2, 2026 21:56
@iamfj
iamfj force-pushed the feature/dbl-191-add-label-creation-support-to-linearis-cli branch from f6f7e62 to 1000884 Compare July 2, 2026 21:56
doublerebel and others added 4 commits July 3, 2026 00:00
The label removal feature landed with inline --label-mode validation, but
next centralized label-mode parsing in common/domain-values. Extend the
shared LabelMode/parseLabelMode with the 'remove' mode and have the issues
and projects update commands consume it instead of duplicating validation.

Part of linearis-oss#117
next reworked GraphQLClient.request() to infer the result and variables
from the TypedDocumentNode, so explicit single type arguments no longer
type-check. Drop them from the issue-label CRUD service functions and let
the document drive the types, matching the rest of the services.

Part of linearis-oss#117
@iamfj
iamfj force-pushed the feature/dbl-191-add-label-creation-support-to-linearis-cli branch from 1000884 to 5590498 Compare July 2, 2026 22:05
@iamfj

iamfj commented Jul 2, 2026

Copy link
Copy Markdown
Member

Thanks for this, @doublerebel — really solid groundwork. The command → resolver → service → GraphQL layering is clean, the scoping (issue-label CRUD + attach/remove for issues and projects, with project-label definition CRUD and hierarchy left as explicit non-goals) is sensible, and the test coverage matched it well.

Since the branch had drifted a fair way behind next, I went ahead and finished it off so it's ready to merge. To keep your work intact, I rebased your two original commits onto fresh next as-is and put my changes on top as two separate commits:

  • refactor(labels): route label-mode through centralized parseLabelModenext landed a refactor that centralized --label-mode parsing into common/domain-values. I extended that shared LabelMode/parseLabelMode with your new remove mode and pointed the issues update / projects update commands at it, instead of the inline validation (which now would have been duplicated logic).
  • refactor(labels): infer GraphQL result typing for label operationsnext also reworked GraphQLClient.request() to infer result/variable types from the TypedDocumentNode, so the explicit type arguments in the new service functions no longer type-checked. Dropped them so the document drives the types, matching the other services.

I also retargeted the PR base from main to next (the repo's integration branch — main was ~60 commits behind, which was inflating the diff).

Everything's green now: tsc, check:ci, npm test (826 passing), and knip. Branch is ready to go — thanks again for the contribution!

@iamfj
iamfj marked this pull request as ready for review July 2, 2026 22:19
@iamfj
iamfj self-requested a review as a code owner July 2, 2026 22:19
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

✅ knip — no dead code

No unused files, exports, types, or dependencies detected.

Gate the description field on `!== undefined` so an explicit
`labels update <x> --description ""` clears the description instead
of being dropped by the truthiness check.
@iamfj
iamfj merged commit 220628c into linearis-oss:next Jul 2, 2026
9 checks passed
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