feat(project): add --label to project update#243
Merged
Conversation
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>
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 a repeatable
--labelflag tolinear project update, mirroring the existingproject create --label.Behavior
--label <label>({ collect: true }, no short alias —-lis--leadon project commands).project update --teamandissue update --label.NotFoundError(no auto-create).isGroup: { eq: false }) so a group name can't be sent as a non-assignable label id — this also hardens the existingproject create --label.Design note
The
--labelsemantics (replace vs additive vs gh-style--add/--removedeltas) were chosen by grounding in prior art (gh issue/pr edituse--add-label/--remove-label;glab issue updateuses--label/--unlabel;kubectl labelis delta-oriented) against this repo's own conventions. Replace won because the closest siblings in-repo —project update --team(same command) andissue 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-createinto a sharedgetProjectLabelIdByNamehelper inutils/linear.tsso create and update stay identical.Relationship to #226
This reshapes the
project updatehalf of #226 to the repo's existing label conventions. Theproject create --labelhalf 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 viaCo-authored-by.Tests
project update: replace (asserts exactlabelIdssent), case-insensitive dedup, NotFound-before-mutation, empty-label validation,--label-alone, and no-option. Regeneratedreferences/project.mdand the update snapshot. Full suite green under Deno 2.7.9 +TZ=UTC(keyring integration excluded, as in CI).