gitiles plugin not working in 2.11.2?

973 views
Skip to first unread message

Dariusz Trawinski

unread,
Jul 15, 2015, 4:32:12 AM7/15/15
to repo-d...@googlegroups.com
After upgrade to 2.11.2 the observation is that gitiles plugin stopped working correctly. Browsing branches works fine but browsing code gives Server Error.
In the error logs there are records like:
ERROR com.google.gerrit.pgm.http.jetty.HiddenErrorHandler : Error in GET /plugins/gitiles/a/platform/manifest/+/master
java.lang.NoSuchMethodError: org.eclipse.jgit.revwalk.RevWalk.release()V
        at com.google.gitiles.RevisionParser.parse(RevisionParser.java:198)
        at com.google.gitiles.ViewFilter.parseRevision(ViewFilter.java:307)
        at com.google.gitiles.ViewFilter.parseAutoCommand(ViewFilter.java:207)
        at com.google.gitiles.ViewFilter.parse(ViewFilter.java:154)
        at com.google.gitiles.ViewFilter.doFilter(ViewFilter.java:98)
        at com.google.gitiles.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32)
        at com.google.gitiles.ViewFilter.doFilter(ViewFilter.java:38)

WARN  org.eclipse.jetty.servlet.ServletHandler : Error for /plugins/gitiles/a/platform/manifest/+/master
java.lang.NoSuchMethodError: org.eclipse.jgit.revwalk.RevWalk.release()V
        at com.google.gitiles.RevisionParser.parse(RevisionParser.java:198)
        at com.google.gitiles.ViewFilter.parseRevision(ViewFilter.java:307)
        at com.google.gitiles.ViewFilter.parseAutoCommand(ViewFilter.java:207)
        at com.google.gitiles.ViewFilter.parse(ViewFilter.java:154)
        at com.google.gitiles.ViewFilter.doFilter(ViewFilter.java:98)

Is it a know issue? Could it be related to jgit upgrade? Is it somehow related to this discussion https://groups.google.com/forum/#!topic/repo-discuss/ytsFTX4BDco   ?

Alex Blewitt

unread,
Jul 15, 2015, 4:36:32 AM7/15/15
to Dariusz Trawinski, repo-d...@googlegroups.com
I believe that JGit was upgraded to change the ‘release’ to ‘close’ due to the AutoCloseable interface:


I seem to recall with JGit 4 that the ‘release’ method was removed, to avoid confusion as to which of release/close should be called. So it looks like the Gitiles plugin is still calling the .release() instead of the newer .close() method, but that’s just a guess.

--
--
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/d/optout.

Matthias Sohn

unread,
Jul 15, 2015, 9:13:52 AM7/15/15
to Alex Blewitt, Dariusz Trawinski, Repo and Gerrit Discussion
exactly, since JGit 4.0 RevWalk.release() is replaced by RevWalk.close() to support AutoClosable.

David Pursehouse

unread,
Jul 15, 2015, 9:36:12 AM7/15/15
to Alex Blewitt, Dariusz Trawinski, repo-d...@googlegroups.com
On Wed, Jul 15, 2015 at 5:36 PM Alex Blewitt <alex.b...@gmail.com> wrote:
I believe that JGit was upgraded to change the ‘release’ to ‘close’ due to the AutoCloseable interface:


I seem to recall with JGit 4 that the ‘release’ method was removed, to avoid confusion as to which of release/close should be called. So it looks like the Gitiles plugin is still calling the .release() instead of the newer .close() method, but that’s just a guess.


It's gitiles itself, which the gitiles plugin depends on, that is still calling the release() method.

A change was already merged on gitiles [1] to adapt to the changes in jgit, but there has not been a new release since then which the plugin can pick up.

I've just uploaded a change to bump the version [2].  Once that's merged and a new release of gitiles is available, we can update the plugin to use it.

Doug Kelly

unread,
Jul 16, 2015, 3:03:47 PM7/16/15
to repo-d...@googlegroups.com, dtra...@gmail.com, alex.b...@gmail.com
Also related, stable-2.10 is impacted by this change, since 2.10.5 updates to JGit 4... but since we don't have Guava 18 on stable-2.10, the other changes to gitiles will not run (at a minimum, it seems to be depending on com.google.common.base.MoreObjects).  Sure, I could cook a custom Gitiles version that'd be compatible, but I'd rather not envision how I have to get the build to take with Buck (I think I'd have to set it to a local repo, etc).

--Doug

Doug Kelly

unread,
Jul 17, 2015, 2:28:41 PM7/17/15
to repo-d...@googlegroups.com, alex.b...@gmail.com, dtra...@gmail.com


