Skip to content

Link Probo tasks to existing Linear issues - #1969

Merged
SachaProbo merged 1 commit into
mainfrom
SachaProbo/link-existing-linear-issues
Sep 25, 2026
Merged

SachaProbo merged 1 commit into
mainfrom
SachaProbo/link-existing-linear-issues

Conversation

@SachaProbo

@SachaProbo SachaProbo commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Publishing only created a new Linear issue. Team and issue pickers now search and page on the server, and choosing an existing issue links the Probo task instead. The new-task dialog offers the same choice when Linear Sync is connected. Status and priority menus open in the dialog overlay so they no longer break the layout.

linearTeams and linearIssues return connections so every client pages the same way. The unpaginated team list is gone.


Summary by cubic

Publishing only created a new Linear issue. Team and issue pickers now search and page on the server, and choosing an existing issue links the Probo task instead. The task detail page and new-task dialog offer the same choice when Linear Sync is connected, and status and priority menus open in the dialog overlay so they no longer break the modal layout. linearTeams and linearIssues return connections so every client pages the same way; the unpaginated team list is gone.

Tests +286 -31

  • Updates Linear sync coverage for connection responses and team lookup, replaces the account-merge test, and maps empty or unsupported issue descriptions to a valid empty ProseMirror doc.

GraphQL API +279 -12

  • Adds the linearIssues connection and linkTaskToLinear mutation alongside linearTeams.

MCP +312 -16

  • Exposes the linkTaskToLinear tool alongside the existing publish tool and pages list-linear-teams through the connection.

prb (CLI) +375 -31

  • Adds prb task link-linear and prb task list-linear-issues, makes list-linear-teams search and page, and clarifies publish-linear leaves the task unchanged.

Service +1360 -152

  • Searches teams and issues across Linear connectors, resolves the owning connector per team instead of merging team lists, and maps empty or unsupported issue descriptions to a valid empty ProseMirror doc.

App: console +888 -66

  • Adds searchable, server-paged team and issue pickers with link-or-publish actions and returns the new task id from the create mutation.

Package: n8n-node +351 -13

  • Adds link-to-Linear and list-linear-issues operations and pages results through the connection.

Package: ui +28 -5

  • Routes combobox and select popups through the dialog overlay root so they stay inside the modal.

Written for commit b60356e. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 22 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread pkg/task/sync/service.go Outdated
Comment thread pkg/cmd/task/list-linear-teams/list.go Outdated
Comment thread pkg/server/api/console/v1/linear_connection.go Outdated
Comment thread apps/console/src/pages/organizations/tasks/_components/TaskLinearPublishField.tsx Outdated
Comment thread apps/console/src/pages/organizations/tasks/_locales/en-US.json Outdated
Comment thread pkg/server/api/console/v1/linear_connection.go Outdated
Comment thread pkg/task/sync/linear/client_test.go Outdated
Comment thread packages/n8n-node/nodes/Probo/actions/task/listLinearTeams.operation.ts Outdated
Comment thread pkg/task/sync/service.go
@SachaProbo
SachaProbo force-pushed the SachaProbo/link-existing-linear-issues branch from cec98d2 to 1e8c8de Compare September 24, 2026 12:25
Comment thread packages/ui/src/v2/Combobox/ComboboxPopup.tsx Outdated
Comment thread packages/ui/src/v2/Select/SelectPopup.tsx Outdated
@SachaProbo
SachaProbo force-pushed the SachaProbo/link-existing-linear-issues branch from 1e8c8de to a889566 Compare September 24, 2026 12:38

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 15 files (changes from recent commits).

