fix(linear): resolve UUID from parent labels for auto-label propagation#1188
fix(linear): resolve UUID from parent labels for auto-label propagation#1188
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
The label ID resolution elegantly fixes the silent failure in Linear by dynamically looking up the parent labels ID. However, the UUID validation warning will introduce log pollution for Trello and JIRA projects since they dont use UUIDs for labels.
Should Fix
- src/triggers/shared/agent-execution.ts:678: The UUID validation warning
if (!UUID_REGEX.test(autoLabelId))will fire in the happy paths for JIRA (which uses name strings) and Trello (which uses 24-character MongoDB Object IDs). Since this file is shared across all PM providers, this will cause significant log pollution. Consider removing the warning entirely (since resolving by name is a valid feature), or scoping it toif (project.pm.type === "linear" && !UUID_REGEX.test(autoLabelId)).
(Note: If the warning is removed or scoped, the corresponding test in tests/unit/triggers/shared/agent-execution.test.ts that expect this warning will need to be updated as well).
🕵️ opencode · google/gemini-3.1-pro-preview · run details
The UUID validation warning in propagateAutoLabelAfterSplitting was firing for Trello and JIRA projects in happy paths, causing log pollution. Trello uses 24-character MongoDB Object IDs and JIRA uses name strings — both are valid non-UUID formats for those providers. Scope the warn() call to `project.pm.type === 'linear'` only, and update the corresponding test comment to explain why no warning fires for Trello. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Fixed! Scoped the UUID validation warning to if (project.pm.type === 'linear' && !UUID_REGEX.test(autoLabelId)) {
logger.warn(
'propagateAutoLabelAfterSplitting: labels.auto is not a UUID; resolving ID from parent labels',
{ autoLabelId },
);
}Trello (MongoDB Object IDs) and JIRA (name strings) are now silent on the happy path. The warning only fires for Linear projects where UUID format is actually required by Also updated the corresponding test comment to explain that no warning is expected for the Trello project used in that test case. The UUID-resolution behavior (passing the actual 🕵️ claude-code · claude-sonnet-4-6 · run details |
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
LGTM — clean, well-targeted two-pronged fix for a real silent failure in Linear's auto-label propagation.
Verification notes:
-
LinearIntegration.resolveLifecycleConfig — removing name-string defaults is safe. All callers of
pmConfig.labels.*guard againstundefined:PMLifecycleManager.safeAddLabel/safeRemoveLabelhaveif (!label) return;,hasAutoLabelreturnsfalsewhen!autoLabelId, and trigger handlers (e.g.linear/label-added.ts:40) checkif (!readyLabel) return false;. The change is also consistent with Trello's existing pattern (already returnedundefinedfor unconfigured labels). JIRA correctly keeps its name-string defaults. -
propagateAutoLabelAfterSplitting — the label resolution logic is sound. Since
hasAutoLabelon line 663 and thematchedLabelfind on lines 687-689 use identical matching logic (l.id === autoLabelId || l.name === autoLabelId) against the sameparentWorkItem.labelsarray,matchedLabelis guaranteed non-null wheneverhasAutoLabelreturnedtrue. The fallback toautoLabelIdis pure defense-in-depth. The resolution is provider-agnostic (correct — improves Trello/JIRA too in edge cases) while the warning log is correctly scoped to Linear only. -
Test coverage — comprehensive: name-string-to-UUID resolution, undefined-label skip, UUID passthrough happy path, and regression guards pinning the no-default-names invariant.
🕵️ claude-code · claude-opus-4-6 · run details
Summary
Fixes a silent failure in
propagateAutoLabelAfterSplittingwhere Linear's auto-label is never applied to backlog items after a splitting run because a name string is passed toaddLabelinstead of a UUID.Card: https://trello.com/c/9B95OKSr/627-fix-auto-label-propagation-silently-fails-for-linear-during-splitting
Root cause
Two separate issues caused the silent failure:
LinearIntegration.resolveLifecycleConfigdefaulted unset labels to name strings —labels?.auto ?? 'cascade-auto'— for all 5 label roles. Unlike JIRA (which auto-creates labels by name) and Trello (which already returnedundefined), Linear's adapter requires UUIDs inresolveLabelId(). Passing a name string causesresolveLabelId()to returnnulland theaddLabelcall to silently no-op.propagateAutoLabelAfterSplittingpassedpmConfig.labels.autodirectly toaddLabel— without resolving the actual label ID from the parent work item's label list. Even when the parent has the right label (matched by name), the raw configured string was passed to the provider instead of the actual UUID.Changes
src/pm/linear/integration.ts—resolveLifecycleConfig?? 'cascade-auto'etc.) from all 5 label fieldsundefined(correctly skips the operation)src/triggers/shared/agent-execution.ts—propagateAutoLabelAfterSplittinglogger.warnwhenlabels.autois not UUID formatidfrom the matched parent work item label (find()by id or name)resolvedAutoLabelId(always theidfield, never the name string) toaddLabelmatchedLabelis not found (fallback to rawautoLabelId)tests/unit/triggers/shared/agent-execution.test.tsuses the resolved UUID from parent labels when labels.auto is a name string— verifies the fix for the Linear silent-failure caseskips propagation (returns null) when labels.auto is undefined— verifies the fallback when no label is configuredpasses UUID directly when labels.auto is already a valid UUID (happy path)— verifies no warning and correct behavior for properly configured projectstests/unit/pm/linear/integration.test.tsuses defaults when labels config is missing→returns undefined labels when labels config is missing (not name-string defaults)to reflect the new correct behaviortests/unit/pm/linear/regression-2026-04.test.ts2026-04 regression: Linear auto-label propagation with name stringsdescribe block with 3 tests:undefined(not name strings)'cascade-xxx'stringsTest plan
tests/unit/triggers/shared/agent-execution.test.ts— 37 tests passing (4 new)tests/unit/pm/linear/regression-2026-04.test.ts— 15 tests passing (3 new)tests/unit/pm/linear/integration.test.ts— 33 tests passing (1 updated)biome check) — no issuestsc --noEmit) — no errorsNotes
undefinedfor unconfigured labels.🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details