Add --add-label and --remove-label to issue update - #259
Merged
Conversation
The reporter asked for a way to detach a label from one issue without
deleting it team-wide, believing --label was additive. It actually
replaces the issue's entire label set (IssueUpdateInput.labelIds), so
the gap was wider than reported: adding one label clobbered the rest.
Rather than only the suggested --remove-label, this maps both
--add-label and --remove-label onto the API's addedLabelIds/
removedLabelIds (one atomic mutation, no read-modify-write). --label
keeps its documented replace semantics for existing scripts, with help
text that now says so. Flag names match gh issue edit, the surface
users and agents reach for first.
A --clear-labels flag was considered (an empty label set is currently
inexpressible in one command) and deliberately deferred: adding a flag
later is backwards compatible, removing one is breaking, and nothing
has asked for clear-all yet.
Invalid combinations error before any network call: --label with
incremental flags, the same resolved label ID in both add and remove,
and --team moves combined with incremental flags (label names resolve
against the destination team, which would make source-team labels
silently unresolvable). Live QA confirmed removing an unattached label
is rejected by Linear's API ("Label <id> is not on issue <id>"), not a
silent no-op — surfaced as-is, consistent with the repo's
explicit-input-errors philosophy.
The reporter's alternative ask (label rename) is deferred: it is
team-wide and would not solve the per-issue detach workflow.
Github-Issue: Fixes #258
Github-Issue-Url: #258
schpetbot
force-pushed
the
schpet/push-rtmkyzltxtnl
branch
from
August 5, 2026 21:53
044a1ff to
8eae8f1
Compare
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.
Adds per-issue incremental label operations to
linear issue update, mapped onto the API'saddedLabelIds/removedLabelIdsin a single atomic mutation (no read-modify-write):This intentionally goes beyond the reported ask. The issue assumed
--labelwas additive; it actually replaces the entire label set, so adding one label clobbered the rest —--add-labelfixes that side too.--labelkeeps its documented replace semantics for existing scripts, with help text that now says so explicitly. Flag names matchgh issue edit.A
--clear-labelsflag was considered (an empty label set is currently inexpressible in one command) and deliberately deferred: adding a flag later is backwards compatible, removing a released one is breaking, and nothing has asked for clear-all yet.Invalid combinations error before any network call:
--labelwith incremental flags, the same resolved label ID in both add and remove (case-insensitive), and explicit--teammoves combined with incremental flags (label names resolve against the destination team, which would make source-team labels silently unresolvable).Notes from live QA against a scratch issue: add preserves existing labels, remove detaches per-issue while the label survives team-wide, and removing a label the issue doesn't have is rejected by Linear's API ("Label is not on issue ") — surfaced as-is rather than papered over.
Deferred as follow-ups:
--clear-labels,label rename(team-wide; doesn't solve per-issue detach), and the same replace-only asymmetry on project labels/members/teams, subscribers, and attachment removal.Fixes #258