Skip to content

fix(gitlab): route task issues, MRs, and detail actions to the owning host - #14604

Closed
de1mat wants to merge 2 commits into
stablyai:mainfrom
de1mat:fix/gitlab-tasks-remote-host-routing
Closed

de1mat wants to merge 2 commits into
stablyai:mainfrom
de1mat:fix/gitlab-tasks-remote-host-routing

Conversation

@de1mat

@de1mat de1mat commented Aug 14, 2026 •

Copy link
Copy Markdown

ELI5

When you run Orca on one machine and connect to your projects living on another (a remote server), the GitLab Tasks panel talked to the wrong machine. It asked your local machine about repos that only exist on the server, so it got "Access denied: unknown repository path" and showed nothing. This teaches every GitLab task call to ask the machine that actually owns the repo.

What Changed

A new routing layer (routedGitLab) decides, per repo, whether a GitLab call runs locally or relays to the runtime host that owns the repo, then wires the GitLab Tasks surface through it:

  • Tasks list - issues, MRs, and todos.
  • Item dialog - details, conversation/comments, merge / close / reopen, labels, reviewers, and CI job logs.
  • Right-sidebar MR actions - merge / close / reopen for a checked-out MR.

Routing keys off the repo's own execution host (not the active-server dropdown), and the host method names mirror the ones Orca's web client already uses, so no new host RPC surface is introduced. Already-routed call sites (checks panel, URL picker, job-log details) are left unchanged.

Why

Every GitLab handler in the main process runs assertRegisteredRepo, which rejects any path not registered in that machine's own repo store. A repo owned by a remote runtime host only exists in the host's store, so the local call always failed on the client. GitHub's task surface already routes remote-owned repos to their host over RPC; GitLab did not. This closes that gap the same way, and the contributor guide's own rule applies directly: "do not assume a process, file, credential, shell, or network path exists only on the local machine."

Linked Issue

Fixes #14603

Visual Proof

image

Now the lists of Issues and MRs works great...

Orca

And if you click on an Issue or MR everything loads as expected...

Orca

Testing

Verified against a real two-machine setup: a MacBook Air client connected to a MacBook Pro runtime host serving self-hosted GitLab. The Issues/MRs list and the item detail dialog both load and act against the host instead of erroring.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

New unit tests cover local-vs-remote transport selection for each routed method (src/renderer/src/runtime/gitlab-runtime-routing.test.ts). pnpm lint and pnpm typecheck pass, and the tests around the touched areas (Tasks, right-sidebar, the new module) pass. The full local pnpm test has some pre-existing failures in unrelated areas (clipboard IPC, CLI orchestration, git porcelain/symlinks, codex) that also fail on a clean checkout with these changes stashed, so they are environmental and not introduced here; CI is the authority.

AI Disclosure

Written with Claude Code (Claude Opus 4.8). The diff was then reviewed by three code-review agents - Claude, Codex (gpt-5.5), and Grok - and the author reviewed the result. The one substantive finding (Claude and Codex both caught it independently): the remote CI job-log path could exceed the runtime RPC frame cap; fixed by bounding the trace host-side via logExcerpt, matching the existing checks-panel behaviour.

Review

  • Security: no change to the auth/registration boundary; the local path still runs assertRegisteredRepo, and remote calls relay over the existing authenticated runtime channel.
  • Cross-platform: pure renderer routing logic, no platform-specific paths or shortcuts.
  • Remote/SSH: the point of the change - routes runtime-host-owned repos correctly; local and SSH-backed repos keep the local IPC path.
  • Wire compatibility: the client calls the same gitlab.* host methods the web client already calls, so no new host surface; an older host lacking a method degrades to an error banner, not a crash.
  • Mobile: unaffected (mobile already routes GitLab via the runtime RPC).
  • Performance: one host lookup per call; no added work on the local path.
  • Known limitation: on a runtime-owned GitLab repo the reviewer-assignment picker is empty - there is no gitlab.listAssignableUsers host RPC, and the web client behaves the same way. Existing reviewers still render; adding new ones on a remote repo would need a new host method (worth a follow-up, not in scope here).

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint and pnpm typecheck pass; touched-area tests pass; full pnpm test has only pre-existing unrelated failures (verified on clean checkout); pnpm build deferred to CI (renderer-only change)

