Page MenuHomePhabricator

Unable to browse refs/meta/config in Diffusion
Closed, ResolvedPublic

Description

With Gitblit, I was able to browse the refs/meta/config branch to see configuration changes of a gerrit project, e.g.:
https://git.wikimedia.org/commit/mediawiki%2Fextensions%2FGoogleLogin.git/c36d61392995722053784cdfab0ed37e3e7367bd and https://git.wikimedia.org/log/mediawiki%2Fextensions%2FGoogleLogin.git/refs%2Fmeta%2Fconfig

However, clicking the "(diffusion)" link of the refs/meta/config ref in the gerrit ref list brings me to:
https://phabricator.wikimedia.org/diffusion/EGLO/browse/refs%252Fmeta%252Fconfig/
which gives me a nice error message:

pasted_file (257×877 px, 22 KB)

Copying the git sha1 of the config change I linked above, and converting it to a Diffusion commit link, I would get https://phabricator.wikimedia.org/rEGLOc36d61392995722053784cdfab0ed37e3e7367bd with the following error:

pasted_file (233×823 px, 33 KB)

Is there a way to browse the history of configuration changes of a gerrit repo (refs/meta/config)? Maybe I just don't see a way :(

Revisions and Commits

Event Timeline

@Florian we import all refs but we doint doint process refs/meta/

We can update this so it does refs/meta/ too.

@mmodell hi do you know how we can do this for refs/meta/ and also refs/drafts/ too please.

We should start processing refs/meta/ since git.wikimedia.org will be redirected soon.

Paladox added a revision: Restricted Differential Revision.Jun 9 2016, 3:04 PM

You can also view on GitHub as long as you added the mirror to that repo in diffusion.

See https://github.com/wikimedia/mediawiki-skins-Metrolook/commit/6e7640e6218c2d76b79a93fbc579fa618884994a please.

