Page MenuHomePhabricator

Support commits in /r/branch url query
AbandonedPublic

Authored by Paladox on Jul 29 2016, 5:38 PM.
Referenced Files
Unknown Object (File)
Apr 7 2023, 3:46 PM
Unknown Object (File)
Mar 12 2023, 11:51 PM
Unknown Object (File)
Mar 2 2023, 3:21 PM
Unknown Object (File)
Mar 1 2023, 3:59 PM
Unknown Object (File)
Mar 1 2023, 3:59 PM
Unknown Object (File)
Feb 27 2023, 10:22 AM
Unknown Object (File)
Feb 22 2023, 2:09 PM
Unknown Object (File)
Feb 21 2023, 5:11 PM
Subscribers

Details

Maniphest Tasks
T137354: Unable to browse refs/meta/config in Diffusion
Reviewers
None
Patch without arc
git checkout -b D300 && curl -L https://phabricator.wikimedia.org/D300?download=true | git apply
Summary

This supports having a commit sha backwords compat so you can either
specify branch or branch + commit

Also support for stripping out refs/meta/ from branch url

Example

This is an example with just branch

https://phabricator.wikimedia.org/r/branch/mediawiki/core;master;

This is an example for branch + sha

https://phabricator.wikimedia.org/r/branch/mediawiki/core;master/ebf6c958e4f4deb36dc57c6ba627f15ef2e2dad2

note

Requires https://gerrit.wikimedia.org/r/#/c/301849/ also to be merged at the same time

Bug: T137354
Change-Id: Ic5c8e8c3bde16e62d014065c5814853f5b9c9411

Diff Detail

Repository
rPHEX phabricator-extensions
Branch
wmf/stable
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 719
Build 1069: differential-jessieJenkins
Build 1068: arc lint + arc unit

Event Timeline

Paladox retitled this revision from to Support /r/branches query so we can have a branch and a sha.
Paladox updated this object.
Paladox edited the test plan for this revision. (Show Details)
Paladox edited edge metadata.

Fix name of $branchs to $branches

src/gerrit/GerritApplication.php
46

You use 'branchs' elsewhere but the regexp match will be named $data['branch'] unless you add the s here:
'/r/(?P<action>[a-z]+)/(?P<gerritProject>[^;]+);(?P<branchs>[^;]+);(?P<sha>[0-9a-z]+)',

@mmodell will this work for also stripping refs/heads out of the url.

src/gerrit/GerritApplication.php
45

Oops, never mind. It looks like you fixed it at the same time as I commented.

In D300#6236, @Paladox wrote:

@mmodell will this work for also stripping refs/heads out of the url.

it might work? I'm not sure exactly what you mean.

In D300#6241, @mmodell wrote:
In D300#6236, @Paladox wrote:

@mmodell will this work for also stripping refs/heads out of the url.

it might work? I'm not sure exactly what you mean.

@mmodell Well because $branch is used in getBranchNameFromRef and I'm using $branches I'm not sure if it will work.

Paladox edited edge metadata.

Update to remove branches and instead use branch query.

All tested on phab-01.

Backwords compat, more details in commit msg.

Paladox retitled this revision from Support /r/branches query so we can have a branch and a sha to Support commits in /r/branch url query.Jul 29 2016, 10:08 PM
Paladox updated this object.
Paladox updated this object.
mmodell removed a reviewer: mmodell.

I'm out for all of next week.

@mmodell could I keep you as a reviewer so that when ever your back you could review please?

demon updated the revert plan for this revision. (Show Details)