Problem/Motivation

The 'view open merge request' button on the 'compare revisions' gitlab page has an incorrectly derived url, which leads to a 404.

Steps to reproduce

Visit a repository page for an issue fork
issue fork page

The 'view merge request' button has the correct url project/gitlab_templates_downstream/-/merge_requests/66 to get to the MR
mr url is ok

But on the 'compare revisions' page for the same MR, the 'view open merge request' button url is incorrect.
compare revisions

It has the issue fork part issue/gitlab_templates_downstream-3571809 instead of the canonical project part project/gitlab_templates_downstream and so
issue/gitlab_templates_downstream-3571809/-/merge_requests/66 results in a 404.
url gives 404

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

Issue summary: View changes

This issue was raised in response to the request in this slack thread

jonathan1055’s picture

On the slack thread, @hestenet said "... describe the pattern"

Do you mean that you can do dynamic redirects, and you'd like me to work out the regex pattern and replacement. Yes I can try to do that, if that is what you meant.

drumm’s picture

While we can do some redirects before requests hit GitLab, we don’t really want to get into the business of trying to work around GitLab.

I don’t see the link at https://git.drupalcode.org/issue/gitlab_templates_downstream-3571809/-/c... right now, so maybe this was in an internal GitLab cache, or is it still reproducible for you? Or I could be missing something in the steps to reproduce.

jonathan1055’s picture

StatusFileSize
new1016.21 KB

Thanks for the reply. Since opening this issue, that open MR has now been merged, so that must be why the button has changed. I also do not get the 'view open merge request' but instead I get 'create merge request'.

Here is the equivalent page for a MR which will not be merged just yet. It is reached via the 'compare revisions' menu item from the issue fork repository page.

The link behind the button is https://git.drupalcode.org/issue/gitlab_templates_downstream-3506685/-/m... which gives a 404

Instead of issue/gitlab_templates_downstream-3506685 it should be project/gitlab_templates_downstream https://git.drupalcode.org/project/gitlab_templates_downstream/-/merge_r... which gets to the MR correctly

drumm’s picture

Since this is an upstream GitLab issue, it is best to find or make an issue for GitLab itself.

I’m not spotting an existing issue at https://gitlab.com/search?group_id=9970&project_id=278964&scope=work_ite...

If you’re filing a new issue, it is best to avoid Drupal terminology, “issue forks” are just forks for them. The best thing to have is reproducing the issue on GitLab.com itself; that also shows that it has not already been fixed upstream.

We are not on the latest version of GitLab at the moment, 18.9 instead of 18.10. That upgrade will likely happen next week.