Page MenuHomePhabricator

Add more redirection url patterns for gerrit urls

Authored by mmodell on Dec 1 2015, 5:24 PM.
Referenced Files
Unknown Object (File)
Wed, Jun 29, 8:59 AM
Unknown Object (File)
Sun, Jun 26, 9:16 PM
Unknown Object (File)
Sat, Jun 18, 1:23 PM
Unknown Object (File)
Apr 12 2017, 7:10 AM
Unknown Object (File)
Feb 22 2017, 8:35 PM
Unknown Object (File)
Feb 17 2017, 1:39 AM
Unknown Object (File)
Feb 7 2017, 10:28 PM
Unknown Object (File)
Dec 4 2016, 11:40 PM


Maniphest Tasks
T110607: redirect gerrit repo paths to diffusion callsigns
rPHEXd724c51a4144: Add more redirection url patterns for gerrit urls
Patch without arc
git checkout -b D68 && curl -L | git apply

This corresponds to the following gerrit configuration:

    url =
    type = custom
    project = /r/project/${project}
    revision = /r/revision/${project};${commit}
    branch = /r/branch/${project};${branch}
    filehistory = /r/browse/${project};${branch};${file}
    linkname = gitblit
    linkDrafts = false
Test Plan

Test on

Browse gerrit project, redirects to callsign:

Browse a file .gitreview in project mediawiki/core on the REL1_19 branch:

Browse history for mediawiki/core branch REL1_19:

Browse to a specific commit:

Diff Detail

rPHEX phabricator-extensions
Lint Not Applicable
Tests Not Applicable

Event Timeline

mmodell retitled this revision from to Add more redirection url patterns for gerrit urls.
mmodell updated this object.
mmodell edited the test plan for this revision. (Show Details)
mmodell added a reviewer: demon.

Couple of minor inline bits but otherwise ok.


sha1s are only [0-9a-f]+ if we want to be strict about it.


[nitpick] array_fill_keys() does exactly what you want here.

mmodell edited edge metadata.

commits didn't match the right regex. All the patterns should work now.

mmodell marked an inline comment as done.

use array_fill_keys()

mmodell added inline comments.

It doesn't need to be terribly strict. I just copied the pattern that was used in the diffusion application routes, for consistency.

@demon: I believe I have addressed your concerns. Land it?

demon edited edge metadata.
This revision is now accepted and ready to land.Dec 1 2015, 6:02 PM
This revision was automatically updated to reflect the committed changes.
Paladox added inline comments.

Does not work the url looks like in gerrit,branches it doesn't show the correct link for example it should look like and then it should redirect to the correct link.


Same goes for commit and revision and file history.