Requires human review: Auto-approval blocked because this review re-detected 2 unresolved issues already reported by Cubic.
Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread pkg/task/sync/linear/client_test.go Outdated
@SachaProbo
SachaProbo force-pushed the SachaProbo/link-existing-linear-issues branch 3 times, most recently from c7404e5 to 0891696 Compare September 24, 2026 13:39
@SachaProbo
SachaProbo requested a review from a team September 24, 2026 14:32
Comment thread pkg/task/sync/service.go Outdated
Comment on lines +396 to +400
if existingLink != nil && !isLinearPublishPending(existingLink) && existingLink.ExternalID != issue.ID {
if err := s.abandonIncompleteLinearPublish(ctx, accounts, scope, existingLink); err != nil {
return nil, err
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly here, you are abandoning an incomplete publish started earlier to start a new one with a proper state, is that it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Comment thread pkg/task/sync/service.go Outdated
Comment on lines +347 to +371
err := s.pg.WithTx(
ctx,
func(ctx context.Context, tx pg.Tx) error {
task = &coredata.Task{}
if err := task.LoadByID(ctx, tx, scope, taskID); err != nil {
return fmt.Errorf("cannot load task %q: %w", taskID, err)
}

existing := &coredata.TaskExternalLink{}
if err := existing.LoadByTaskID(ctx, tx, scope, taskID); err == nil {
if isLinearPublishComplete(existing) {
return ErrTaskAlreadyLinked
}

existingLink = existing
} else if !errors.Is(err, coredata.ErrResourceNotFound) {
return fmt.Errorf("cannot load task external link: %w", err)
}

return nil
},
)
if err != nil {
return nil, err
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need a transaction here as we are only reading stuff? Or should we expand it to span until later modification we are doing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Changed to a connection.

Comment thread pkg/task/sync/service.go Outdated
Comment on lines +427 to +430
if err := s.claimPendingLinearPublish(ctx, scope, task, account.connector, destination); err != nil {
return nil, err
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may miss something but it looks like you are claiming the line for update too far after reseting its state therefore we can be expose to a "dirty" state started by another query, can we?

@lukkor lukkor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may have missed some mechanism protecting the service here but I feel like we can be expose to incomplete/inconsistent state via concurrency.

@SachaProbo
SachaProbo force-pushed the SachaProbo/link-existing-linear-issues branch 2 times, most recently from 1e384c1 to 90bb1c5 Compare September 24, 2026 15:25
@SachaProbo

Copy link
Copy Markdown
Contributor Author

I may have missed some mechanism protecting the service here but I feel like we can be expose to incomplete/inconsistent state via concurrency.

The PR now lock the link row and commit the decision before creating or archiving in Linear.

@SachaProbo
SachaProbo force-pushed the SachaProbo/link-existing-linear-issues branch 5 times, most recently from 9560132 to 8c2ae58 Compare September 24, 2026 21:58

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 11 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread pkg/task/sync/service.go Outdated
Comment thread apps/console/src/pages/organizations/tasks/_components/CreateTaskDialog.tsx Outdated
Comment thread pkg/task/sync/service.go Outdated
@SachaProbo
SachaProbo force-pushed the SachaProbo/link-existing-linear-issues branch from 8c2ae58 to e7ec74d Compare September 24, 2026 22:10

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 12 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread pkg/server/api/mcp/v1/specification.yaml
Comment thread pkg/cmd/task/publish-linear/publish.go Outdated
@SachaProbo
SachaProbo force-pushed the SachaProbo/link-existing-linear-issues branch from e7ec74d to 6be2c9b Compare September 24, 2026 22:31

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 8 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread pkg/cmd/task/list-linear-teams/list.go
Comment thread pkg/server/api/mcp/v1/schema.resolvers.go
@SachaProbo
SachaProbo force-pushed the SachaProbo/link-existing-linear-issues branch from 6be2c9b to a496910 Compare September 24, 2026 22:42

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

@SachaProbo
SachaProbo force-pushed the SachaProbo/link-existing-linear-issues branch 2 times, most recently from e589daf to d60b470 Compare September 24, 2026 22:59
@SachaProbo
SachaProbo force-pushed the SachaProbo/link-existing-linear-issues branch from d60b470 to 44089c7 Compare September 24, 2026 23:08

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread pkg/task/sync/service.go
@SachaProbo
SachaProbo force-pushed the SachaProbo/link-existing-linear-issues branch 4 times, most recently from 72e3a68 to 44b2554 Compare September 25, 2026 07:21

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread apps/console/src/pages/organizations/tasks/variants.ts Outdated
@SachaProbo
SachaProbo force-pushed the SachaProbo/link-existing-linear-issues branch 4 times, most recently from 5029099 to 2908795 Compare September 25, 2026 08:15

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread apps/console/src/pages/organizations/tasks/variants.ts Outdated
@SachaProbo
SachaProbo force-pushed the SachaProbo/link-existing-linear-issues branch from 2908795 to cc7d153 Compare September 25, 2026 08:19
Publishing only created a new Linear issue. Team and issue pickers now
search and page on the server, and choosing an existing issue links the
Probo task instead. The new-task dialog offers the same choice when
Linear Sync is connected. Status and priority menus open in the dialog
overlay so they no longer break the layout.

linearTeams and linearIssues return connections so every client pages
the same way. The unpaginated team list is gone.

Signed-off-by: Sacha Al Himdani <sacha@probo.com>
@SachaProbo
SachaProbo force-pushed the SachaProbo/link-existing-linear-issues branch from cc7d153 to b60356e Compare September 25, 2026 08:29
@SachaProbo
SachaProbo merged commit b60356e into main Sep 25, 2026
18 checks passed
@SachaProbo
SachaProbo deleted the SachaProbo/link-existing-linear-issues branch September 25, 2026 08:42
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.

2 participants