Author

@coderabbitai

coderabbitai Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: c8a739f3-ca13-4fa4-af4e-88eb1aafd949

📥 Commits

Reviewing files that changed from the base of the PR and between ba7f05b430590ee687db8c9e03289d32ac4293d7 and 378699a.

📒 Files selected for processing (9)
  • src/renderer/src/components/gitlab-item-dialog/use-gitlab-details-editing.ts
  • src/renderer/src/components/gitlab-item-dialog/use-gitlab-item-dialog-effects.ts
  • src/renderer/src/components/gitlab-item-dialog/use-gitlab-pipeline-actions.ts
  • src/renderer/src/components/gitlab-item-dialog/use-gitlab-primary-actions.ts
  • src/renderer/src/components/gitlab-item-dialog/use-gitlab-review-actions.ts
  • src/renderer/src/components/right-sidebar/use-hosted-review-actions.test.tsx
  • src/renderer/src/components/right-sidebar/use-hosted-review-actions.ts
  • src/renderer/src/components/use-task-page-gitlab-loading.ts
  • src/renderer/src/runtime/gitlab-runtime-routing.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The change adds a GitLab runtime-routing module that selects local IPC or remote environment RPC, preserves repository selectors, maps GitLab methods, and applies request timeouts. GitLab task loading, dialogs, pipeline actions, review actions, and hosted review actions now use routed operations. Tests cover target selection, payload transformation, transport behavior, state mappings, and hosted review routing.

Priority: ⬆️ High

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 37869

No actionable merge-blocking issue remains in the routed GitLab operations.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Issue #14603 requires GitLab task operations for remote repositories to run on the owning runtime host, including reviewer operations. The new routing layer routes updateMRReviewers, but `routedGitL… Add a host RPC or equivalent owning-host implementation for listAssignableUsers. Route remote reviewer loading through it and add a test that verifies the remote transport and returned users.
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 12 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: routing GitLab task issues, merge requests, and detail actions to the owning host.
Description check ✅ Passed The description is complete and relevant. It covers the problem, implementation, rationale, linked issue, visual proof, testing, AI disclosure, review considerations, limitations, and checklist. The r…
Out of Scope Changes check ✅ Passed The changes stay within issue #14603. They add GitLab runtime routing, update the affected task and merge-request call sites, and add transport tests. No unrelated product behavior is changed.
Full details: Linked Issues check

Explanation

Issue #14603 requires GitLab task operations for remote repositories to run on the owning runtime host, including reviewer operations. The new routing layer routes updateMRReviewers, but routedGitLab.listAssignableUsers returns [] for remote repositories and makes no host RPC. Remote reviewer loading therefore remains incomplete.

  • Fix all pre-merge checks with AI

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5802e2d8-57c4-4eec-b5aa-b2708c87a296

📥 Commits

Reviewing files that changed from the base of the PR and between 9bb8836 and 3413e68c3979b5e1c53cdee0be52805e320b7331.

📒 Files selected for processing (6)
  • src/renderer/src/components/GitLabItemDialog.tsx
  • src/renderer/src/components/TaskPage.tsx
  • src/renderer/src/components/right-sidebar/use-hosted-review-actions.test.tsx
  • src/renderer/src/components/right-sidebar/use-hosted-review-actions.ts
  • src/renderer/src/runtime/gitlab-runtime-routing.test.ts
  • src/renderer/src/runtime/gitlab-runtime-routing.ts

@de1mat

de1mat commented Aug 21, 2026

Copy link
Copy Markdown
Author

Anything I can do to help get this landed?

@watermeko

Copy link
Copy Markdown

This is a super critical and urgent fix. Hoping it gets merged soon.

@jhartum

