Page MenuHomePhabricator

Gitiles edit link points to an invalid URL
Open, LowPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

The link points to https://gerrit.wikimedia.org/admin/repos/edit/repo/mediawiki/core/branch/refs/heads/master/file/FAQ, which returns a 404 Not Found error.

What should have happened instead?:

The link should either not exist or point to a valid URL.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

image.png (154×997 px, 20 KB)

Event Timeline

The link is missing the /r prefix in the path. The [edit] was introduced by https://gerrit-review.googlesource.com/c/gitiles/+/392465 (released in gitiles 1.5.0). It is implemented differently from the other urls.

The base URL is set by the Gerrit Gitiles plugins to https://gerrit.wikimedia.org/r which includes the /r path prefix. However the code appends /admin... which is an absolute path, and that causes URI.resolve() to drop the prefix:

jshell> new URI("https://example.org/r").resolve("/admin/repos/edit");
                                    ^^
$2 ==> https://example.org/admin/repos/edit
                         ^^^____oops
hashar triaged this task as Low priority.