[openstack-dev] Making changes to gerrit's presentation

Sean Dague sean at dague.net
Tue May 10 11:19:12 UTC 2016

On 05/10/2016 06:42 AM, Chris Dent wrote:
> There are many things to complain about in gerrit but one of the
> things I like the least is the inability to link to a specific chunk
> of a review. Or at least I can't find one.
> What I'd like to be able to do is:
> * someone make a comment in gerrit that I would like to discuss in
>   IRC
> * I want to go IRC and instead of saying "hey so and so, your
>   comment on patch X of the review at $URL confuses me..." I want to
>   say "hey so and so, $DIRECT_LINK_TO_ANCHOR confuses me"
> So I had a look in the HTML source of the page to see if there id or
> name attributes that could be linked to (and could then be cooked to
> be exposed by some javascript) and it's a bunch of heinous
> autogenned hoopa joop. So that route seems to be a bit of a dead
> end.
> Do we have any control over the HTML presentation of gerrit? If we
> do, I'm happy to do the work to make this change if someone points
> me in the right direction.
> Or better: have I missed something obvious and there's some frobnitz
> I can massage?

Gerrit's is a GWT app, which means the entire thing is Java which
compiles to HTML/JS, for anything deep, you have to dive down that
rabbit hole.

>From the Comments overview on the front of a Review -
https://review.openstack.org/#/c/313532/9 - you will fine the Line: ###
are actually clickable and provide links of the format -

That will put L553 on the new side at the center of the page, and stick
the cursor there (which is subtle).

Once a change is pushed, that ref also exists in github (given how all
our mirroring works). Often times it's easiest to link to things there
by permalink. I will often use https://github.com/sshaw/git-link to
build me such links if I've got the code down locally.

At worse, I'll link the file and say L### in IRC to just be specific.
It's not quite the same as a direct url, but communication is what matters.


Sean Dague

More information about the OpenStack-dev mailing list