jhartum commented Sep 8, 2026

Copy link
Copy Markdown

This is a super critical and urgent fix. Hoping it gets merged soon.

Same!

@dzhiriki

dzhiriki commented Sep 8, 2026

Copy link
Copy Markdown

With the number of issues & PR here, I am worried that it is going to take a lot of time to see some fixes merged… But maybe additional comments will help.

So I am going to add that it is something that I also need.

@de1mat

de1mat commented Sep 8, 2026

Copy link
Copy Markdown
Author

I think adding comments and upvotes on the linked issue itself could help #14603

… host

GitLab task operations hit the local IPC handler unconditionally, so a repo
owned by a remote runtime host was rejected with "Access denied: unknown
repository path" - the list, the item dialog, and the MR review actions all
failed on a client machine while working on the host itself.

Add a shared routing client that relays each GitLab call to the repo's owning
runtime host over RPC, mirroring the GitHub work-item routing, and falls back
to local IPC for local repos. Wire the Tasks list/todos, the item dialog, and
the right-sidebar MR actions through it. Already-routed call sites are unchanged.
The routed local branch ran window.api.gl.* with no timeout, so a hung glab
call on an unreachable GitLab host could spin the UI forever. Wrap the local
branch the way callRuntimeRpc bounds the remote one (30s), matching the sibling
job-trace client's withJobTraceTimeout.
@de1mat
de1mat force-pushed the fix/gitlab-tasks-remote-host-routing branch from ba7f05b to 378699a Compare September 11, 2026 14:27
@de1mat

de1mat commented Sep 11, 2026

Copy link
Copy Markdown
Author

Rebased onto current main - it had drifted about a month behind - so it's mergeable again with no conflicts.

For reviewers: upstream refactors since the original commits moved all the code this touches. TaskPage was folded into the provider-grouped task tree and GitLabItemDialog was split into the gitlab-item-dialog hooks, so the routing changes now live in use-task-page-gitlab-loading.ts and those hooks rather than the original files. The diff won't line up with the earlier review, but the behaviour is unchanged. I also tidied the router to resolve the owning host through the shared getActiveRuntimeTarget/getTaskSourceRuntimeSettings helper the GitHub work-item surface already uses, instead of a separate copy. The local-IPC timeout from the earlier review is preserved.

One deliberate limitation on remote repos: the reviewer picker comes back empty because the host exposes no assignable-users RPC, matching how the web and mobile clients already behave. Assigning reviewers through the existing control still works; adding that host RPC is a sensible follow-up.

I re-tested on a real setup - a client connected to a separate runtime host with GitLab projects - and the Tasks list, item dialog, and MR actions all work against a remote-owned repo, which was the original "Access denied" failure.

@de1mat

de1mat commented Sep 12, 2026

Copy link
Copy Markdown
Author

@nwparker would you have a moment to look at this one when you get a chance? It's rebased onto current main and passing, and a few people have been waiting on it - GitLab Tasks error out entirely on remote hosts without it. Happy to walk through anything or make changes.

@nileio

nileio commented Sep 27, 2026

Copy link
Copy Markdown

Thanks we facing this same issue and would be great to see this merged..

@doongkc

doongkc commented Oct 13, 2026

Copy link
Copy Markdown

Same issue here in v1.4.224, please merge this fix.
That impact to my workflows when do everything on remote server

@nwparker

nwparker commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded — the linked issue (#14603) has been resolved on main by #26340 (0ca8ae16d7), #26483 (e3639ef8d6), #27247 (3e7ab3f5a1). Thanks for the contribution!

@nwparker nwparker closed this Nov 5, 2026
@de1mat

de1mat commented Nov 6, 2026

Copy link
Copy Markdown
Author

Thanks for the contribution!

Nice, thanks for getting that fixed! I will try another PR in the future, keen to contribute. Orca is my workhorse all day every day 💪

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.

[Bug]: GitLab Tasks fail with "Access denied: unknown repository path" for repos on a remote host

9 participants