holmari / gerritstats

Tool for creating statistics from a Gerrit repository
MIT License
193 stars 54 forks source link

Inaccurate gerrit version parsing #13

Closed dvsekhvalnov closed 7 years ago

dvsekhvalnov commented 7 years ago

Given gerrit version 2.12

Attempt to fetch json failing with:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
    at com.holmsted.gerrit.GerritVersion.fromString(GerritVersion.java:25)
    at com.holmsted.gerrit.downloaders.ssh.GerritSsh.version(GerritSsh.java:27)
    at com.holmsted.gerrit.downloaders.Downloader.download(Downloader.java:45)
    at com.holmsted.gerrit.GerritStatsDownloaderMain.main(GerritStatsDownloaderMain.java:17)
holmari commented 7 years ago

I tested the version code with 3 different gerrit versions but did not run into this. @dvsekhvalnov, I'd really appreciate a PR to fix this, it's probably a pretty simple fix in that fromString method.

dvsekhvalnov commented 7 years ago

here you go.

hawkeyej commented 6 years ago

I think that there is still a problem with version parsing.

I have gerrit version 2.13.9 and the generated web page shows "Unknonw Gerrit Version Warning"

gerrit version 2.13.9

image