finding out Gerrit version

1,348 views
Skip to first unread message

Tomasz Zarna

unread,
Jul 3, 2013, 8:02:49 AM7/3/13
to repo-d...@googlegroups.com
Hi guys,

What's the most reliable way of finding out what's the version of a Gerrit server if the only thing I have is its URL?

For example:
Ideally, I would like to be able to recognize ancient versions like 2.1.x as well.

Cheers,
Tomek

Saša Živkov

unread,
Jul 3, 2013, 8:09:38 AM7/3/13
to Tomasz Zarna, repo-d...@googlegroups.com
On Wed, Jul 3, 2013 at 2:02 PM, Tomasz Zarna <tomasz...@tasktop.com> wrote:
Hi guys,

What's the most reliable way of finding out what's the version of a Gerrit server if the only thing I have is its URL?

The version is displayed in the bottom right corner in the UI.
 

For example:
Ideally, I would like to be able to recognize ancient versions like 2.1.x as well.

Cheers,
Tomek

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
 
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Saša Živkov

unread,
Jul 3, 2013, 8:10:52 AM7/3/13
to Tomasz Zarna, repo-d...@googlegroups.com
Another way is to use:

ssh -p29418 you@gerrit-server gerrit version


On Wed, Jul 3, 2013 at 2:02 PM, Tomasz Zarna <tomasz...@tasktop.com> wrote:

--

Tomasz Zarna

unread,
Jul 3, 2013, 8:15:52 AM7/3/13
to repo-d...@googlegroups.com, Tomasz Zarna
Thanks for the lightning fast reply! I should have added I want to get that info programatically, as an anonymous user.

Cheers,

Shawn Pearce

unread,
Jul 3, 2013, 11:35:40 AM7/3/13
to Tomasz Zarna, repo-discuss
There isn't a good way to do this. We didn't export the server version
of HTTP until master (aka 2.8), and even then its embedded into the
host page data object in the / HTML response. Which is never fun to
parse from a program.

But I did find a backdoor into the version for you. Its still not
pretty but may be workable.

Parse the HTML of https://gerrit-review.googlesource.com/tools/hooks/.
There is a "Powered by Gerrit Code Review" footer buried in an <p>
tag:

$ curl https://gerrit-review.googlesource.com/tools/hooks/
<html><head><META http-equiv="Content-Type" content="text/html;
charset=UTF-8"><title>Gerrit Code Review -
/tools/hooks</title></head><body><h1>Gerrit Code Review -
/tools/hooks</h1><ul><li><a
href="commit-msg">commit-msg</a></li></ul><hr><p style="text-align:
right; font-style: italic">Powered by Gerrit Code Review
2.7-rc2-647-gba149ce</p></body></html>

This feature first appeared in 2.1.2-rc0 and has been available
unmodified since.

A change to add /config/server/version as a REST API that can be more
reliably polled and parsed would be welcome.

Edwin Kempin

unread,
Jul 4, 2013, 10:06:23 AM7/4/13
to Shawn Pearce, Tomasz Zarna, repo-discuss

Tomasz Zarna

unread,
Jul 4, 2013, 4:55:13 PM7/4/13
to repo-d...@googlegroups.com, Shawn Pearce, Tomasz Zarna
Thanks guys!
Reply all
Reply to author
Forward
0 new messages