.repo folder + gerrit

171 views
Skip to first unread message

Sammy Gillespie

unread,
Jan 20, 2016, 6:52:33 AM1/20/16
to Repo and Gerrit Discussion
As part of a larger system I'm looking to mirror the android source repo so that we can save on bandwidth internally etc.

I currently have a gerrit server set up with the gitiles plugin (which I'm more than willing to edit to meet my needs), so it makes sense to integrate it into this.

However I'm trying to work out if there's a sensible way to do this that I just can't spot.

Currently the simplest concept would be to just "repo sync" into my gerrit's git repository. Then flush gerrit's caches when done. Do this regularly enough and all works fine. But this is where I run into problems.

Gerrit decides that all the symlinked .repo projects are, themselves, their own project. So I have twice as many projects as expected, and a bunch are .repo projects. Is there a nice way to make gerrit ignore these?

Initially I tried simply making them all HIDDEN with a script, which looked like it mostly worked! But then the gitiles plugin decided it was going to show them anyway, but when you try to access them you just cause a server error (index out of bounds or something like that).

I could, in theory, remove read access from every single user on them (which would hide the projects in the gitiles plugin, in theory), but it feels really hacky. Is there a sensible way I'm missing?

---------------

And yes, I could repo somewhere else, and clone the contents over to gerrit, and do this weird two stage thing. I'd just rather not have to deal with that if it's avoidable (because nobody likes unnecessary replication)

Hope you guys can shed some light on this.

Magnus Bäck

unread,
Jan 20, 2016, 7:19:31 AM1/20/16
to Sammy Gillespie, Repo and Gerrit Discussion
On Wednesday, January 20, 2016 at 12:23 CET,
Sammy Gillespie <sammygi...@gmail.com> wrote:

> As part of a larger system I'm looking to mirror the android source
> repo so that we can save on bandwidth internally etc.
> I currently have a gerrit server set up with the gitiles plugin (which
> I'm more than willing to edit to meet my needs), so it makes sense to
> integrate it into this.
> However I'm trying to work out if there's a sensible way to do this
> that I just can't spot.
> Currently the simplest concept would be to just "repo sync" into my
> gerrit's git repository. Then flush gerrit's caches when done. Do this
> regularly enough and all works fine. But this is where I run into
> problems.
> Gerrit decides that all the symlinked .repo projects are, themselves,
> their own project. So I have twice as many projects as expected, and a
> bunch are .repo projects. Is there a nice way to make gerrit ignore
> these?

It sounds like you're not passing --mirror to 'repo init' and that your
gits therefore aren't bare. They should be. You should also consider
using the mirror manifest as seen below.

https://source.android.com/source/downloading.html#using-a-local-mirror

[...]

--
Magnus Bäck | Software Engineer, Firmware Platform Tools
magnu...@axis.com | Axis Communications

Sammy Gillespie

unread,
Jan 20, 2016, 7:49:52 AM1/20/16
to Repo and Gerrit Discussion, sammygi...@gmail.com
Huh... Looking back at my previous commands I can see I ran "repo init -u https://android.googlesource.com/mirror/manifest --mirror" to initialize this repo. Could I have done something afterwards to affect this again?

Can I ask how an android source --mirror and gerrit should interact by default? Should gerrit not show bare gits, for example? I just can't see what I've done wrong so far...

Note: I first ran repo, then initialized gerrit on top of the directory when testing this.

Sammy Gillespie

unread,
Jan 20, 2016, 8:27:39 AM1/20/16
to Repo and Gerrit Discussion, sammygi...@gmail.com
Oh wait... maybe I accidentally did an initial repo init before cancelling it.... that would have potentially populated this stuff. And when I went to remove it I could have easily missed the hidden folder. I don't remember doing that, but there's a possibility.

Is there a way to easily fix this? Like can I remove .repo and repo init again without downloading the entire source? I'll do it if I have to, but I'd prefer not to.

Sammy Gillespie

unread,
Jan 21, 2016, 5:02:08 AM1/21/16
to Repo and Gerrit Discussion
Ok. Thanks for the help. I just went for it and removed .repo and re-initiated and re-synced. I sort of remembered that each project was holding its own history, not the .repo ones (which to me were mirrored at the time).

All appears to be working now though!

---------------

On a side note: I could test it more but I don't think the gitiles plugin doesn't hide "hidden" projects from the default list. But when you try to view the hidden project you cause a server error (index out of bounds).  I can't find any feature tracker or bug reported for it so I thought I'd post it here.

This was happening at least when I tried to hide the extra .repo repositories I had.
Reply all
Reply to author
Forward
0 new messages