Skip to content
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

Fixes #2021 - Use scoped routes for GitLab URLs #2022

Merged
merged 1 commit into from
Jun 9, 2022

Conversation

Brcrwilliams
Copy link
Contributor

@Brcrwilliams Brcrwilliams commented Jun 2, 2022

Description

Refs #2021

GitLens uses legacy project routes for GitLab:

  • ${projectURL}/branches
  • ${projectURL}/tree/${branch}
  • ${projectURL}/commit/${sha}
  • ${projectURL}/compare/${base}${notation}${compare}
  • ${projectURL}/blob/${ref}/${fileName}

These routes are all deprecated and scheduled for removal. See these references:

This change replaces them with the following scoped routes:

  • ${projectURL}/-/branches
  • ${projectURL}/-/tree/${branch}
  • ${projectURL}/-/commit/${sha}
  • ${projectURL}/-/compare/${base}${notation}${compare}
  • ${projectURL}/-/blob/${ref}/${fileName}

Examples:

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
  • 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

GitLens uses legacy project routes for GitLab:

- `${projectURL}/branches`
- `${projectURL}/tree/${branch}`
- `${projectURL}/commit/${sha}`
- `${projectURL}/compare/${base}${notation}${compare}`
- `${projectURL}/blob/${ref}/${fileName}`

These routes are all deprecated and scheduled for removal. See these references:

- https://docs.gitlab.com/ee/development/routing.html#project-routes
- https://gitlab.com/gitlab-org/gitlab/-/issues/118849
- https://gitlab.com/gitlab-org/gitlab/-/issues/28848

This change replaces them with the following scoped routes:

- `${projectURL}/-/branches`
- `${projectURL}/-/tree/${branch}`
- `${projectURL}/-/commit/${sha}`
- `${projectURL}/-/compare/${base}${notation}${compare}`
- `${projectURL}/-/blob/${ref}/${fileName}`
@Brcrwilliams
Copy link
Contributor Author

@eamodio Could you please take a look at this PR when you have the time?

@eamodio
Copy link
Member

eamodio commented Jun 7, 2022

@Brcrwilliams Changes look great! Thank you. One question I have is will this cause issues for any current users? Or will the addition of /-/ to the route work fine for all users?

@eamodio eamodio added this to the 12.1 milestone Jun 7, 2022
@eamodio eamodio self-assigned this Jun 9, 2022
@eamodio eamodio merged commit 8323ae4 into gitkraken:main Jun 9, 2022
@eamodio
Copy link
Member

eamodio commented Jun 9, 2022

Thank you so much for your contribution!

Thank you!

@Brcrwilliams
Copy link
Contributor Author

@eamodio Thank you for merging!

Regarding your question:

One question I have is will this cause issues for any current users? Or will the addition of /-/ to the route work fine for all users?

These routes are available to all users and were added many years ago. It may not work for people who are using self-hosted GitLab instances that are on a very old version, but a GitLab instance which is that old will be affected by several critical security vulnerabilities. So, I would say that those users have bigger things to worry about than their links not working.

@eamodio eamodio mentioned this pull request Aug 28, 2022
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.

None yet

2 participants