Maybe I don't find the button, but I still can't _browse_ the refs/meta/config branch (like in github, e.g. via https://github.com/wikimedia/mediawiki-skins-Metrolook/tree/refs/meta/config). So I don't think this is resolved, yet :(

@Florian we hide that branch to access it you have to do something like

https://phabricator.wikimedia.org/diffusion/SMTL/browse/refs%252Fmeta%252Fconfig/;1d7cd0975c537e662790ec63e9eab871ed6e80d8

which means replace 1d** with the change id.

There is no button since were hiding it.

Ok, accesing the history seems to be possible, too (which is enough I think):
https://phabricator.wikimedia.org/diffusion/SMTL/history/refs%252Fmeta%252Fconfig/;1d7cd0975c537e662790ec63e9eab871ed6e80d8

but, I still need the commit sha1, which, if in doubt, I don't have :(

@Florian ive requested mirroring be turned on that repo so soon as a workaround you could use GitHub.

I'm not sure how to display refs/meta in the UI. It's not a branch and it seems wrong to include it with branches / tags.

Did this ticket change since gitblit was shut down and we are redirecting those git.wm.org URLs into Diffusion now?

Krinkle subscribed.

Making as Regression. Since git.wikimedia.org is now redirect-only, and Gerrit was updated to point to Diffusion directly, these files are now unviewable from the user interface.

Doing something like https://phabricator.wikimedia.org/diffusion/EGLO/browse/refs%252Fmeta%252Fconfig/;refs/meta/config works

So if we update in phabricator to detect when someone does refs/meta/config to do ;refs/meta/config at the end of the url it should work (Only if a user use a gerrit specific format link)

Paladox triaged this task as High priority.Jul 10 2016, 3:49 PM

Changing to high since it would be useful to view current gerrit project settings without going through the hassel of trying to find the correct link.

I think I may have an idea on how to fix this in gerrit, it requires a change in gerrit and phabricator.

So will need help by @mmodell to develop the fix please.

Paladox added revisions: Restricted Differential Revision, Restricted Differential Revision.Jul 29 2016, 5:41 PM
Paladox removed a revision: Restricted Differential Revision.Jul 29 2016, 10:09 PM

If you pass ["refs/meta/config"] as refs and "OPUP" as callsign to Phabricator's diffusion.resolverefs API, it recognises the current tip of OPUP's refs/meta/config as rOPUP40fd8079d06d

Gerrit links to https://phabricator.wikimedia.org/diffusion/LSTR/history/refs/meta/config/project.config from the relevant project's ACL page - perhaps it should escape that a bit, so you get https://phabricator.wikimedia.org/diffusion/LSTR/history/refs%252Fmeta%252Fconfig/project.config - but that doesn't work.
It turns out you can actually do https://phabricator.wikimedia.org/diffusion/LSTR/history/production/project.config;refs/meta/config

So clearly Phabricator recognises these references, it just doesn't count anything that it doesn't consider a branch for these purposes... DiffusionRequest::queryStableCommit does specify TYPE_BRANCH only...

Phabricator really just has special case handling of branches and tags but doesn't have good support for other refs. It knows about them but there is no UI for browsing refs.

@Paladox has it figured out, you need to fake the branch name with /browse/refs%252Fmeta%252Fconfig/ (this gets displayed in the breadcrumbs at the top of the page, and is required to avoid a not-found error) then append ;refs/meta/config to the end of the url to specify the specific ref, which is the part that phabricator uses to look up the ref in the repository.

Can we just append ;refs/meta/config to links in gerrit?

@mmodell I doint think so, unless we do an upstream change that allows us to change the link on a per branch link in gerrit.

I have been trying to do this but it didn't work.

Unless we add something on phabricator side that detects refs/meta/config and then add ;refs/meta/config

Can we handle this in the Gitblit redirect script for https://phabricator.wikimedia.org/r/p/?

These urls currently already go through that. We don't link to https://phabricator.wikimedia.org/diffusion/MW/history/refs/meta/config/project.config directly from Gerrit, from https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/core,access it links to https://phabricator.wikimedia.org/r/p/mediawiki/core/;history/refs/meta/config/project.config

Perhaps we can special-case it there and replace branch with "-" (or escaped display name) and append ;refs/meta/config, producing the working link:
https://phabricator.wikimedia.org/diffusion/MW/history/-/project.config;refs/meta/config

@Krinkle we will need to support stripping refs/heads/ on https://phabricator.wikimedia.org/r/p/ first, then we could probably go with doing that?

@mmodell could you do ^^ please.

Change 308885 had a related patch set (by Paladox) published:
Fix broken refs/meta/config diffusion links in access section

https://gerrit.wikimedia.org/r/308885

Change 308885 merged by Dzahn:
Fix broken refs/meta/config diffusion links in access section

https://gerrit.wikimedia.org/r/308885

merged Paladox' change.

going from https://gerrit.wikimedia.org/r/#/admin/projects/operations/puppet,access to https://phabricator.wikimedia.org/r/p/operations/puppet/;history/project.config/;refs/meta/config now works instead of the ""Unhandled Exception ("DiffusionRefNotFoundException") Ref "refs" does not exist in this repository."" we got before. Thanks!

We have a workaround now, it takes us to the history page but you can click browse and it
should work as @Dzahn showed.

@Dzahn thanks for merging.

  1. Go to https://gerrit.wikimedia.org/
  2. Click "Projects > List"
  3. Click "IPSet"
  4. Click "Projects > Branches"
  5. Click "diffusion" link for "branch name = HEAD" and end up on https://phabricator.wikimedia.org/diffusion/GIPS/browse/ (correct)
  6. Click "diffusion" link for "branch name = refs/meta/config"

End up on https://phabricator.wikimedia.org/diffusion/GIPS/browse/refs%252Fmeta%252Fconfig/ saying

Unhandled Exception ("DiffusionRefNotFoundException")
Ref "refs/meta/config" does not exist in this repository.

Yeh branches wont work yet, that will need a change in the phabricator core, ie the extension repo we have.

But workaround is to do it through access

https://gerrit.wikimedia.org/r/#/admin/projects/IPSet,access

click the diffusion link in there, it will take you to the history of the file then click browse repo

Fixed in https://gerrit-review.googlesource.com/#/c/92620/ again. gerrit 2.13.4 should have the fix.

Note: by fix I mean we have our workaround back in that release, not actually fixed as in we doint need to access that page to get to refs/meta/config in phabricator diffusion.

This should now be fixed as we pulled from upstream 2.13 branch which included the fix :)

By that I mean using the workaround.

Paladox added a revision: Restricted Differential Revision.Jul 1 2017, 10:46 PM

This D703 will finally resolve this task :)

mmodell lowered the priority of this task from High to Medium.

I'll deploy it this week