vscode-gitlens icon indicating copy to clipboard operation
vscode-gitlens copied to clipboard

Wrong pull request URL detect when use sub-group in GitLab Self-Managed

Open trduclong opened this issue 1 year ago • 2 comments

Description

I have a repository with url like: https://my.company.com/parents-group/sub-group/project-name.git

I already link personal access token in gitlens. But in merge request show in autolink, URL ignore parent-group, only detect sup-group and project-name

example I have merge request !1 right url: https://my.company.com/parents-group/sub-group/project-name/-/merge_requests/1 actual url: https://my.company.com/sub-group/project-name/-/merge_requests/1

Is this a bug ? I don't know. If anyone know a workaround to fix this, please tell me. thanks.

GitLens Version

14.8.2

VS Code Version

Version 1.87

Git Version

No response

Logs, Screenshots, Screen Captures, etc

No response

trduclong avatar Mar 01 '24 02:03 trduclong

having the same problem, currently I used a workaround to replace all "/-/" in the js file for the plugin, would be better if the url is customizable.

OscarXvita avatar Apr 15 '24 03:04 OscarXvita

As a work-around I add the following to each of my project's .vscode/settings.json. It is a pain to do it for every repo, but at least it "fixes" the autolink and does not require maintaining a fork of gitlens.

"gitlens.autolinks": [
    {
        "url": "https://my.company.com/parents-group/sub-group/project-name/-/merge_requests/<num>",
        "prefix": "merge request parents-group/sub-group/project-name!"
    }
]

Replace the prefix value with whatever line your gitlab adds to the merge commit it creates for accepted merge requests identifying said merge request.

Strongbeard avatar Jun 19 '24 17:06 Strongbeard

@Strongbeard's workaround is actually a feature of its own: now, the merge commit details (shown upon hovering the cursor over the in-line blame) have the merge request reference turned into a link. I'm keeping it indefinitely, thanks. :)

pawelszramowski avatar Jan 20 '25 15:01 pawelszramowski