Page MenuHomePhabricator

Redirect gerrit repo URIs to diffusion callsigns.
ClosedPublic

Authored by mmodell on Nov 16 2015, 10:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Aug 15, 11:17 PM
Unknown Object (File)
Apr 25 2017, 2:41 AM
Unknown Object (File)
Apr 12 2017, 11:42 AM
Unknown Object (File)
Feb 14 2017, 12:50 PM
Unknown Object (File)
Oct 24 2016, 9:53 PM
Unknown Object (File)
Oct 3 2016, 10:07 AM
Unknown Object (File)
Aug 26 2016, 5:15 AM
Unknown Object (File)
Aug 26 2016, 12:56 AM
Subscribers

Details

Maniphest Tasks
T110607: redirect gerrit repo paths to diffusion callsigns
Reviewers
chasemp
demon
Commits
rPHEX34e5e748c6af: Redirect gerrit repo URIs to diffusion callsigns.
Patch without arc
git checkout -b D51 && curl -L https://phabricator.wikimedia.org/D51?download=true | git apply
Summary

Redirect from gerrit project URI path, e.g.:

From:

https://phabricator.wikimedia.org/r/phabricator/extensions/

To:

https://phabricator.wikimedia.org/diffusion/PHEX/

This allows external tools to link to repos without knowing their callsign.

Test Plan

install extension files in /srv/phab/phabricator/src/extensions
Then attempt to visit a url like the one above.

Diff Detail

Repository
rPHEX phabricator-extensions
Branch
GerritProjectRedirect
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 197
Build 249: arc lint + arc unit

Event Timeline

mmodell retitled this revision from to Redirect gerrit repo URIs to diffusion callsigns..
mmodell updated this object.
mmodell edited the test plan for this revision. (Show Details)
mmodell added reviewers: demon, chasemp.

What about also allowing the link to look like

https://phabricator.wikimedia.org/r/mediawiki/extensions/

And

https://phabricator.wikimedia.org/mediawiki/extensions/

And so on

Looking at the diff I think this is for the url to look like gerrit. I think for viewing the repos should look like this too redirecting links

In D51#1252, @Paladox wrote:

What about also allowing the link to look like

https://phabricator.wikimedia.org/r/mediawiki/extensions/

Mukunda will have to answer for this one, I wouldn't mind using /r/ for repo paths, but I'll let him answer.

And

https://phabricator.wikimedia.org/mediawiki/extensions/

And so on

No, we don't want to overload the domain root to potentially conflict with future Phabricator applications.

Looking at the diff I think this is for the url to look like gerrit. I think for viewing the repos should look like this too redirecting links

No, the URLs aren't meant to look like Gerrit. They're meant to just exist as URLs with similar foo/bar/baz repo paths so we can redirect old Gitblit/Gerrit URLs to Phabricator properly. They're not meant to be used as links or accessed directly, really, so there's no requirement for them to be pretty or memorable.

Lgtm, can we test it out on iridium? Just wanna see it in action before accepting.

@demon I just set it up on phab-01: https://phab-01.wmflabs.org/r/phabricator/phabricator

(none of the other repos will redirect to a working repo, since the others aren't set up on phab-01, but they should all redirect to the correct callsign url)

demon requested changes to this revision.Nov 17 2015, 8:20 PM
demon edited edge metadata.

Per IRC, we need to make sure we support at least the URL patterns outlined in:

1[gitweb]
2 url = https://git.wikimedia.org
3 type = custom
4 revision = /commit/${project}/${commit}
5 project = /summary/${project}
6 branch = /log/${project}/${branch}
7 filehistory = /blob/${project}/${branch}/${file}
8 linkname = gitblit
9 linkDrafts = false

This revision now requires changes to proceed.Nov 17 2015, 8:20 PM
In D51#1278, @demon wrote:

Per IRC, we need to make sure we support at least the URL patterns outlined in:

1[gitweb]
2 url = https://git.wikimedia.org
3 type = custom
4 revision = /commit/${project}/${commit}
5 project = /summary/${project}
6 branch = /log/${project}/${branch}
7 filehistory = /blob/${project}/${branch}/${file}
8 linkname = gitblit
9 linkDrafts = false

Can those patterns be changed to pass query parameters? it'd be cleaner to parse the urls if project was delimited by something other than a slash, since it has slashes in the project path.

Example:

[gitweb]
    url = https://git.wikimedia.org
    type = custom
    revision = /r/commit/${commit}?project=${project}
    project = /r/${project}
    branch = /r/browse/${branch}?project=${project}
    filehistory = /r/browse/${branch}/${file}?project=${project}
    linkname = gitblit
    linkDrafts = false
demon edited edge metadata.

Per discussion earlier, this is fine as is. We'll implement the other requirements as patches on top of this instead of waiting.

This revision is now accepted and ready to land.Nov 23 2015, 11:02 PM