Skip to content

feat(project): add --label to project update#243

Merged
schpet merged 1 commit into
mainfrom
project-update-label
Jul 14, 2026
Merged

feat(project): add --label to project update#243
schpet merged 1 commit into
mainfrom
project-update-label

Conversation

@schpet

@schpet schpet commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Adds a repeatable --label flag to linear project update, mirroring the existing project create --label.

Behavior

  • Repeatable --label <label> ({ collect: true }, no short alias — -l is --lead on project commands).
  • Replace semantics: the supplied labels become the project's complete label set, consistent with project update --team and issue update --label.
  • Names resolve case-insensitively; an unknown label raises NotFoundError (no auto-create).
  • Empty/whitespace labels are rejected up front; case-insensitive duplicates collapse to a single ID.
  • Label groups are excluded from the lookup (isGroup: { eq: false }) so a group name can't be sent as a non-assignable label id — this also hardens the existing project create --label.

Design note

The --label semantics (replace vs additive vs gh-style --add/--remove deltas) were chosen by grounding in prior art (gh issue/pr edit use --add-label/--remove-label; glab issue update uses --label/--unlabel; kubectl label is delta-oriented) against this repo's own conventions. Replace won because the closest siblings in-repo — project update --team (same command) and issue update --label — both replace; adopting gh-style deltas on one command alone would be inconsistent (a possible future repo-wide enhancement). Additive-only can never remove a label, so it was rejected.

The project-label lookup is extracted from project-create into a shared getProjectLabelIdByName helper in utils/linear.ts so create and update stay identical.

Relationship to #226

This reshapes the project update half of #226 to the repo's existing label conventions. The project create --label half of #226 already shipped in #216, and #226's auto-create / interactive-create behavior is intentionally dropped in favor of NotFound-on-missing. #226 will be closed as superseded; credit retained via Co-authored-by.

Tests

project update: replace (asserts exact labelIds sent), case-insensitive dedup, NotFound-before-mutation, empty-label validation, --label-alone, and no-option. Regenerated references/project.md and the update snapshot. Full suite green under Deno 2.7.9 + TZ=UTC (keyring integration excluded, as in CI).

Adds a repeatable `--label` flag to `linear project update`, mirroring the
existing `project create --label`: names resolve case-insensitively and an
unknown label raises NotFoundError (no auto-create).

The flag uses replace semantics — the supplied labels become the project's
complete label set — consistent with `project update --team` and
`issue update --label`. Empty/whitespace labels are rejected up front, and
case-insensitive duplicates collapse to a single ID.

The project-label lookup is extracted from project-create into a shared
getProjectLabelIdByName helper in utils/linear.ts so create and update stay
identical.

This reshapes the update half of #226 to the repo's existing label
conventions; the create half of #226 already shipped in #216, and the PR's
auto-create/interactive-create behavior is intentionally dropped.

Co-authored-by: KinomotoMio <200703522+KinomotoMio@users.noreply.github.com>
@schpet
schpet merged commit 7e84ad9 into main Jul 14, 2026
15 checks passed
@schpet
schpet deleted the project-update-label branch July 14, 2026 04:37
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.

1 participant