Page MenuHomePhabricator

Add support for downloading branches, commit's and tags from diffusion gui
AbandonedPublic

Authored by Paladox on May 13 2016, 9:38 PM.

Details

Reviewers
mmodell
demon
Luke081515
greg
Patch without arc
git checkout -b D233 && curl -L https://phabricator.wikimedia.org/D233?download=true | git apply
Summary

This adds support for downloading from our github mirror.

The two formats supported by downloading are zip and gz (.tar.gz).

This will require all repos to have the same name as the mirror repo
otherwise downloading from the branch will not work.

Change-Id: Ifad2292404202ef3180f28cfdf690d423429dfc3

Diff Detail

Repository
rPHAB Phabricator
Branch
wmf/stable
Lint
Lint SkippedExcuse: Same as before
Unit
Unit Tests Skipped
Build Status
Buildable 517
Build 776: arc lint + arc unit

Event Timeline

Paladox updated this revision to Diff 647.May 13 2016, 9:38 PM
Paladox retitled this revision from to Add support for downloading branches from diffusion gui.
Paladox updated this object.
Paladox edited the test plan for this revision. (Show Details)
Paladox updated this revision to Diff 648.May 14 2016, 1:47 PM

Added support for downloading commits and tags.

Note not all commit's or branches or tags will be able to be downloaded if they are not on the github mirror.

Notably until we switch to phabricator mirroring the repos open patches will not be able to be downloaded from the mirrors due to gerrit not supporting that.

Paladox updated this revision to Diff 649.May 14 2016, 2:59 PM

Adds the download zip and gz button to commit so when viewing a commit and looking at diff it now shows the download button on the right. It downloads from our github mirror.

Paladox retitled this revision from Add support for downloading branches from diffusion gui to Add support for downloading branches, commit's and tags from diffusion gui.May 14 2016, 3:02 PM
Paladox updated this object.
Luke081515 accepted this revision.May 14 2016, 9:20 PM
Luke081515 edited edge metadata.

Looks good for me, and worked at a test enviourment.

This revision is now accepted and ready to land.May 14 2016, 9:20 PM
mmodell edited edge metadata.May 16 2016, 4:17 PM

Talked to @demon about this on the Release-Engineering-Team team meeting today. His opinion, and I agree completely, is that we should hold off on this until we have repositories replicating from diffusion to github, then we can use the github url that is configured in phabricator to make sure that the link to download is actually pointing to the right URL rather than depending on $repository->getName() which might not always match.

mmodell added a comment.EditedMay 16 2016, 4:20 PM

More specifically, we can use the conduit method diffusion.uri.edit as documented here and here

Paladox added a comment.EditedMay 16 2016, 5:12 PM
In D233#4824, @mmodell wrote:

More specifically, we can use the conduit method diffusion.uri.edit as documented here and here

@mmodell But if the repo is git@github.com and not https://github.com then it wont work.

Do you know how we can get the mirror url from GitHub. Not sure what code to do that. I was thinking that but then I didn't know which code does that and if the url is like git@github that wont work unless your in a git client.

demon edited edge metadata.May 16 2016, 5:18 PM
In D233#4825, @Paladox wrote:
In D233#4824, @mmodell wrote:

More specifically, we can use the conduit method diffusion.uri.edit as documented here and here

@mmodell But if the repo is git@github.com and not https://github.com then it wont work.

Why would we replicate over SSH?

Paladox added a comment.EditedMay 16 2016, 5:33 PM
In D233#4827, @demon wrote:
In D233#4825, @Paladox wrote:
In D233#4824, @mmodell wrote:

More specifically, we can use the conduit method diffusion.uri.edit as documented here and here

@mmodell But if the repo is git@github.com and not https://github.com then it wont work.

Why would we replicate over SSH?

@demon We woulden't replicate over ssh for download's unless I'm wrong I thaught it would be easy to just use GitHub links for the download instead of building a back-end for downloads in diffusion.

@demon looking at https://phabricator.wikimedia.org/diffusion/MW/manage/uris/ it shows we are using https not ssh. @mmodell is there code we can use to detect a mirror ui please.

Paladox abandoned this revision.May 19 2016, 9:48 PM

This patch https://phabricator.wikimedia.org/D234 is the better one. :)