feat(linear): resolve label names for issue writes (--label-name)#1411
feat(linear): resolve label names for issue writes (--label-name)#1411ericlitman wants to merge 2 commits into
Conversation
Add a repeatable --label-name flag to `issues create` and `issues edit` that resolves a team-scoped label name (including team-safe global labels) to its UUID at write time, mirroring the mvanhorn#1317 --project-name resolver. Reuses validateIssueLabelTeams for post-resolution team validation. MOB-340, MOB-479
Greptile SummaryAdds a
Confidence Score: 5/5Safe to merge — all label resolution paths are correct and tested; the refactored metadata-fetch logic in issues_edit.go preserves existing behavior. The new resolver faithfully mirrors the established portfolio-resolver pattern, the needsIssueMetadata guard correctly eliminates the previously-flagged redundant fetch, and the eight new tests cover the critical combinations including global labels, dedup, ambiguity, not-found, and media+label-name interaction. No mutation path is affected without going through validateIssueLabelTeams. No files require special attention; the two minor observations are confined to an efficiency note in issues_edit.go and a UX note in label_resolve.go. Important Files Changed
|
|
QA complete on our side: crabbox-council reviewed (3 reviewer lanes; sole P2 adjudicated false by code trace), |
|
MOB-630 follow-up landed on this PR branch. Proof:
Linear follow-up filed from review: MOB-641 covers the separate |
feat(linear): resolve label names for issue writes (--label-name)Follow-up to #1317 (
--project-nameportfolio resolver). Adds a repeatable--label-nameflag toissues createandissues editthat resolves a label name to its UUID at write time — including team-safe global (workspace) labels — so agents can apply labels by name instead of needing UUIDs.Change (entirely within
library/project-management/linear/)internal/cli/label_resolve.go, mirroringportfolio_resolve.go:searchIssueLabelsLive(paginatedissueLabelsGraphQL, name-contains filter via the sharedportfolioNameContainsFilter, stable sort),resolveLabelNameForWriteLive(exact-match within {team} ∪ {global, team==null}; typedambiguous/not foundvia the genericportfolioResolveErr[T]),resolveLabelNamesForWriteLive(per-name resolve + dedup),mergeLabelIDs,matchingIssueLabelTeam(nil/empty team ⇒ global, included for any team).--label-nameintoissues create(resolves with--team) andissues edit(resolves with the issue's team); resolved UUIDs merge into the existing--labelset beforevalidateIssueLabelTeamsruns on the merged set.--label(UUID) and--label-nameare combinable and de-duplicated.linear_agent_test.gostyle: resolve-by-name, ambiguity, not-found, team-safe global resolution,--label+--label-namemerge, and a--project-nameregression.Validation
go build ./...andgo test ./...green (against this branch'smainbase). Live-verified:issues create --team … --label-name "kind:bug" --label-name "area:review-tooling"applies both real labels;issues edit … --label-name …applies the resolved label.Notes
validateIssueLabelTeams/filterIssueLabelsForTeamand the feat(linear): resolve portfolio names for issue writes #1317 portfolio resolver helpers (the generic typed-error helpers,normalizePortfolioName, pagination filter).--label(UUID) path or--project-nameresolution.Opened from a maintained fork (
ericlitman/printing-press-library).