Repository navigation
Closed
Description
Summary
When a workspace is on a long-lived branch such as develop and there are no open MRs from that branch, Orca's GitLab hosted-review lookup picks the most recently updated MR for the branch regardless of its state. The workspace card and the review detail pane then show an old, already-merged MR (with its old pipeline and checks) instead of showing no review.
GitHub behaves differently: the branch lookup only considers open PRs unless an explicit linked/fallback PR number is supplied.
What happened?
- Workspace branch:
develop(repository default branch ismain) - There are no open MRs whose source branch is
develop - The last MR ever opened from
developis old and already merged - Orca shows that MR's title,
MERGEDstate, its last-updated timestamp and its old pipeline/check list on the workspace card and in the review pane - It is not a stale local link:
orca worktree showreportslinkedGitLabMR: nullandlinkedItems: [], the profile state contains no reference to that MR, and clearing/unlinking does not change the display. The value is recomputed from the current branch on every refresh.
How to reproduce
- On a self-hosted GitLab repository, merge an MR whose source branch is a long-lived branch (e.g.
develop), then never open another MR from that branch. - Check out that long-lived branch in an Orca workspace.
- Focus the workspace. Orca auto-attaches the most recent MR from that branch even though it is merged, and shows that MR's title, merged state and old pipeline on the card and in the review pane.
Root cause (Orca 1.4.253)
- In
orcad-server.js, the GitLab hosted-review provider'sgetReviewForBranchcallss7a(), which issues:
GET projects/:id/merge_requests?source_branch=<branch>&order_by=updated_at&sort=desc&per_page=1&with_merge_status_recheck=true
There is nostateparameter, so GitLab returns merged/closed MRs too (its default is all states). - The only merged/closed suppression is
hz(), which hides such an MR only when the worktree branch equals the repository's default branch (resolved fromrefs/remotes/origin/HEAD). For a long-lived branch that is not the default branch, the stale merged MR is kept.
Suggested fix
- Add
state=openedto the GitLab branch lookup, aligning it with the GitHub path. Merged reviews should only appear when an explicit linked/fallback MR number is supplied (or via a linked work item). - Alternatively, extend
hz()so merged/closed MRs are not auto-attached to long-lived branches in general.
Environment
- Orca 1.4.253 (latest release at filing)
- macOS
- Self-hosted GitLab,
glabauthenticated
Metadata
Metadata
Assignees
Labels
No labels
Activity
mahedi-emon commentedon Nov 7, 2026
I traced this in src/main/gitlab/merge-request-lookup.ts. Besides the merged-MR case, per_page=1 sorted by updated_at also lets a newer closed/merged MR hide an open one on the same branch. Rather than state=opened (which would also hide a feature branch’s just-merged MR), I matched the GitHub rule: prefer an open MR, and keep a merged branch match only while the worktree HEAD equals that MR’s head. Opening a PR with tests.