On Thursday, July 16, 2015 at 2:03:47 PM UTC-5, Doug Kelly wrote:
Also related, stable-2.10 is impacted by this change, since 2.10.5 updates to JGit 4... but since we don't have Guava 18 on stable-2.10, the other changes to gitiles will not run (at a minimum, it seems to be depending on com.google.common.base.MoreObjects).  Sure, I could cook a custom Gitiles version that'd be compatible, but I'd rather not envision how I have to get the build to take with Buck (I think I'd have to set it to a local repo, etc).

If it helps anyone else, I figured out how to backport enough of the change to Gitiles to build it working with Gerrit >=2.10.5.  It's a little bit of work since Gitiles has to be patched, but I can either provide the steps or a compiled JAR to anyone. 

Sebastian Klapp

unread,
Jul 20, 2015, 8:01:46 AM7/20/15
to repo-d...@googlegroups.com, alex.b...@gmail.com, dtra...@gmail.com
At least I would be very pleased if you could provide me a Gitiles version that is compatible with >=2.10.5.

Roman Shiryaev

unread,
Jul 27, 2015, 2:22:33 PM7/27/15
to Repo and Gerrit Discussion, alex.b...@gmail.com, dtra...@gmail.com, doug...@gmail.com
Please share the patch with a community. Thanks in advance.

Doug Kelly

unread,
Jul 27, 2015, 3:04:49 PM7/27/15
to Roman Shiryaev, Repo and Gerrit Discussion, alex.b...@gmail.com, dtra...@gmail.com
Sure... first of all, I'm basing the patch on commit de0dba359f24ce1daaf6de68ca195334f621e4b6 in https://gerrit.googlesource.com/gitiles -- no particular reason why I chose this commit, other than it was before the dependency to update Guava (I had tried a later commit, but that required the update to Soy and additional dependencies, which caused more headaches than I wanted to deal with).

Then, after building gitiles and installing the resulting artifacts to my local mvn repository (buck build gitiles && buck build mvn_install), I added modified the BUCK file in https://gerrit.googlesource.com/plugins/gitiles at commit 6be187457cfa02cbd706fb5dede4b7c01c30f9eb, which should be the current stable-2.10 branch.  Changes I had to make:
* Update the build identifier and SHA1 to whatever fake identifier I chose
* Switch the Gitiles repository to MAVEN_LOCAL
* Add to the gitiles maven_jar() parameters:
  deps = [':prettify'],

And add the new dependency:

maven_jar(
  name = 'prettify',
  id = 'prettify:java-prettify:1.2.1',
  sha1 = '29ad8d072f9d0b83d1a2e9aa6ccb0905e6d543c6',
  license = 'Apache2.0',
  repository = GERRIT,
)

Note that I can't predict the new SHA1, so some assembly is required.

--Doug
0001-Update-to-JGit-4.0.0.201505191015-rc1.19-g1773002.patch

David Pursehouse

unread,
Jul 29, 2015, 5:47:13 AM7/29/15
to Doug Kelly, Roman Shiryaev, Repo and Gerrit Discussion, alex.b...@gmail.com, dtra...@gmail.com
Update on the status for 2.11.x:

- New version of gitiles was released which includes updated versions of
JGit and Guice.

- Gerrit is updated to use the same version of Guice as used in Gitiles.

- Changes have been merged on the stable-2.11 branch of the gitiles
plugin to use the new gitiles library and same version of Guice.

- One more change is pending on Gerrit [1] to fix Markdown rendering.

I plan to release 2.11.3 next week.

@Doug would it help to have a stable-2.10 branch on the gitiles project?

[1] https://gerrit-review.googlesource.com/#/c/69870/
> --
> --
> 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
> <mailto:repo-discuss...@googlegroups.com>.

Doug Kelly

unread,
Jul 29, 2015, 7:11:50 AM7/29/15
to David Pursehouse, Roman Shiryaev, Repo and Gerrit Discussion, alex.b...@gmail.com, dtra...@gmail.com
Yeah, a branch for gitiles wouldn't hurt, but the other problem is releasing the new artifact (and how to version it under the Maven versioning scheme).

I also still want to get the login redirect fix merged for the gitiles plugin. :)

Thanks!

David Pursehouse

unread,
Jul 29, 2015, 7:30:09 AM7/29/15
to Doug Kelly, Roman Shiryaev, Repo and Gerrit Discussion, alex.b...@gmail.com, dtra...@gmail.com

I am able to build and upload new releases of gitiles to the Google Maven Repo.

For the version can we just append ".1" onto whatever it currently is?


To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.

Doug Kelly

unread,
Jul 29, 2015, 8:01:10 AM7/29/15
to David Pursehouse, Roman Shiryaev, Repo and Gerrit Discussion, alex.b...@gmail.com, dtra...@gmail.com
I think that'd make it 0.1-2.1 ;) (Gitiles hasn't been strongly versioned because there's not been a need for it to be, as I understand it, which kinda makes the task difficult now.)
Reply all
Reply to author
Forward
0 new messages