Skip to content

Fix broken URLs for old GitLab instances #4273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

k-yle
Copy link

@k-yle k-yle commented May 1, 2025

Closes #2162


Description

Since #2022, anyone using an old installation of GitLab can no longer use the View on Remote feature; all URLs produce a 404 since gitlab changed the URL format, and GitLens only supports the new format as of #2022

This PR adds a new option to the gitlens.remote setting, called version. For example:

  "gitlens.remotes": [{ "domain": "example.intranet.net", "type": "GitLab", "version": "17" }],

This field could be reused by other providers in the future, if they need version-specific logic.

For gitlab, if the version is too old, the URLs will not include the /-/ infix

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

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.

copy remote file url
1 participant